save 3 bytes by not clearing [AT_NULL].a_un.a_ptr
committer: jreiser <jreiser> 1034698533 +0000
This commit is contained in:
@@ -117,11 +117,10 @@ EXTERN upx_main
|
|||||||
sub eax,eax ; 0, also AT_NULL
|
sub eax,eax ; 0, also AT_NULL
|
||||||
db 0x3c ; "cmpb al, byte ..." like "jmp 1+L60" but 1 byte shorter
|
db 0x3c ; "cmpb al, byte ..." like "jmp 1+L60" but 1 byte shorter
|
||||||
L60:
|
L60:
|
||||||
scasd ; a_un
|
scasd ; a_un.a_val etc.
|
||||||
scasd ; a_val
|
scasd ; a_type
|
||||||
jne L60 ; not AT_NULL
|
jne L60 ; not AT_NULL
|
||||||
mov edx,[edi] ; &hatch
|
; edi now points at [AT_NULL]a_un.a_ptr which contains result of make_hatch()
|
||||||
stosd ; clear a_un.a_ptr for AT_NULL
|
|
||||||
|
|
||||||
; _dl_start and company (ld-linux.so.2) once assumed that it had virgin stack,
|
; _dl_start and company (ld-linux.so.2) once assumed that it had virgin stack,
|
||||||
; and did not initialize all its stack local variables to zero.
|
; and did not initialize all its stack local variables to zero.
|
||||||
@@ -156,7 +155,7 @@ L60:
|
|||||||
mov ch, PAGE_SIZE>>8 ; 0x1000
|
mov ch, PAGE_SIZE>>8 ; 0x1000
|
||||||
add ecx, [p_memsz + szElf32_Ehdr + ebx] ; length to unmap
|
add ecx, [p_memsz + szElf32_Ehdr + ebx] ; length to unmap
|
||||||
mov bh, 0 ; from 0x401000 to 0x400000
|
mov bh, 0 ; from 0x401000 to 0x400000
|
||||||
jmp edx ; unmap ourselves via escape hatch, then goto entry
|
jmp [edi] ; unmap ourselves via escape hatch, then goto entry
|
||||||
|
|
||||||
; called twice:
|
; called twice:
|
||||||
; 1st with esi==edi, ecx=0, edx= bitmap of slots needed: just update edx.
|
; 1st with esi==edi, ecx=0, edx= bitmap of slots needed: just update edx.
|
||||||
|
|||||||
Reference in New Issue
Block a user