From 7f5635ea8c439ab8f7ab208219eb0d66aaa09e02 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Wed, 16 Aug 2006 19:49:09 -0700 Subject: [PATCH] Section LZMA_ELF00 saves time (but no space) by not clearing CProb[]. --- src/stub/i386-bsd.elf-entry.h | 6 +++--- src/stub/i386-dos32.djgpp2.h | 8 ++++---- src/stub/i386-dos32.tmt.h | 8 ++++---- src/stub/i386-dos32.watcom.le.h | 8 ++++---- src/stub/i386-linux.elf-entry.h | 6 +++--- src/stub/i386-linux.elf.execve-entry.h | 8 ++++---- src/stub/i386-linux.elf.interp-entry.h | 6 +++--- src/stub/i386-linux.elf.shell-entry.h | 8 ++++---- src/stub/i386-linux.kernel.vmlinux.h | 8 ++++---- src/stub/i386-linux.kernel.vmlinuz.h | 8 ++++---- src/stub/i386-win32.pe.h | 8 ++++---- src/stub/src/arch/i386/lzma_d.S | 24 +++++++++++++++--------- 12 files changed, 56 insertions(+), 50 deletions(-) diff --git a/src/stub/i386-bsd.elf-entry.h b/src/stub/i386-bsd.elf-entry.h index fcfbbb34..c6a5ea37 100644 --- a/src/stub/i386-bsd.elf-entry.h +++ b/src/stub/i386-bsd.elf-entry.h @@ -28,8 +28,8 @@ #define BSD_I386ELF_LOADER_SIZE 52787 -#define BSD_I386ELF_LOADER_ADLER32 0x06e53ed8 -#define BSD_I386ELF_LOADER_CRC32 0x56e2626b +#define BSD_I386ELF_LOADER_ADLER32 0xc1f73e3b +#define BSD_I386ELF_LOADER_CRC32 0xa33300de unsigned char bsd_i386elf_loader[52787] = { 127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */ @@ -89,7 +89,7 @@ unsigned char bsd_i386elf_loader[52787] = { 0, 0, 0, 0, 87,131,195, 4, 83,104, 0, 0, 0, 0, 86,131, /* 0x 360 */ 195, 4, 83, 80,199, 3, 0, 0, 0, 0,137,229,139, 85, 44,172, /* 0x 370 */ 74,136,193, 36, 7,192,233, 3,187, 0,253,255,255,211,227,141, /* 0x 380 */ -156, 92,136,241,255,255,131,227,224,106, 0, 57,220,117,250, 83, /* 0x 390 */ +164, 92,144,241,255,255,131,228,224,106, 0,106, 0,137,227, 83, /* 0x 390 */ 131,195, 4,139, 77, 52,255, 49, 87, 83,131,195, 4,136, 67, 2, /* 0x 3a0 */ 172, 74,136,193, 36, 15,136, 3,192,233, 4,136, 75, 1, 82, 86, /* 0x 3b0 */ 83, 80, 85, 87, 86, 83,131,236,124,139,148, 36,144, 0, 0, 0, /* 0x 3c0 */ diff --git a/src/stub/i386-dos32.djgpp2.h b/src/stub/i386-dos32.djgpp2.h index 70808f85..14726a45 100644 --- a/src/stub/i386-dos32.djgpp2.h +++ b/src/stub/i386-dos32.djgpp2.h @@ -28,8 +28,8 @@ #define NRV_LOADER_SIZE 33539 -#define NRV_LOADER_ADLER32 0x00029449 -#define NRV_LOADER_CRC32 0x95a2db45 +#define NRV_LOADER_ADLER32 0xe22f93ac +#define NRV_LOADER_CRC32 0xef0ce0ba unsigned char nrv_loader[33539] = { 127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */ @@ -89,8 +89,8 @@ unsigned char nrv_loader[33539] = { 0, 0, 49,192, 80, 57,220,117,251, 70, 70, 83,104, 0, 0, 0, /* 0x 360 */ 0, 87,131,195, 4, 83,104, 0, 0, 0, 0, 86,131,195, 4, 83, /* 0x 370 */ 80,199, 3, 0, 0, 0, 0,137,229,139, 85, 0,172, 74,136,193, /* 0x 380 */ - 36, 7,192,233, 3,187, 0,253,255,255,211,227,141,156, 92,136, /* 0x 390 */ -241,255,255,131,227,224,106, 0, 57,220,117,250, 83,131,195, 4, /* 0x 3a0 */ + 36, 7,192,233, 3,187, 0,253,255,255,211,227,141,164, 92,144, /* 0x 390 */ +241,255,255,131,228,224,106, 0,106, 0,137,227, 83,131,195, 4, /* 0x 3a0 */ 139, 77, 0,255, 49, 87, 83,131,195, 4,136, 67, 2,172, 74,136, /* 0x 3b0 */ 193, 36, 15,136, 3,192,233, 4,136, 75, 1, 82, 86, 83, 80, 85, /* 0x 3c0 */ 87, 86, 83,131,236,124,139,148, 36,144, 0, 0, 0,199, 68, 36, /* 0x 3d0 */ diff --git a/src/stub/i386-dos32.tmt.h b/src/stub/i386-dos32.tmt.h index 74ca461a..76940c82 100644 --- a/src/stub/i386-dos32.tmt.h +++ b/src/stub/i386-dos32.tmt.h @@ -28,8 +28,8 @@ #define NRV_LOADER_SIZE 34548 -#define NRV_LOADER_ADLER32 0x0dd13755 -#define NRV_LOADER_CRC32 0x52bf9345 +#define NRV_LOADER_ADLER32 0x9e3836b8 +#define NRV_LOADER_CRC32 0x21c51d7f unsigned char nrv_loader[34548] = { 127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */ @@ -92,8 +92,8 @@ unsigned char nrv_loader[34548] = { 117,251, 70, 70, 83,104, 0, 0, 0, 0, 87,131,195, 4, 83,104, /* 0x 390 */ 0, 0, 0, 0, 86,131,195, 4, 83, 80,199, 3, 0, 0, 0, 0, /* 0x 3a0 */ 137,229,139, 85, 0,172, 74,136,193, 36, 7,192,233, 3,187, 0, /* 0x 3b0 */ -253,255,255,211,227,141,156, 92,136,241,255,255,131,227,224,106, /* 0x 3c0 */ - 0, 57,220,117,250, 83,131,195, 4,139, 77, 0,255, 49, 87, 83, /* 0x 3d0 */ +253,255,255,211,227,141,164, 92,144,241,255,255,131,228,224,106, /* 0x 3c0 */ + 0,106, 0,137,227, 83,131,195, 4,139, 77, 0,255, 49, 87, 83, /* 0x 3d0 */ 131,195, 4,136, 67, 2,172, 74,136,193, 36, 15,136, 3,192,233, /* 0x 3e0 */ 4,136, 75, 1, 82, 86, 83, 80, 85, 87, 86, 83,131,236,124,139, /* 0x 3f0 */ 148, 36,144, 0, 0, 0,199, 68, 36,116, 0, 0, 0, 0,198, 68, /* 0x 400 */ diff --git a/src/stub/i386-dos32.watcom.le.h b/src/stub/i386-dos32.watcom.le.h index 3ffdef7f..f2696da8 100644 --- a/src/stub/i386-dos32.watcom.le.h +++ b/src/stub/i386-dos32.watcom.le.h @@ -28,8 +28,8 @@ #define NRV_LOADER_SIZE 35306 -#define NRV_LOADER_ADLER32 0x05a7dcb0 -#define NRV_LOADER_CRC32 0xaa11fd60 +#define NRV_LOADER_ADLER32 0xca97dc13 +#define NRV_LOADER_CRC32 0x3d938c4c unsigned char nrv_loader[35306] = { 127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */ @@ -92,8 +92,8 @@ unsigned char nrv_loader[35306] = { 0, 0, 0, 0, 49,192, 80, 57,220,117,251, 70, 70, 83,104, 0, /* 0x 390 */ 0, 0, 0, 87,131,195, 4, 83,104, 0, 0, 0, 0, 86,131,195, /* 0x 3a0 */ 4, 83, 80,199, 3, 0, 0, 0, 0,137,229,139, 85, 0,172, 74, /* 0x 3b0 */ -136,193, 36, 7,192,233, 3,187, 0,253,255,255,211,227,141,156, /* 0x 3c0 */ - 92,136,241,255,255,131,227,224,106, 0, 57,220,117,250, 83,131, /* 0x 3d0 */ +136,193, 36, 7,192,233, 3,187, 0,253,255,255,211,227,141,164, /* 0x 3c0 */ + 92,144,241,255,255,131,228,224,106, 0,106, 0,137,227, 83,131, /* 0x 3d0 */ 195, 4,139, 77, 0,255, 49, 87, 83,131,195, 4,136, 67, 2,172, /* 0x 3e0 */ 74,136,193, 36, 15,136, 3,192,233, 4,136, 75, 1, 82, 86, 83, /* 0x 3f0 */ 80, 85, 87, 86, 83,131,236,124,139,148, 36,144, 0, 0, 0,199, /* 0x 400 */ diff --git a/src/stub/i386-linux.elf-entry.h b/src/stub/i386-linux.elf-entry.h index 4733b17f..f21933ee 100644 --- a/src/stub/i386-linux.elf-entry.h +++ b/src/stub/i386-linux.elf-entry.h @@ -28,8 +28,8 @@ #define LINUX_I386ELF_LOADER_SIZE 52781 -#define LINUX_I386ELF_LOADER_ADLER32 0x13983ee3 -#define LINUX_I386ELF_LOADER_CRC32 0x0de2810c +#define LINUX_I386ELF_LOADER_ADLER32 0xd2583e46 +#define LINUX_I386ELF_LOADER_CRC32 0x297d1e70 unsigned char linux_i386elf_loader[52781] = { 127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */ @@ -89,7 +89,7 @@ unsigned char linux_i386elf_loader[52781] = { 0, 0, 0, 0, 87,131,195, 4, 83,104, 0, 0, 0, 0, 86,131, /* 0x 360 */ 195, 4, 83, 80,199, 3, 0, 0, 0, 0,137,229,139, 85, 44,172, /* 0x 370 */ 74,136,193, 36, 7,192,233, 3,187, 0,253,255,255,211,227,141, /* 0x 380 */ -156, 92,136,241,255,255,131,227,224,106, 0, 57,220,117,250, 83, /* 0x 390 */ +164, 92,144,241,255,255,131,228,224,106, 0,106, 0,137,227, 83, /* 0x 390 */ 131,195, 4,139, 77, 52,255, 49, 87, 83,131,195, 4,136, 67, 2, /* 0x 3a0 */ 172, 74,136,193, 36, 15,136, 3,192,233, 4,136, 75, 1, 82, 86, /* 0x 3b0 */ 83, 80, 85, 87, 86, 83,131,236,124,139,148, 36,144, 0, 0, 0, /* 0x 3c0 */ diff --git a/src/stub/i386-linux.elf.execve-entry.h b/src/stub/i386-linux.elf.execve-entry.h index 285f4e76..3ab4c343 100644 --- a/src/stub/i386-linux.elf.execve-entry.h +++ b/src/stub/i386-linux.elf.execve-entry.h @@ -28,8 +28,8 @@ #define LINUX_I386EXEC_LOADER_SIZE 53451 -#define LINUX_I386EXEC_LOADER_ADLER32 0xb7e5a220 -#define LINUX_I386EXEC_LOADER_CRC32 0x603584d0 +#define LINUX_I386EXEC_LOADER_ADLER32 0xe098a183 +#define LINUX_I386EXEC_LOADER_CRC32 0x4f3aabaa unsigned char linux_i386exec_loader[53451] = { 127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */ @@ -89,8 +89,8 @@ unsigned char linux_i386exec_loader[53451] = { 57,220,117,251, 70, 70, 83,104, 0, 0, 0, 0, 87,131,195, 4, /* 0x 360 */ 83,104, 0, 0, 0, 0, 86,131,195, 4, 83, 80,199, 3, 0, 0, /* 0x 370 */ 0, 0,137,229,139, 85, 44,172, 74,136,193, 36, 7,192,233, 3, /* 0x 380 */ -187, 0,253,255,255,211,227,141,156, 92,136,241,255,255,131,227, /* 0x 390 */ -224,106, 0, 57,220,117,250, 83,131,195, 4,139, 77, 52,255, 49, /* 0x 3a0 */ +187, 0,253,255,255,211,227,141,164, 92,144,241,255,255,131,228, /* 0x 390 */ +224,106, 0,106, 0,137,227, 83,131,195, 4,139, 77, 52,255, 49, /* 0x 3a0 */ 87, 83,131,195, 4,136, 67, 2,172, 74,136,193, 36, 15,136, 3, /* 0x 3b0 */ 192,233, 4,136, 75, 1, 82, 86, 83, 80, 85, 87, 86, 83,131,236, /* 0x 3c0 */ 124,139,148, 36,144, 0, 0, 0,199, 68, 36,116, 0, 0, 0, 0, /* 0x 3d0 */ diff --git a/src/stub/i386-linux.elf.interp-entry.h b/src/stub/i386-linux.elf.interp-entry.h index ef94365f..264cd4ae 100644 --- a/src/stub/i386-linux.elf.interp-entry.h +++ b/src/stub/i386-linux.elf.interp-entry.h @@ -28,8 +28,8 @@ #define LINUX_I386PTI_LOADER_SIZE 64197 -#define LINUX_I386PTI_LOADER_ADLER32 0xca0193e3 -#define LINUX_I386PTI_LOADER_CRC32 0xa5f0300f +#define LINUX_I386PTI_LOADER_ADLER32 0xe8739346 +#define LINUX_I386PTI_LOADER_CRC32 0x86df3410 unsigned char linux_i386pti_loader[64197] = { 127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */ @@ -108,7 +108,7 @@ unsigned char linux_i386pti_loader[64197] = { 0, 0, 0, 0, 87,131,195, 4, 83,104, 0, 0, 0, 0, 86,131, /* 0x 490 */ 195, 4, 83, 80,199, 3, 0, 0, 0, 0,137,229,139, 85, 0,172, /* 0x 4a0 */ 74,136,193, 36, 7,192,233, 3,187, 0,253,255,255,211,227,141, /* 0x 4b0 */ -156, 92,136,241,255,255,131,227,224,106, 0, 57,220,117,250, 83, /* 0x 4c0 */ +164, 92,144,241,255,255,131,228,224,106, 0,106, 0,137,227, 83, /* 0x 4c0 */ 131,195, 4,139, 77, 0,255, 49, 87, 83,131,195, 4,136, 67, 2, /* 0x 4d0 */ 172, 74,136,193, 36, 15,136, 3,192,233, 4,136, 75, 1, 82, 86, /* 0x 4e0 */ 83, 80, 85, 87, 86, 83,131,236,124,139,148, 36,144, 0, 0, 0, /* 0x 4f0 */ diff --git a/src/stub/i386-linux.elf.shell-entry.h b/src/stub/i386-linux.elf.shell-entry.h index df648f40..1296f794 100644 --- a/src/stub/i386-linux.elf.shell-entry.h +++ b/src/stub/i386-linux.elf.shell-entry.h @@ -28,8 +28,8 @@ #define LINUX_I386SH_LOADER_SIZE 41496 -#define LINUX_I386SH_LOADER_ADLER32 0x306aca0d -#define LINUX_I386SH_LOADER_CRC32 0x5e7a69bf +#define LINUX_I386SH_LOADER_ADLER32 0xa73ec970 +#define LINUX_I386SH_LOADER_CRC32 0xbd75a158 unsigned char linux_i386sh_loader[41496] = { 127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */ @@ -106,8 +106,8 @@ unsigned char linux_i386sh_loader[41496] = { 49,192, 80, 57,220,117,251, 70, 70, 83,104, 0, 0, 0, 0, 87, /* 0x 470 */ 131,195, 4, 83,104, 0, 0, 0, 0, 86,131,195, 4, 83, 80,199, /* 0x 480 */ 3, 0, 0, 0, 0,137,229,139, 85, 0,172, 74,136,193, 36, 7, /* 0x 490 */ -192,233, 3,187, 0,253,255,255,211,227,141,156, 92,136,241,255, /* 0x 4a0 */ -255,131,227,224,106, 0, 57,220,117,250, 83,131,195, 4,139, 77, /* 0x 4b0 */ +192,233, 3,187, 0,253,255,255,211,227,141,164, 92,144,241,255, /* 0x 4a0 */ +255,131,228,224,106, 0,106, 0,137,227, 83,131,195, 4,139, 77, /* 0x 4b0 */ 0,255, 49, 87, 83,131,195, 4,136, 67, 2,172, 74,136,193, 36, /* 0x 4c0 */ 15,136, 3,192,233, 4,136, 75, 1, 82, 86, 83, 80, 85, 87, 86, /* 0x 4d0 */ 83,131,236,124,139,148, 36,144, 0, 0, 0,199, 68, 36,116, 0, /* 0x 4e0 */ diff --git a/src/stub/i386-linux.kernel.vmlinux.h b/src/stub/i386-linux.kernel.vmlinux.h index 14accaf0..bb280c02 100644 --- a/src/stub/i386-linux.kernel.vmlinux.h +++ b/src/stub/i386-linux.kernel.vmlinux.h @@ -28,8 +28,8 @@ #define NRV_LOADER_SIZE 34462 -#define NRV_LOADER_ADLER32 0x5d8f25ff -#define NRV_LOADER_CRC32 0x9b5223f9 +#define NRV_LOADER_ADLER32 0x01082562 +#define NRV_LOADER_CRC32 0x56c03e89 unsigned char nrv_loader[34462] = { 127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */ @@ -88,8 +88,8 @@ unsigned char nrv_loader[34462] = { 0, 0, 0, 0, 49,192, 80, 57,220,117,251, 70, 70, 83,104, 0, /* 0x 350 */ 0, 0, 0, 87,131,195, 4, 83,104, 0, 0, 0, 0, 86,131,195, /* 0x 360 */ 4, 83, 80,199, 3, 0, 0, 0, 0,137,229,139, 85, 0,172, 74, /* 0x 370 */ -136,193, 36, 7,192,233, 3,187, 0,253,255,255,211,227,141,156, /* 0x 380 */ - 92,136,241,255,255,131,227,224,106, 0, 57,220,117,250, 83,131, /* 0x 390 */ +136,193, 36, 7,192,233, 3,187, 0,253,255,255,211,227,141,164, /* 0x 380 */ + 92,144,241,255,255,131,228,224,106, 0,106, 0,137,227, 83,131, /* 0x 390 */ 195, 4,139, 77, 0,255, 49, 87, 83,131,195, 4,136, 67, 2,172, /* 0x 3a0 */ 74,136,193, 36, 15,136, 3,192,233, 4,136, 75, 1, 82, 86, 83, /* 0x 3b0 */ 80, 85, 87, 86, 83,131,236,124,139,148, 36,144, 0, 0, 0,199, /* 0x 3c0 */ diff --git a/src/stub/i386-linux.kernel.vmlinuz.h b/src/stub/i386-linux.kernel.vmlinuz.h index 94ee5705..cd90abae 100644 --- a/src/stub/i386-linux.kernel.vmlinuz.h +++ b/src/stub/i386-linux.kernel.vmlinuz.h @@ -28,8 +28,8 @@ #define NRV_LOADER_SIZE 35989 -#define NRV_LOADER_ADLER32 0xe931624c -#define NRV_LOADER_CRC32 0xa0b23316 +#define NRV_LOADER_ADLER32 0x129e61af +#define NRV_LOADER_CRC32 0x4dbf260d unsigned char nrv_loader[35989] = { 127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */ @@ -93,8 +93,8 @@ unsigned char nrv_loader[35989] = { 49,192, 80, 57,220,117,251, 70, 70, 83,104, 0, 0, 0, 0, 87, /* 0x 3a0 */ 131,195, 4, 83,104, 0, 0, 0, 0, 86,131,195, 4, 83, 80,199, /* 0x 3b0 */ 3, 0, 0, 0, 0,137,229,139, 85, 0,172, 74,136,193, 36, 7, /* 0x 3c0 */ -192,233, 3,187, 0,253,255,255,211,227,141,156, 92,136,241,255, /* 0x 3d0 */ -255,131,227,224,106, 0, 57,220,117,250, 83,131,195, 4,139, 77, /* 0x 3e0 */ +192,233, 3,187, 0,253,255,255,211,227,141,164, 92,144,241,255, /* 0x 3d0 */ +255,131,228,224,106, 0,106, 0,137,227, 83,131,195, 4,139, 77, /* 0x 3e0 */ 0,255, 49, 87, 83,131,195, 4,136, 67, 2,172, 74,136,193, 36, /* 0x 3f0 */ 15,136, 3,192,233, 4,136, 75, 1, 82, 86, 83, 80, 85, 87, 86, /* 0x 400 */ 83,131,236,124,139,148, 36,144, 0, 0, 0,199, 68, 36,116, 0, /* 0x 410 */ diff --git a/src/stub/i386-win32.pe.h b/src/stub/i386-win32.pe.h index 3e840ee0..fd3c0064 100644 --- a/src/stub/i386-win32.pe.h +++ b/src/stub/i386-win32.pe.h @@ -28,8 +28,8 @@ #define NRV_LOADER_SIZE 42497 -#define NRV_LOADER_ADLER32 0xf991fddb -#define NRV_LOADER_CRC32 0x97174a6b +#define NRV_LOADER_ADLER32 0x6b8bfd3e +#define NRV_LOADER_CRC32 0x205e8d53 unsigned char nrv_loader[42497] = { 127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */ @@ -90,8 +90,8 @@ unsigned char nrv_loader[42497] = { 57,220,117,251, 70, 70, 83,104, 0, 0, 0, 0, 87,131,195, 4, /* 0x 370 */ 83,104, 0, 0, 0, 0, 86,131,195, 4, 83, 80,199, 3, 0, 0, /* 0x 380 */ 0, 0,137,229,139, 85, 0,172, 74,136,193, 36, 7,192,233, 3, /* 0x 390 */ -187, 0,253,255,255,211,227,141,156, 92,136,241,255,255,131,227, /* 0x 3a0 */ -224,106, 0, 57,220,117,250, 83,131,195, 4,139, 77, 0,255, 49, /* 0x 3b0 */ +187, 0,253,255,255,211,227,141,164, 92,144,241,255,255,131,228, /* 0x 3a0 */ +224,106, 0,106, 0,137,227, 83,131,195, 4,139, 77, 0,255, 49, /* 0x 3b0 */ 87, 83,131,195, 4,136, 67, 2,172, 74,136,193, 36, 15,136, 3, /* 0x 3c0 */ 192,233, 4,136, 75, 1, 82, 86, 83, 80, 85, 87, 86, 83,131,236, /* 0x 3d0 */ 124,139,148, 36,144, 0, 0, 0,199, 68, 36,116, 0, 0, 0, 0, /* 0x 3e0 */ diff --git a/src/stub/src/arch/i386/lzma_d.S b/src/stub/src/arch/i386/lzma_d.S index 5e34fb3f..99d40868 100644 --- a/src/stub/src/arch/i386/lzma_d.S +++ b/src/stub/src/arch/i386/lzma_d.S @@ -76,6 +76,7 @@ section LZMA_DEC00 section LZMA_ELF00 +// Preceded by LEXEC010 which tunes for NRV, including "pusha; push $cto" #define LZMA_BASE_SIZE 1846 #define LZMA_LIT_SIZE 768 @@ -96,13 +97,14 @@ section LZMA_ELF00 mov ebx, -LZMA_LIT_SIZE shl ebx,cl -// inSizeProcessed, outSizeProcessed, *_bits, CLzmaDecoderState - lea ebx,[0 -(2*4 +4) - 2*LZMA_BASE_SIZE + 2*ebx + esp] - and ebx, (~0<<5) // 32-byte align -.elf_clearstack1: - push 0 - cmp esp,ebx - jne .elf_clearstack1 + + // CLzmaDecoderState:{*_bits, CProb[LZMA_BASE_SIZE + (LZMA_LIT_SIZE<<%cl)]} + lea esp,[0 -4 - 2*LZMA_BASE_SIZE + 2*ebx + esp] + and esp, (~0<<5) // 32-byte align + + push 0 // inSizeProcessed + push 0 // outSizeProcessed + mov ebx,esp push ebx // &outSizeProcessed add ebx, 4 @@ -139,10 +141,14 @@ section LZMA_DEC20 // cleanup section LZMA_DEC30 +// These are needed only because followed by LEXEC015. LzmaDecode() has set +// *O_OUTS, and returned %eax=0 for success, %eax=1 for failure. Therefore +// "neg eax" would be enough (followed by clearing %ecx to agree with NRV.) add esi, [ebx - 4] // inSizeProcessed add edi, [ebx - 8] // outSizeProcessed - xor eax, eax +// Partially clear exposed stack (only because of paranoia.) + xor eax, eax lea ecx, [esp - 256] mov esp, ebp // restore stack .clearstack2: @@ -151,7 +157,7 @@ section LZMA_DEC30 jnz .clearstack2 mov esp, ebp // restore stack - xor ecx, ecx + xor ecx, ecx // NRV protocol // vi:ts=8:et