From 03f1f615e53cc1740f51b0178e6708443a4cb029 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Thu, 17 Jul 2003 01:46:48 +0000 Subject: [PATCH] filter 0x49 for [b]vmlinuz; 2nd parameter for ckt32 (addvalue) p_vmlinz.cpp stub/macros.ash stub/l_lx_elf86.asm stub/l_lx_exec86.asm stub/l_vmlinz.asm committer: jreiser 1058406408 +0000 --- src/p_vmlinz.cpp | 2 +- src/stub/l_lx_elf86.asm | 2 +- src/stub/l_lx_exec86.asm | 2 +- src/stub/l_vmlinz.asm | 2 +- src/stub/macros.ash | 26 ++++++++++++++++++-------- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/p_vmlinz.cpp b/src/p_vmlinz.cpp index 937b4e61..2d8b1af7 100644 --- a/src/p_vmlinz.cpp +++ b/src/p_vmlinz.cpp @@ -65,7 +65,7 @@ const int *PackVmlinuzI386::getCompressionMethods(int method, int level) const const int *PackVmlinuzI386::getFilters() const { static const int filters[] = { - /*0x49,*/ /* 2003-07-16 bug in unfilter? */ + 0x49, 0x26, 0x24, 0x11, 0x14, 0x13, 0x16, 0x25, 0x15, 0x12, -1 }; return filters; diff --git a/src/stub/l_lx_elf86.asm b/src/stub/l_lx_elf86.asm index 499308c9..08979e03 100644 --- a/src/stub/l_lx_elf86.asm +++ b/src/stub/l_lx_elf86.asm @@ -116,7 +116,7 @@ decompress: ret ctojr32 - ckt32 dl + ckt32 edi, dl ;__LEXEC017__ popa ret diff --git a/src/stub/l_lx_exec86.asm b/src/stub/l_lx_exec86.asm index 2e446a5a..814c6b46 100644 --- a/src/stub/l_lx_exec86.asm +++ b/src/stub/l_lx_exec86.asm @@ -135,7 +135,7 @@ decompress: ;; jmpn lxunf0 ; logically belongs here ctojr32 - ckt32 dl + ckt32 edi, dl ;__LEXEC017__ popa ret diff --git a/src/stub/l_vmlinz.asm b/src/stub/l_vmlinz.asm index 7779a23d..309812fe 100644 --- a/src/stub/l_vmlinz.asm +++ b/src/stub/l_vmlinz.asm @@ -120,7 +120,7 @@ checka20: pop ecx ; MATCH05 len pop edx ; MATCH04 cto pop edi ; MATCH03 src - ckt32 dl + ckt32 0, dl %endif; __LZDUMMY2__ %ifdef __LZCALLT9__ pop edi ; MATCH03 src diff --git a/src/stub/macros.ash b/src/stub/macros.ash index 7bb06799..afd9a768 100644 --- a/src/stub/macros.ash +++ b/src/stub/macros.ash @@ -171,13 +171,18 @@ ctend: ;; call/jump/jcc trick; also used more than once (and/or optionally), so ;; ecx has byte count (not count of applied instances), and ;; edi points to buffer. -%macro ckt32 1 ; param: where is cto8 (dl, bl, or literal) +%macro ckt32 2 +; 1st param: effective addvalue (typically 0 or edi; any rvalue) +; 2nd param: where is cto8 (dl, bl, or literal) + ;__CKLLTR00__ - mov esi, edi ; base of block + %ifnidn %1,0 + mov esi, %1 + %endif jmps ckstart ckloop3: mov al, [edi] - inc edi + add edi, byte 1 ;__CKLLTR10__ Jcc only cmp al, 0x80 ; lo of 6-byte Jcc jb ckloop2 @@ -191,27 +196,32 @@ ckloop2: cmp al, 0xE9 - 0xE8 ja ckcount ckmark: - cmp byte [edi], %1 ; cto8 + cmp byte [edi], %2 ; cto8 jnz ckcount mov eax, [edi] shr ax, 8 rol eax, 16 xchg al, ah +; above 3 instr are equivalent to the following 2 instr: +; mov al, 0 ; clear cto8 [setup partial-write stall] +; bswap eax ; not on 386: need 486 and up sub eax, edi + %ifnidn %1,0 add eax, esi + %endif mov [edi], eax add edi, byte 4 ckstart: sub ecx, byte 4 ;__CKLLTR30__ Jcc only mov al, [edi] - inc edi + add edi, byte 1 loop ckloop2 ; prefix cannot overlap previous displacement ;__CKLLTR40__ ckcount: - dec ecx + sub ecx, byte 1 jg ckloop3 ckend: %endmacro @@ -497,7 +507,7 @@ lxunf1: ; allocate and clear mru[] ;__LXUNF030__ lxctloop: movzx eax, word [edi] ; 2 bytes, zero extended - inc edi + add edi, byte 1 ;__LXJCC000__ cmp al, 0x80 ; lo of Jcc jb lxct1 @@ -537,7 +547,7 @@ lxct3: ;__LXUNF034__ unfcount: - dec ecx + sub ecx, byte 1 jg lxctloop ;__LXMRU055__