Reduce usage of patchDecompressor()
This commit is contained in:
+2121
-2121
File diff suppressed because it is too large
Load Diff
+2941
-2931
File diff suppressed because it is too large
Load Diff
+2941
-2931
File diff suppressed because it is too large
Load Diff
@@ -197,6 +197,83 @@ section CALLTR13
|
||||
ctend:
|
||||
.endm
|
||||
|
||||
// cit32 is same as cjt32 except esi captures 'addvalue' at the beginning
|
||||
.macro cit32 addvalue
|
||||
section CALLTR00
|
||||
mov ecx, offset filter_length
|
||||
.ifnc \addvalue, 0
|
||||
mov esi, \addvalue
|
||||
.endif
|
||||
calltrickloop:
|
||||
mov al, [edi]
|
||||
inc edi
|
||||
sub al, 0xE8
|
||||
ct1:
|
||||
cmp al, 1
|
||||
ja calltrickloop
|
||||
section CTCLEVE1
|
||||
cmpb [edi], offset filter_cto
|
||||
jnzs calltrickloop
|
||||
section CALLTR01
|
||||
mov eax, [edi]
|
||||
mov bl, [edi + 4]
|
||||
section CTBSHR01
|
||||
shr ax, 8
|
||||
section CTBROR01
|
||||
xchg ah, al
|
||||
section CTBSWA01
|
||||
rol eax, 16
|
||||
xchg ah, al
|
||||
section CALLTR02
|
||||
sub eax, edi
|
||||
sub bl, 0xE8
|
||||
|
||||
.ifnc \addvalue, 0
|
||||
add eax, esi
|
||||
.endif
|
||||
|
||||
mov [edi], eax
|
||||
add edi, 5
|
||||
mov al, bl
|
||||
loop ct1
|
||||
|
||||
section CALLTR10
|
||||
//;; 32-bit call XOR jump trick
|
||||
mov ecx, offset filter_length
|
||||
ctloop1:
|
||||
section CALLTRE8
|
||||
mov al,0xE8
|
||||
section CALLTRE9
|
||||
mov al,0xE9
|
||||
section CALLTR11
|
||||
ctloop2:
|
||||
repnz
|
||||
scasb
|
||||
jnzs ctend
|
||||
section CTCLEVE2
|
||||
cmpb [edi], offset filter_cto
|
||||
jnzs ctloop2
|
||||
section CALLTR12
|
||||
mov eax, [edi]
|
||||
section CTBSHR11
|
||||
shr ax, 8
|
||||
section CTBROR11
|
||||
xchg ah, al
|
||||
section CTBSWA11
|
||||
rol eax, 16
|
||||
xchg ah, al
|
||||
section CALLTR13
|
||||
sub eax, edi
|
||||
|
||||
.ifnc \addvalue, 0
|
||||
add eax, esi
|
||||
.endif
|
||||
|
||||
stosd
|
||||
jmps ctloop1
|
||||
ctend:
|
||||
.endm
|
||||
|
||||
/*
|
||||
;; call/jump/jcc trick; also used more than once (and/or optionally), so
|
||||
;; ecx has byte count (not count of applied instances), and
|
||||
@@ -227,7 +304,7 @@ section CKLLTR20
|
||||
cmp al, 0xE9 - 0xE8
|
||||
jas ckcount
|
||||
ckmark:
|
||||
cmp [edi], \cto8
|
||||
cmpb [edi], \cto8
|
||||
jnzs ckcount
|
||||
mov eax, [edi]
|
||||
|
||||
|
||||
@@ -85,7 +85,6 @@ section LEXEC009
|
||||
// empty section for commonality with l_lx_exec86.asm
|
||||
section LEXEC010
|
||||
pusha
|
||||
push '?' // cto8 (sign extension does not matter)
|
||||
// cld
|
||||
|
||||
mov esi, INP
|
||||
@@ -98,7 +97,6 @@ section LEXEC010
|
||||
#include "arch/i386/nrv2d_d32.S"
|
||||
#include "arch/i386/nrv2e_d32.S"
|
||||
#include "arch/i386/lzma_d.S"
|
||||
cjt32 0
|
||||
|
||||
section LEXEC015
|
||||
// eax is 0 from decompressor code
|
||||
@@ -117,14 +115,13 @@ section LEXEC015
|
||||
mov edx, OUTS
|
||||
mov [edx], edi
|
||||
|
||||
pop edx // cto8
|
||||
|
||||
mov [7*4 + esp], eax
|
||||
popa
|
||||
ret
|
||||
|
||||
ctojr32
|
||||
ckt32 edi, dl
|
||||
cit32 edi
|
||||
section LEXEC017
|
||||
popa
|
||||
ret
|
||||
|
||||
@@ -86,7 +86,7 @@ section LEXEC009
|
||||
mov eax, offset NMRU // free slot in following 'pusha'
|
||||
section LEXEC010
|
||||
pusha
|
||||
push '?' // cto8 (sign extension does not matter)
|
||||
.byte 0x6a, filter_cto // push byte
|
||||
// cld
|
||||
|
||||
mov esi, INP
|
||||
@@ -99,7 +99,6 @@ section LEXEC010
|
||||
#include "arch/i386/nrv2d_d32.S"
|
||||
#include "arch/i386/nrv2e_d32.S"
|
||||
#include "arch/i386/lzma_d.S"
|
||||
cjt32 0
|
||||
|
||||
section LEXEC015
|
||||
// eax is 0 from decompressor code
|
||||
@@ -137,6 +136,7 @@ section LEXEC016 // bug in APP: jmp and target must be in same .asx
|
||||
|
||||
ctojr32
|
||||
ckt32 edi, dl
|
||||
cit32 edi
|
||||
section LEXEC017
|
||||
popa
|
||||
ret
|
||||
|
||||
@@ -93,7 +93,7 @@ section LEXEC009
|
||||
mov eax, offset NMRU // free slot in following 'pusha'
|
||||
section LEXEC010
|
||||
pusha
|
||||
push '?' // cto8 (sign extension does not matter)
|
||||
.byte 0x6a, filter_cto // push byte
|
||||
// cld
|
||||
|
||||
mov esi, INP
|
||||
@@ -106,7 +106,6 @@ section LEXEC010
|
||||
#include "arch/i386/nrv2d_d32.S"
|
||||
#include "arch/i386/nrv2e_d32.S"
|
||||
#include "arch/i386/lzma_d.S"
|
||||
cjt32 0
|
||||
|
||||
section LEXEC015
|
||||
// eax is 0 from decompressor code
|
||||
@@ -144,6 +143,7 @@ section LEXEC016 // bug in APP: jmp and target must be in same .asx
|
||||
|
||||
ctojr32
|
||||
ckt32 edi, dl
|
||||
cit32 edi
|
||||
section LEXEC017
|
||||
popa
|
||||
ret
|
||||
|
||||
Reference in New Issue
Block a user