Cleanups.

committer: mfx <mfx> 978563615 +0000
This commit is contained in:
Markus F.X.J. Oberhumer
2001-01-03 23:13:35 +00:00
parent 823ac11eb3
commit 7766b08f08
7 changed files with 31 additions and 20 deletions
+10 -6
View File
@@ -62,7 +62,9 @@ const int *PackCom::getCompressionMethods(int method, int level) const
const int *PackCom::getFilters() const const int *PackCom::getFilters() const
{ {
static const int filters[] = { 0x06, 0x03, 0x04, 0x01, 0x05, 0x02, -1 }; static const int filters[] = {
0x06, 0x03, 0x04, 0x01, 0x05, 0x02,
-1 };
return filters; return filters;
} }
@@ -138,21 +140,23 @@ void PackCom::patchLoader(OutputFile *fo,
int PackCom::buildLoader(const Filter *ft) int PackCom::buildLoader(const Filter *ft)
{ {
const int filter_id = ft->id;
initLoader(nrv2b_loader,sizeof(nrv2b_loader)); initLoader(nrv2b_loader,sizeof(nrv2b_loader));
addLoader("COMMAIN1""COMSUBSI", addLoader("COMMAIN1""COMSUBSI",
ph.first_offset_found == 1 ? "COMSBBBP" : "", ph.first_offset_found == 1 ? "COMSBBBP" : "",
"COMPSHDI", "COMPSHDI",
filter_id ? "COMCALLT" : "", ft->id ? "COMCALLT" : "",
"COMMAIN2""UPX1HEAD""COMCUTPO""NRV2B160", "COMMAIN2""UPX1HEAD""COMCUTPO""NRV2B160",
filter_id ? "NRVDDONE" : "NRVDRETU", ft->id ? "NRVDDONE" : "NRVDRETU",
"NRVDECO1", "NRVDECO1",
ph.max_offset_found <= 0xd00 ? "NRVLED00" : "NRVGTD00", ph.max_offset_found <= 0xd00 ? "NRVLED00" : "NRVGTD00",
"NRVDECO2""NRV2B169", "NRVDECO2""NRV2B169",
NULL NULL
); );
if (filter_id) if (ft->id)
addFilter16(filter_id); {
assert(ft->calls > 0);
addFilter16(ft->id);
}
return getLoaderSize(); return getLoaderSize();
} }
+3 -2
View File
@@ -67,8 +67,9 @@ const int *PackDjgpp2::getCompressionMethods(int method, int level) const
const int *PackDjgpp2::getFilters() const const int *PackDjgpp2::getFilters() const
{ {
static const int filters[] = { 0x26, 0x24, 0x11, 0x14, 0x13, 0x16, static const int filters[] = {
0x25, 0x15, 0x12, -1 }; 0x26, 0x24, 0x11, 0x14, 0x13, 0x16, 0x25, 0x15, 0x12,
-1 };
return filters; return filters;
} }
+6 -4
View File
@@ -104,20 +104,22 @@ void PackSys::patchLoader(OutputFile *fo,
int PackSys::buildLoader(const Filter *ft) int PackSys::buildLoader(const Filter *ft)
{ {
const int filter_id = ft->id;
initLoader(nrv2b_loader,sizeof(nrv2b_loader)); initLoader(nrv2b_loader,sizeof(nrv2b_loader));
addLoader("SYSMAIN1", addLoader("SYSMAIN1",
opt->cpu == opt->CPU_8086 ? "SYSI0861" : "SYSI2861", opt->cpu == opt->CPU_8086 ? "SYSI0861" : "SYSI2861",
"SYSMAIN2""SYSSUBSI", "SYSMAIN2""SYSSUBSI",
ph.first_offset_found == 1 ? "SYSSBBBP" : "", ph.first_offset_found == 1 ? "SYSSBBBP" : "",
filter_id ? "SYSCALLT" : "", ft->id ? "SYSCALLT" : "",
"SYSMAIN3""UPX1HEAD""SYSCUTPO""NRV2B160""NRVDDONE""NRVDECO1", "SYSMAIN3""UPX1HEAD""SYSCUTPO""NRV2B160""NRVDDONE""NRVDECO1",
ph.max_offset_found <= 0xd00 ? "NRVLED00" : "NRVGTD00", ph.max_offset_found <= 0xd00 ? "NRVLED00" : "NRVGTD00",
"NRVDECO2""NRV2B169", "NRVDECO2""NRV2B169",
NULL NULL
); );
if (filter_id) if (ft->id)
addFilter16(filter_id); {
assert(ft->calls > 0);
addFilter16(ft->id);
}
addLoader("SYSMAIN5", addLoader("SYSMAIN5",
opt->cpu == opt->CPU_8086 ? "SYSI0862" : "SYSI2862", opt->cpu == opt->CPU_8086 ? "SYSI0862" : "SYSI2862",
"SYSJUMP1", "SYSJUMP1",
+3 -2
View File
@@ -64,8 +64,9 @@ const int *PackTmt::getCompressionMethods(int method, int level) const
const int *PackTmt::getFilters() const const int *PackTmt::getFilters() const
{ {
static const int filters[] = { 0x26, 0x24, 0x11, 0x14, 0x13, 0x16, static const int filters[] = {
0x25, 0x12, 0x15, -1 }; 0x26, 0x24, 0x11, 0x14, 0x13, 0x16, 0x25, 0x12, 0x15,
-1 };
return filters; return filters;
} }
+3 -2
View File
@@ -73,8 +73,9 @@ const int *PackVmlinuzI386::getCompressionMethods(int method, int level) const
const int *PackVmlinuzI386::getFilters() const const int *PackVmlinuzI386::getFilters() const
{ {
static const int filters[] = { 0x26, 0x24, 0x11, 0x14, 0x13, 0x16, static const int filters[] = {
0x25, 0x15, 0x12, -1 }; 0x26, 0x24, 0x11, 0x14, 0x13, 0x16, 0x25, 0x15, 0x12,
-1 };
return filters; return filters;
} }
+3 -2
View File
@@ -115,8 +115,9 @@ const int *PackW32Pe::getCompressionMethods(int method, int level) const
const int *PackW32Pe::getFilters() const const int *PackW32Pe::getFilters() const
{ {
static const int filters[] = { 0x26, 0x24, 0x16, 0x13, 0x14, 0x11, static const int filters[] = {
0x25, 0x15, 0x12, -1 }; 0x26, 0x24, 0x16, 0x13, 0x14, 0x11, 0x25, 0x15, 0x12,
-1 };
return filters; return filters;
} }
+3 -2
View File
@@ -83,8 +83,9 @@ const int *PackWcle::getCompressionMethods(int method, int level) const
const int *PackWcle::getFilters() const const int *PackWcle::getFilters() const
{ {
static const int filters[] = { 0x26, 0x24, 0x14, 0x11, 0x16, 0x13, static const int filters[] = {
0x25, 0x12, 0x15, -1 }; 0x26, 0x24, 0x14, 0x11, 0x16, 0x13, 0x25, 0x12, 0x15,
-1 };
return filters; return filters;
} }