1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

bvmlinuz piggy.o need not be last in bzImage

This commit is contained in:
John Reiser 2007-07-02 14:27:31 -07:00
parent d17f8c5049
commit 959aaebede

View File

@ -208,7 +208,11 @@ int PackVmlinuzI386::decompressKernel()
if (fd_pos != file_size)
{
//printf("fd_pos: %ld, file_size: %ld\n", (long)fd_pos, (long)file_size);
throwCantPack("trailing bytes after kernel image; use option '-f' to force packing");
// linux-2.6.21.5/arch/i386/boot/compressed/vmlinux.lds
// puts .data.compressed ahead of .text, .rodata, etc;
// so piggy.o need not be last in bzImage. Alas.
//throwCantPack("trailing bytes after kernel image; use option '-f' to force packing");
}
@ -216,11 +220,12 @@ int PackVmlinuzI386::decompressKernel()
// 2.4.x: [cli;] cld; mov $...,%eax
if (memcmp(ibuf, "\xFC\xB8", 2) == 0) goto head_ok;
if (memcmp(ibuf, "\xFA\xFC\xB8", 3) == 0) goto head_ok;
// 2.6.21.5 CONFIG_PARAVIRT mov %cs,%eax; test $3,%eax; jne ...;
if (memcmp(ibuf, "\x8c\xc8\xa9\x03\x00\x00\x00\x0f\x85", 9) == 0) goto head_ok;
if (memcmp(ibuf, "\x8c\xc8\xa8\x03\x0f\x85", 6) == 0) goto head_ok;
// 2.6.x: [cli;] cld; lgdt ...
if (memcmp(ibuf, "\xFC\x0F\x01", 3) == 0) goto head_ok;
if (memcmp(ibuf, "\xFA\xFC\x0F\x01", 4) == 0) goto head_ok;
// 2.6.21.5 CONFIG_PARAVIRT mov %cs,%eax; test $3,%eax; jne ...;
if (memcmp(ibuf, "\x8c\xc8\xa9\x03\x00\x00\x00\x0f\x85", 9) == 0) goto head_ok;
// 2.6.x+grsecurity+strongswan+openwall+trustix: ljmp $0x10,...
if (ibuf[0] == 0xEA && memcmp(ibuf+5, "\x10\x00", 2) == 0) goto head_ok;
// x86_64 2.6.x