[B]VMLINUZ for 0x40 series filters
packerf.cpp p_vmlinz.cpp committer: jreiser <jreiser> 1039144160 +0000
This commit is contained in:
+8
-3
@@ -283,7 +283,7 @@ void PackVmlinuzI386::pack(OutputFile *fo)
|
|||||||
fo->write(setup_buf, setup_buf.getSize());
|
fo->write(setup_buf, setup_buf.getSize());
|
||||||
fo->write(loader, lsize);
|
fo->write(loader, lsize);
|
||||||
fo->write(obuf, ph.c_len);
|
fo->write(obuf, ph.c_len);
|
||||||
#if 0
|
#if 1
|
||||||
printf("%-13s: setup : %8ld bytes\n", getName(), (long) setup_buf.getSize());
|
printf("%-13s: setup : %8ld bytes\n", getName(), (long) setup_buf.getSize());
|
||||||
printf("%-13s: loader : %8ld bytes\n", getName(), (long) lsize);
|
printf("%-13s: loader : %8ld bytes\n", getName(), (long) lsize);
|
||||||
printf("%-13s: compressed : %8ld bytes\n", getName(), (long) ph.c_len);
|
printf("%-13s: compressed : %8ld bytes\n", getName(), (long) ph.c_len);
|
||||||
@@ -307,7 +307,7 @@ int PackBvmlinuzI386::buildLoader(const Filter *ft)
|
|||||||
// prepare loader
|
// prepare loader
|
||||||
initLoader(nrv_loader, sizeof(nrv_loader));
|
initLoader(nrv_loader, sizeof(nrv_loader));
|
||||||
addLoader("LINUZ000",
|
addLoader("LINUZ000",
|
||||||
ft->id ? "LZCALLT1" : "",
|
(0x40==(0xf0 & ft->id)) ? "LZCKLLT1" : (ft->id ? "LZCALLT1" : ""),
|
||||||
"LBZIMAGE""IDENTSTR",
|
"LBZIMAGE""IDENTSTR",
|
||||||
"+40D++++", // align the stuff to 4 byte boundary
|
"+40D++++", // align the stuff to 4 byte boundary
|
||||||
"UPX1HEAD", // 32 byte
|
"UPX1HEAD", // 32 byte
|
||||||
@@ -318,7 +318,12 @@ int PackBvmlinuzI386::buildLoader(const Filter *ft)
|
|||||||
if (ft->id)
|
if (ft->id)
|
||||||
{
|
{
|
||||||
assert(ft->calls > 0);
|
assert(ft->calls > 0);
|
||||||
addLoader("LZCALLT9", NULL);
|
if (0x40==(0xf0 & ft->id)) {
|
||||||
|
addLoader("LZCKLLT9", NULL);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
addLoader("LZCALLT9", NULL);
|
||||||
|
}
|
||||||
addFilter32(ft->id);
|
addFilter32(ft->id);
|
||||||
}
|
}
|
||||||
addLoader("LINUZ990", NULL);
|
addLoader("LINUZ990", NULL);
|
||||||
|
|||||||
+5
-1
@@ -371,9 +371,13 @@ bool Packer::patchFilter32(void *loader, int lsize, const Filter *ft)
|
|||||||
assert(ft->calls > 0);
|
assert(ft->calls > 0);
|
||||||
|
|
||||||
if (ft->id < 0x80) {
|
if (ft->id < 0x80) {
|
||||||
if (0x40 <= ft->id && ft->id < 0x50 && UPX_F_LINUX_i386==ph.format) {
|
if (0x40 <= ft->id && ft->id < 0x50
|
||||||
|
&& ( UPX_F_LINUX_i386 ==ph.format
|
||||||
|
|| UPX_F_VMLINUZ_i386 ==ph.format
|
||||||
|
|| UPX_F_BVMLINUZ_i386==ph.format ) ) {
|
||||||
// "push byte '?'"
|
// "push byte '?'"
|
||||||
patch_le16(loader, lsize, "\x6a?", 0x6a + (ft->cto << 8));
|
patch_le16(loader, lsize, "\x6a?", 0x6a + (ft->cto << 8));
|
||||||
|
checkPatch(NULL, 0, 0, 0); // reset
|
||||||
}
|
}
|
||||||
if (0x20 <= ft->id && ft->id < 0x40) {
|
if (0x20 <= ft->id && ft->id < 0x40) {
|
||||||
// 077==modr/m of "cmp [edi], byte '?'" (compare immediate 8 bits)
|
// 077==modr/m of "cmp [edi], byte '?'" (compare immediate 8 bits)
|
||||||
|
|||||||
Reference in New Issue
Block a user