mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Avoid "ASCII armor" area below 16MB (0x01000000) for exec-shield and
pre-linked PT_INTERP such as ld-linux.so.2 l_lx_elf86.asm l_lx_elf86.lds l_lx_sh86.asm l_lx_sh86.lds committer: jreiser <jreiser> 1084925700 +0000
This commit is contained in:
parent
aee150474c
commit
9769599f1d
|
@ -141,7 +141,7 @@ unfold:
|
|||
lodsd
|
||||
push eax ; sz_uncompressed (junk, actually)
|
||||
push esp ; &sz_uncompressed
|
||||
mov eax, 0x400000
|
||||
mov eax, 0x1000000
|
||||
push eax ; &destination
|
||||
|
||||
; mmap a page to hold the decompressed program
|
||||
|
@ -158,7 +158,7 @@ unfold:
|
|||
pop eax
|
||||
int 0x80
|
||||
xchg eax, ebx
|
||||
mov bh, PAGE_SIZE>>8 ; ebx= 0x401000
|
||||
mov bh, PAGE_SIZE>>8 ; ebx= 0x1001000
|
||||
add esp, byte 6*4 ; discard args to mmap
|
||||
|
||||
lodsd
|
||||
|
|
|
@ -38,8 +38,8 @@ PHDRS
|
|||
}
|
||||
SECTIONS
|
||||
{
|
||||
/* 0x00401000: l_lx_elf86.asm assumes 1 page up from 64KB boundary */
|
||||
. = 0x00401000 + SIZEOF_HEADERS + 12; /* 12==sizeof(l_info) */
|
||||
/* 0x01001000: l_lx_elf86.asm assumes 1 page up from 64KB boundary */
|
||||
. = 0x01001000 + SIZEOF_HEADERS + 12; /* 12==sizeof(l_info) */
|
||||
.text : {
|
||||
*(.text)
|
||||
*(.data)
|
||||
|
|
|
@ -136,7 +136,7 @@ unfold:
|
|||
lodsd
|
||||
push eax ; sz_uncompressed of folded stub (junk, actually)
|
||||
push esp ; &sz_uncompressed
|
||||
mov edx, 0x00800000 ; origin of this program
|
||||
mov edx, 0x01400000 ; origin of this program
|
||||
mov eax, [p_memsz + szElf32_Ehdr + edx] ; length of loaded pages
|
||||
add eax, edx
|
||||
add edx, szElf32_Ehdr + 2*szElf32_Phdr ; convenient ptr
|
||||
|
|
|
@ -38,8 +38,8 @@ PHDRS /* force exactly 1 ELF32_Phdr: in particular, no PT_GNU_STACK */
|
|||
|
||||
SECTIONS
|
||||
{
|
||||
/* 0x00800000: avoid 0x00400000 for shell itself being compressed */
|
||||
. = 0x00800000 + SIZEOF_HEADERS;
|
||||
/* 0x01400000: avoid 0x01000000 for shell itself being compressed */
|
||||
. = 0x01400000 + SIZEOF_HEADERS;
|
||||
. = ALIGN(0x80);
|
||||
.data : { /* put everything together in one Phdr */
|
||||
*(.text)
|
||||
|
|
Loading…
Reference in New Issue
Block a user