1
0
mirror of https://github.com/upx/upx synced 2025-10-05 19:20:23 +08:00

tweak i386-linux.kernel.vmlinux-head.S

This commit is contained in:
John Reiser 2007-01-08 13:56:47 -08:00
parent 2f6ae3ef01
commit 10dc580a3a
4 changed files with 19 additions and 18 deletions

View File

@ -954,7 +954,7 @@ bool PackVmlinuxAMD64::has_valid_vmlinux_head()
// //
// Example test jig: // Example test jig:
// $ gcc -o test-piggy -nostartfiles -nostdlib test-piggy.o piggy.o // $ gcc -m32 -o test-piggy -nostartfiles -nostdlib test-piggy.o piggy.o
// $ gdb test-piggy // $ gdb test-piggy
// (gdb) run >dumped // (gdb) run >dumped
// (gdb) /* Execute [single step, etc.; the decompressor+unfilter moves!] // (gdb) /* Execute [single step, etc.; the decompressor+unfilter moves!]
@ -1000,7 +1000,6 @@ bool PackVmlinuxAMD64::has_valid_vmlinux_head()
// pushl $0x100000 # 1MB address // pushl $0x100000 # 1MB address
// call mmap // call mmap
// leal -0x9000(%esp),%esi # expect "lea 0x9000(%esi),%esp" later // leal -0x9000(%esp),%esi # expect "lea 0x9000(%esi),%esp" later
// push %cs
///* Fall into .text of upx-compressed vmlinux. */ ///* Fall into .text of upx-compressed vmlinux. */
//----- //-----

View File

@ -1,5 +1,5 @@
/* amd64-linux.kernel.vmlinux-head.h /* amd64-linux.kernel.vmlinux-head.h
created from amd64-linux.kernel.vmlinux-head.bin, 33 (0x21) bytes created from amd64-linux.kernel.vmlinux-head.bin, 37 (0x25) bytes
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
@ -28,12 +28,12 @@
*/ */
#define STUB_AMD64_LINUX_KERNEL_VMLINUX_HEAD_SIZE 33 #define STUB_AMD64_LINUX_KERNEL_VMLINUX_HEAD_SIZE 37
#define STUB_AMD64_LINUX_KERNEL_VMLINUX_HEAD_ADLER32 0x206f1291 #define STUB_AMD64_LINUX_KERNEL_VMLINUX_HEAD_ADLER32 0x81fb1575
#define STUB_AMD64_LINUX_KERNEL_VMLINUX_HEAD_CRC32 0x5b6874bd #define STUB_AMD64_LINUX_KERNEL_VMLINUX_HEAD_CRC32 0xf78f5286
unsigned char stub_amd64_linux_kernel_vmlinux_head[33] = { unsigned char stub_amd64_linux_kernel_vmlinux_head[37] = {
140,200,131,192, 8,142,216,142,192,141,142, 0,144, 0, 0,137, /* 0x 0 */ 140,200,131,192, 8,142,216,142,192,142,224,142,232,141,142, 0, /* 0x 0 */
73,248,137, 65,252, 15,178, 97,248,106, 0,157,232,252,255,255, /* 0x 10 */ 144, 0, 0,137, 73,248,137, 65,252, 15,178, 97,248,106, 0,157, /* 0x 10 */
255 /* 0x 20 */ 232,252,255,255,255 /* 0x 20 */
}; };

View File

@ -1,5 +1,5 @@
/* i386-linux.kernel.vmlinux-head.h /* i386-linux.kernel.vmlinux-head.h
created from i386-linux.kernel.vmlinux-head.bin, 33 (0x21) bytes created from i386-linux.kernel.vmlinux-head.bin, 37 (0x25) bytes
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
@ -28,12 +28,12 @@
*/ */
#define STUB_I386_LINUX_KERNEL_VMLINUX_HEAD_SIZE 33 #define STUB_I386_LINUX_KERNEL_VMLINUX_HEAD_SIZE 37
#define STUB_I386_LINUX_KERNEL_VMLINUX_HEAD_ADLER32 0x206f1291 #define STUB_I386_LINUX_KERNEL_VMLINUX_HEAD_ADLER32 0x81fb1575
#define STUB_I386_LINUX_KERNEL_VMLINUX_HEAD_CRC32 0x5b6874bd #define STUB_I386_LINUX_KERNEL_VMLINUX_HEAD_CRC32 0xf78f5286
unsigned char stub_i386_linux_kernel_vmlinux_head[33] = { unsigned char stub_i386_linux_kernel_vmlinux_head[37] = {
140,200,131,192, 8,142,216,142,192,141,142, 0,144, 0, 0,137, /* 0x 0 */ 140,200,131,192, 8,142,216,142,192,142,224,142,232,141,142, 0, /* 0x 0 */
73,248,137, 65,252, 15,178, 97,248,106, 0,157,232,252,255,255, /* 0x 10 */ 144, 0, 0,137, 73,248,137, 65,252, 15,178, 97,248,106, 0,157, /* 0x 10 */
255 /* 0x 20 */ 232,252,255,255,255 /* 0x 20 */
}; };

View File

@ -36,6 +36,8 @@
movl %cs,%eax; addl $1<<3,%eax # the next segment after %cs movl %cs,%eax; addl $1<<3,%eax # the next segment after %cs
movl %eax,%ds movl %eax,%ds
movl %eax,%es movl %eax,%es
movl %eax,%fs
movl %eax,%gs
leal 0x9000(%esi),%ecx # 0x99000 typical leal 0x9000(%esi),%ecx # 0x99000 typical
movl %ecx,-8(%ecx) # 32-bit offset for stack pointer movl %ecx,-8(%ecx) # 32-bit offset for stack pointer
movl %eax,-4(%ecx) # segment for stack pointer movl %eax,-4(%ecx) # segment for stack pointer