1
0
mirror of https://github.com/upx/upx synced 2025-10-05 19:20:23 +08:00

move stub escape hatch for shared library to end of .text [glibc-2.13.90]

This commit is contained in:
John Reiser 2011-06-02 07:18:50 -07:00
parent eea33f6019
commit 21924bf022
10 changed files with 2281 additions and 2265 deletions

View File

@ -189,6 +189,17 @@ PackLinuxElf::~PackLinuxElf()
delete[] file_image; file_image = NULL; delete[] file_image; file_image = NULL;
} }
// Swap the byte ranges fo[a to b] and fo[b to c].
static void swap_byte_ranges(OutputFile *fo, unsigned a, unsigned b, unsigned c)
{
MemBuffer buf(c - a);
fo->seek(a, SEEK_SET);
fo->readx(buf, c - a);
fo->seek(a, SEEK_SET);
fo->rewrite(&buf[b - a], c - b);
fo->rewrite(&buf[0], b - a);
}
void PackLinuxElf::pack3(OutputFile *fo, Filter &ft) void PackLinuxElf::pack3(OutputFile *fo, Filter &ft)
{ {
sz_pack2b = fpad4(fo); // after headers, all PT_LOAD, gaps sz_pack2b = fpad4(fo); // after headers, all PT_LOAD, gaps
@ -207,7 +218,7 @@ void PackLinuxElf::pack3(OutputFile *fo, Filter &ft)
fo->write(&disp, sizeof(disp)); fo->write(&disp, sizeof(disp));
len += sizeof(disp); len += sizeof(disp);
if (xct_off) { if (xct_off) { // is_shlib
set_te32(&disp, elf_unsigned_dynamic(Elf32_Dyn::DT_INIT) - load_va); set_te32(&disp, elf_unsigned_dynamic(Elf32_Dyn::DT_INIT) - load_va);
fo->write(&disp, sizeof(disp)); fo->write(&disp, sizeof(disp));
len += sizeof(disp); len += sizeof(disp);
@ -223,9 +234,15 @@ void PackLinuxElf::pack3(OutputFile *fo, Filter &ft)
sz_pack2 = len; // 0 mod 8 sz_pack2 = len; // 0 mod 8
super::pack3(fo, ft); // append the decompressor super::pack3(fo, ft); // append the decompressor
fpad4(fo);
set_te16(&linfo.l_lsize, up4( set_te16(&linfo.l_lsize, up4(
get_te16(&linfo.l_lsize) + len - sz_pack2a)); get_te16(&linfo.l_lsize) + len - sz_pack2a));
len = fpad4(fo);
// Put the loader in the middle, after the compressed PT_LOADs
// and before the compressed gaps (and debuginfo!)
// As first written, loader is fo[sz_pack2b to len],
// and gaps and debuginfo are fo[sz_pack2a to sz_pack2b].
swap_byte_ranges(fo, sz_pack2a, sz_pack2b, len);
} }
void PackLinuxElf32::pack3(OutputFile *fo, Filter &ft) void PackLinuxElf32::pack3(OutputFile *fo, Filter &ft)
@ -293,7 +310,7 @@ void PackLinuxElf32::pack3(OutputFile *fo, Filter &ft)
} }
if (off_init) { // change DT_INIT.d_val if (off_init) { // change DT_INIT.d_val
fo->seek(off_init, SEEK_SET); fo->seek(off_init, SEEK_SET);
va_init |= (Elf32_Ehdr::EM_ARM==e_machine); va_init |= (Elf32_Ehdr::EM_ARM==e_machine); // THUMB mode
unsigned word; set_te32(&word, va_init); unsigned word; set_te32(&word, va_init);
fo->rewrite(&word, sizeof(word)); fo->rewrite(&word, sizeof(word));
fo->seek(0, SEEK_END); fo->seek(0, SEEK_END);
@ -326,7 +343,7 @@ void PackLinuxElf64::pack3(OutputFile *fo, Filter &ft)
// Rotate to highest position, so it can be lopped // Rotate to highest position, so it can be lopped
// by decrementing e_phnum. // by decrementing e_phnum.
memcpy((unsigned char *)ibuf, phdr, sizeof(*phdr)); memcpy((unsigned char *)ibuf, phdr, sizeof(*phdr));
memcpy(phdr, 1+phdr, j * sizeof(*phdr)); memmove(phdr, 1+phdr, j * sizeof(*phdr)); // overlapping
memcpy(&phdr[j], (unsigned char *)ibuf, sizeof(*phdr)); memcpy(&phdr[j], (unsigned char *)ibuf, sizeof(*phdr));
--phdr; --phdr;
set_te16(&ehdri.e_phnum, --e_phnum); set_te16(&ehdri.e_phnum, --e_phnum);
@ -1317,14 +1334,17 @@ bool PackLinuxElf32::canPack()
// Apparently glibc-2.13.90 insists on 0==e_ident[EI_PAD..15], // Apparently glibc-2.13.90 insists on 0==e_ident[EI_PAD..15],
// so compressing shared libraries may be doomed anyway. // so compressing shared libraries may be doomed anyway.
// 2011-06-01: stub.shlib-init.S works around by installing hatch
// at end of .text.
if (elf_find_dynamic(Elf32_Dyn::DT_INIT)) { if (elf_find_dynamic(Elf32_Dyn::DT_INIT)) {
if (this->e_machine!=Elf32_Ehdr::EM_386) if (this->e_machine!=Elf32_Ehdr::EM_386
goto abandon; // need stub: EM_ARM EM_MIPS EM_PPC && this->e_machine!=Elf32_Ehdr::EM_ARM)
goto abandon; // need stub: EM_MIPS EM_PPC
if (elf_has_dynamic(Elf32_Dyn::DT_TEXTREL)) { if (elf_has_dynamic(Elf32_Dyn::DT_TEXTREL)) {
shdri = NULL; shdri = NULL;
phdri = NULL; phdri = NULL;
throwCantPack("re-compile with -fPIC to remove DT_TEXTREL"); throwCantPack("DT_TEXTREL found; re-compile with -fPIC");
goto abandon; goto abandon;
} }
Elf32_Shdr const *shdr = shdri; Elf32_Shdr const *shdr = shdri;
@ -1502,8 +1522,12 @@ PackLinuxElf64amd::canPack()
// and also requires ld-linux to behave. // and also requires ld-linux to behave.
if (elf_find_dynamic(Elf64_Dyn::DT_INIT)) { if (elf_find_dynamic(Elf64_Dyn::DT_INIT)) {
if (elf_has_dynamic(Elf64_Dyn::DT_TEXTREL)) if (elf_has_dynamic(Elf64_Dyn::DT_TEXTREL)) {
shdri = NULL;
phdri = NULL;
throwCantPack("DT_TEXTREL found; re-compile with -fPIC");
goto abandon; goto abandon;
}
Elf64_Shdr const *shdr = shdri; Elf64_Shdr const *shdr = shdri;
xct_va = ~0ull; xct_va = ~0ull;
for (j= n_elf_shnum; --j>=0; ++shdr) { for (j= n_elf_shnum; --j>=0; ++shdr) {
@ -1523,6 +1547,9 @@ PackLinuxElf64amd::canPack()
|| xct_va < elf_unsigned_dynamic(Elf64_Dyn::DT_VERDEF) || xct_va < elf_unsigned_dynamic(Elf64_Dyn::DT_VERDEF)
|| xct_va < elf_unsigned_dynamic(Elf64_Dyn::DT_VERSYM) || xct_va < elf_unsigned_dynamic(Elf64_Dyn::DT_VERSYM)
|| xct_va < elf_unsigned_dynamic(Elf64_Dyn::DT_VERNEEDED) ) { || xct_va < elf_unsigned_dynamic(Elf64_Dyn::DT_VERNEEDED) ) {
phdri = NULL;
shdri = NULL;
throwCantPack("DT_ tag above stub");
goto abandon; goto abandon;
} }
for ((shdr= shdri), (j= n_elf_shnum); --j>=0; ++shdr) { for ((shdr= shdri), (j= n_elf_shnum); --j>=0; ++shdr) {
@ -1877,7 +1904,7 @@ PackLinuxElf64::generateElfHdr(
} }
} }
void PackLinuxElf32::pack1(OutputFile * /*fo*/, Filter & /*ft*/) void PackLinuxElf32::pack1(OutputFile *fo, Filter & /*ft*/)
{ {
fi->seek(0, SEEK_SET); fi->seek(0, SEEK_SET);
fi->readx(&ehdri, sizeof(ehdri)); fi->readx(&ehdri, sizeof(ehdri));
@ -1921,40 +1948,38 @@ void PackLinuxElf32::pack1(OutputFile * /*fo*/, Filter & /*ft*/)
page_mask = ~0u<<lg2_page; page_mask = ~0u<<lg2_page;
progid = 0; // getRandomId(); not useful, so do not clutter progid = 0; // getRandomId(); not useful, so do not clutter
if (0!=xct_off) { // shared library
fi->seek(0, SEEK_SET);
fi->readx(ibuf, xct_off);
sz_elf_hdrs = xct_off;
fo->write(ibuf, xct_off);
memset(&linfo, 0, sizeof(linfo));
fo->write(&linfo, sizeof(linfo));
}
} }
void PackLinuxElf32x86::pack1(OutputFile *fo, Filter &ft) void PackLinuxElf32x86::pack1(OutputFile *fo, Filter &ft)
{ {
super::pack1(fo, ft); super::pack1(fo, ft);
if (0!=xct_off) { // shared library if (0!=xct_off) // shared library
fi->seek(0, SEEK_SET);
fi->readx(ibuf, xct_off);
sz_elf_hdrs = xct_off - sizeof(l_info);
fo->write(ibuf, xct_off);
return; return;
} generateElfHdr(fo, stub_i386_linux_elf_fold, getbrk(phdri, e_phnum) );
generateElfHdr(fo, stub_i386_linux_elf_fold,
getbrk(phdri, e_phnum) );
} }
void PackBSDElf32x86::pack1(OutputFile *fo, Filter &ft) void PackBSDElf32x86::pack1(OutputFile *fo, Filter &ft)
{ {
PackLinuxElf32::pack1(fo, ft); PackLinuxElf32::pack1(fo, ft);
if (0!=xct_off) // shared library
return;
generateElfHdr(fo, stub_i386_bsd_elf_fold, getbrk(phdri, e_phnum) ); generateElfHdr(fo, stub_i386_bsd_elf_fold, getbrk(phdri, e_phnum) );
} }
void PackLinuxElf32armLe::pack1(OutputFile *fo, Filter &ft) void PackLinuxElf32armLe::pack1(OutputFile *fo, Filter &ft)
{ {
super::pack1(fo, ft); super::pack1(fo, ft);
if (0!=xct_off) { // shared library if (0!=xct_off) // shared library
fi->seek(0, SEEK_SET);
fi->readx(ibuf, xct_off);
sz_elf_hdrs = xct_off - sizeof(l_info);
fo->write(ibuf, xct_off);
return; return;
}
unsigned const e_flags = get_te32(&ehdri.e_flags); unsigned const e_flags = get_te32(&ehdri.e_flags);
cprElfHdr3 h3; cprElfHdr3 h3;
if (Elf32_Ehdr::ELFOSABI_LINUX==ei_osabi) { if (Elf32_Ehdr::ELFOSABI_LINUX==ei_osabi) {
@ -1972,6 +1997,8 @@ void PackLinuxElf32armLe::pack1(OutputFile *fo, Filter &ft)
void PackLinuxElf32armBe::pack1(OutputFile *fo, Filter &ft) void PackLinuxElf32armBe::pack1(OutputFile *fo, Filter &ft)
{ {
super::pack1(fo, ft); super::pack1(fo, ft);
if (0!=xct_off) // shared library
return;
unsigned const e_flags = get_te32(&ehdri.e_flags); unsigned const e_flags = get_te32(&ehdri.e_flags);
cprElfHdr3 h3; cprElfHdr3 h3;
memcpy(&h3, stub_armeb_linux_elf_fold, sizeof(Elf32_Ehdr) + 2*sizeof(Elf32_Phdr)); memcpy(&h3, stub_armeb_linux_elf_fold, sizeof(Elf32_Ehdr) + 2*sizeof(Elf32_Phdr));
@ -1982,6 +2009,8 @@ void PackLinuxElf32armBe::pack1(OutputFile *fo, Filter &ft)
void PackLinuxElf32mipsel::pack1(OutputFile *fo, Filter &ft) void PackLinuxElf32mipsel::pack1(OutputFile *fo, Filter &ft)
{ {
super::pack1(fo, ft); super::pack1(fo, ft);
if (0!=xct_off) // shared library
return;
cprElfHdr3 h3; cprElfHdr3 h3;
memcpy(&h3, stub_mipsel_r3000_linux_elf_fold, sizeof(Elf32_Ehdr) + 2*sizeof(Elf32_Phdr)); memcpy(&h3, stub_mipsel_r3000_linux_elf_fold, sizeof(Elf32_Ehdr) + 2*sizeof(Elf32_Phdr));
generateElfHdr(fo, &h3, getbrk(phdri, e_phnum) ); generateElfHdr(fo, &h3, getbrk(phdri, e_phnum) );
@ -1990,6 +2019,8 @@ void PackLinuxElf32mipsel::pack1(OutputFile *fo, Filter &ft)
void PackLinuxElf32mipseb::pack1(OutputFile *fo, Filter &ft) void PackLinuxElf32mipseb::pack1(OutputFile *fo, Filter &ft)
{ {
super::pack1(fo, ft); super::pack1(fo, ft);
if (0!=xct_off) // shared library
return;
cprElfHdr3 h3; cprElfHdr3 h3;
memcpy(&h3, stub_mips_r3000_linux_elf_fold, sizeof(Elf32_Ehdr) + 2*sizeof(Elf32_Phdr)); memcpy(&h3, stub_mips_r3000_linux_elf_fold, sizeof(Elf32_Ehdr) + 2*sizeof(Elf32_Phdr));
generateElfHdr(fo, &h3, getbrk(phdri, e_phnum) ); generateElfHdr(fo, &h3, getbrk(phdri, e_phnum) );
@ -1998,10 +2029,12 @@ void PackLinuxElf32mipseb::pack1(OutputFile *fo, Filter &ft)
void PackLinuxElf32ppc::pack1(OutputFile *fo, Filter &ft) void PackLinuxElf32ppc::pack1(OutputFile *fo, Filter &ft)
{ {
super::pack1(fo, ft); super::pack1(fo, ft);
if (0!=xct_off) // shared library
return;
generateElfHdr(fo, stub_powerpc_linux_elf_fold, getbrk(phdri, e_phnum) ); generateElfHdr(fo, stub_powerpc_linux_elf_fold, getbrk(phdri, e_phnum) );
} }
void PackLinuxElf64::pack1(OutputFile * /*fo*/, Filter & /*ft*/) void PackLinuxElf64::pack1(OutputFile *fo, Filter & /*ft*/)
{ {
fi->seek(0, SEEK_SET); fi->seek(0, SEEK_SET);
fi->readx(&ehdri, sizeof(ehdri)); fi->readx(&ehdri, sizeof(ehdri));
@ -2044,20 +2077,23 @@ void PackLinuxElf64::pack1(OutputFile * /*fo*/, Filter & /*ft*/)
page_mask = ~0ull<<lg2_page; page_mask = ~0ull<<lg2_page;
progid = 0; // getRandomId(); not useful, so do not clutter progid = 0; // getRandomId(); not useful, so do not clutter
if (0!=xct_off) { // shared library
fi->seek(0, SEEK_SET);
fi->readx(ibuf, xct_off);
sz_elf_hdrs = xct_off;
fo->write(ibuf, xct_off);
memset(&linfo, 0, sizeof(linfo));
fo->write(&linfo, sizeof(linfo));
}
} }
void PackLinuxElf64amd::pack1(OutputFile *fo, Filter &ft) void PackLinuxElf64amd::pack1(OutputFile *fo, Filter &ft)
{ {
super::pack1(fo, ft); super::pack1(fo, ft);
if (0==xct_off) // main executable if (0!=xct_off) // shared library
generateElfHdr(fo, stub_amd64_linux_elf_fold, getbrk(phdri, e_phnum) ); return;
else { // shared library generateElfHdr(fo, stub_amd64_linux_elf_fold, getbrk(phdri, e_phnum) );
fi->seek(0, SEEK_SET);
fi->readx(ibuf, xct_off);
sz_elf_hdrs = xct_off - sizeof(l_info);
fo->write(ibuf, xct_off);
}
} }
// Determine length of gap between PT_LOAD phdr[k] and closest PT_LOAD // Determine length of gap between PT_LOAD phdr[k] and closest PT_LOAD
@ -2507,27 +2543,9 @@ void PackLinuxElf32mipsel::defineSymbols(Filter const * /*ft*/)
//linker->dumpSymbols(); // debug //linker->dumpSymbols(); // debug
} }
// Swap the byte ranges fo[a to b] and fo[b to c].
static void swap_byte_ranges(OutputFile *fo, unsigned a, unsigned b, unsigned c)
{
MemBuffer buf(c - a);
fo->seek(a, SEEK_SET);
fo->readx(buf, c - a);
fo->seek(a, SEEK_SET);
fo->rewrite(&buf[b - a], c - b);
fo->rewrite(&buf[0], b - a);
}
void PackLinuxElf32::pack4(OutputFile *fo, Filter &ft) void PackLinuxElf32::pack4(OutputFile *fo, Filter &ft)
{ {
overlay_offset = sz_elf_hdrs + sizeof(linfo); overlay_offset = sz_elf_hdrs + sizeof(linfo);
unsigned len = fpad4(fo);
// Put the loader in the middle, after the compressed PT_LOADs
// and before the compressed gaps (and debuginfo!)
// As first written, loader is fo[sz_pack2b to len],
// and gaps and debuginfo are fo[sz_pack2a to sz_pack2b].
swap_byte_ranges(fo, sz_pack2a, sz_pack2b, len);
// Cannot pre-round .p_memsz. If .p_filesz < .p_memsz, then kernel // Cannot pre-round .p_memsz. If .p_filesz < .p_memsz, then kernel
// tries to make .bss, which requires PF_W. // tries to make .bss, which requires PF_W.
@ -2551,16 +2569,10 @@ void PackLinuxElf32::pack4(OutputFile *fo, Filter &ft)
fo->seek(0, SEEK_SET); fo->seek(0, SEEK_SET);
if (0!=xct_off) { // shared library if (0!=xct_off) { // shared library
ehdri.e_ident[12] = 0xcd; // INT 0x80 (syscall [munmap])
ehdri.e_ident[13] = 0x80;
ehdri.e_ident[14] = 0x61; // POPA
ehdri.e_ident[15] = 0xc3; // RET
if (Elf32_Ehdr::EM_ARM==e_machine) {
set_te16(&ehdri.e_ident[12], 0xdf00); // swi 0
set_te16(&ehdri.e_ident[14], 0xbdff); // pop {all regs}
}
fo->rewrite(&ehdri, sizeof(ehdri)); fo->rewrite(&ehdri, sizeof(ehdri));
fo->rewrite(phdri, e_phnum * sizeof(*phdri)); fo->rewrite(phdri, e_phnum * sizeof(*phdri));
fo->seek(sz_elf_hdrs, SEEK_SET);
fo->rewrite(&linfo, sizeof(linfo));
} }
else { else {
unsigned const reloc = get_te32(&elfout.phdr[0].p_vaddr); unsigned const reloc = get_te32(&elfout.phdr[0].p_vaddr);
@ -2583,13 +2595,6 @@ void PackLinuxElf32::pack4(OutputFile *fo, Filter &ft)
void PackLinuxElf64::pack4(OutputFile *fo, Filter &ft) void PackLinuxElf64::pack4(OutputFile *fo, Filter &ft)
{ {
overlay_offset = sz_elf_hdrs + sizeof(linfo); overlay_offset = sz_elf_hdrs + sizeof(linfo);
unsigned len = fpad4(fo);
// Put the loader in the middle, after the compressed PT_LOADs
// and before the compressed gaps (and debuginfo!)
// As first written, loader is fo[sz_pack2b to len],
// and gaps and debuginfo are fo[sz_pack2a to sz_pack2b].
swap_byte_ranges(fo, sz_pack2a, sz_pack2b, len);
// Cannot pre-round .p_memsz. If .p_filesz < .p_memsz, then kernel // Cannot pre-round .p_memsz. If .p_filesz < .p_memsz, then kernel
// tries to make .bss, which requires PF_W. // tries to make .bss, which requires PF_W.
@ -2613,11 +2618,6 @@ void PackLinuxElf64::pack4(OutputFile *fo, Filter &ft)
fo->seek(0, SEEK_SET); fo->seek(0, SEEK_SET);
if (0!=xct_off) { // shared library if (0!=xct_off) { // shared library
ehdri.e_ident[11] = 0x0f; // syscall [munmap]
ehdri.e_ident[12] = 0x05;
ehdri.e_ident[13] = 0x5f; // pop %rdi (arg1)
ehdri.e_ident[14] = 0x5e; // pop %rsi (arg2)
ehdri.e_ident[15] = 0xc3; // RET
fo->rewrite(&ehdri, sizeof(ehdri)); fo->rewrite(&ehdri, sizeof(ehdri));
fo->rewrite(phdri, e_phnum * sizeof(*phdri)); fo->rewrite(phdri, e_phnum * sizeof(*phdri));
} }
@ -2665,7 +2665,8 @@ void PackLinuxElf64::unpack(OutputFile *fo)
load_va = get_te64(&phdr0x.p_vaddr); load_va = get_te64(&phdr0x.p_vaddr);
fi->seek(overlay_offset - sizeof(l_info), SEEK_SET); fi->seek(overlay_offset - sizeof(l_info), SEEK_SET);
fi->readx(&linfo, sizeof(linfo)); fi->readx(&linfo, sizeof(linfo));
lsize = get_te16(&linfo.l_lsize);
p_info hbuf; fi->readx(&hbuf, sizeof(hbuf)); p_info hbuf; fi->readx(&hbuf, sizeof(hbuf));
unsigned orig_file_size = get_te32(&hbuf.p_filesize); unsigned orig_file_size = get_te32(&hbuf.p_filesize);
blocksize = get_te32(&hbuf.p_blocksize); blocksize = get_te32(&hbuf.p_blocksize);
@ -2709,7 +2710,6 @@ void PackLinuxElf64::unpack(OutputFile *fo)
} }
} }
} }
lsize = get_te16(&linfo.l_lsize);
if (( (unsigned)(get_te64(&ehdri.e_entry) - load_va) + up4(lsize) + if (( (unsigned)(get_te64(&ehdri.e_entry) - load_va) + up4(lsize) +
ph.getPackHeaderSize() + sizeof(overlay_offset)) < up4(fi->st_size())) { ph.getPackHeaderSize() + sizeof(overlay_offset)) < up4(fi->st_size())) {
// Loader is not at end; skip past it. // Loader is not at end; skip past it.
@ -3125,7 +3125,8 @@ void PackLinuxElf32::unpack(OutputFile *fo)
load_va = get_te32(&phdr0x.p_vaddr); load_va = get_te32(&phdr0x.p_vaddr);
fi->seek(overlay_offset - sizeof(l_info), SEEK_SET); fi->seek(overlay_offset - sizeof(l_info), SEEK_SET);
fi->readx(&linfo, sizeof(linfo)); fi->readx(&linfo, sizeof(linfo));
lsize = get_te16(&linfo.l_lsize);
p_info hbuf; fi->readx(&hbuf, sizeof(hbuf)); p_info hbuf; fi->readx(&hbuf, sizeof(hbuf));
unsigned orig_file_size = get_te32(&hbuf.p_filesize); unsigned orig_file_size = get_te32(&hbuf.p_filesize);
blocksize = get_te32(&hbuf.p_blocksize); blocksize = get_te32(&hbuf.p_blocksize);
@ -3138,9 +3139,7 @@ void PackLinuxElf32::unpack(OutputFile *fo)
ph.u_len = get_te32(&bhdr.sz_unc); ph.u_len = get_te32(&bhdr.sz_unc);
ph.c_len = get_te32(&bhdr.sz_cpr); ph.c_len = get_te32(&bhdr.sz_cpr);
ph.filter_cto = bhdr.b_cto8; ph.filter_cto = bhdr.b_cto8;
bool const is_shlib = (ehdr->e_ident[12]==0xcd) // EM_386 bool const is_shlib = (ehdr->e_shoff!=0);
|| (ehdr->e_ident[11]==0x0f) // EM_X86_64
|| (get_te16(&ehdr->e_ident[12])==0xdf00); // EM_ARM (thumb)
// Peek at resulting Ehdr and Phdrs for use in controlling unpacking. // Peek at resulting Ehdr and Phdrs for use in controlling unpacking.
// Uncompress an extra time, and don't verify or update checksums. // Uncompress an extra time, and don't verify or update checksums.
@ -3166,6 +3165,7 @@ void PackLinuxElf32::unpack(OutputFile *fo)
// Read enough to position the input for next unpackExtent. // Read enough to position the input for next unpackExtent.
fi->seek(0, SEEK_SET); fi->seek(0, SEEK_SET);
fi->readx(ibuf, overlay_offset + sizeof(hbuf) + szb_info + ph.c_len); fi->readx(ibuf, overlay_offset + sizeof(hbuf) + szb_info + ph.c_len);
overlay_offset -= sizeof(linfo);
if (fo) { if (fo) {
fo->write(ibuf + ph.u_len, overlay_offset - ph.u_len); fo->write(ibuf + ph.u_len, overlay_offset - ph.u_len);
} }
@ -3216,7 +3216,6 @@ void PackLinuxElf32::unpack(OutputFile *fo)
} }
} }
} }
lsize = get_te16(&linfo.l_lsize);
if (( (unsigned)(get_te32(&ehdri.e_entry) - load_va) + up4(lsize) + if (( (unsigned)(get_te32(&ehdri.e_entry) - load_va) + up4(lsize) +
ph.getPackHeaderSize() + sizeof(overlay_offset)) < up4(fi->st_size())) { ph.getPackHeaderSize() + sizeof(overlay_offset)) < up4(fi->st_size())) {
// Loader is not at end; skip past it. // Loader is not at end; skip past it.

View File

@ -1,5 +1,5 @@
/* amd64-linux.shlib-init.h /* amd64-linux.shlib-init.h
created from amd64-linux.shlib-init.bin, 9544 (0x2548) bytes created from amd64-linux.shlib-init.bin, 9562 (0x255a) bytes
This file is part of the UPX executable compressor. This file is part of the UPX executable compressor.
@ -31,14 +31,14 @@
*/ */
#define STUB_AMD64_LINUX_SHLIB_INIT_SIZE 9544 #define STUB_AMD64_LINUX_SHLIB_INIT_SIZE 9562
#define STUB_AMD64_LINUX_SHLIB_INIT_ADLER32 0x8b37e549 #define STUB_AMD64_LINUX_SHLIB_INIT_ADLER32 0x9e52eb3c
#define STUB_AMD64_LINUX_SHLIB_INIT_CRC32 0x4f89c1b6 #define STUB_AMD64_LINUX_SHLIB_INIT_CRC32 0xbd58d081
unsigned char stub_amd64_linux_shlib_init[9544] = { unsigned char stub_amd64_linux_shlib_init[9562] = {
/* 0x0000 */ 127, 69, 76, 70, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x0000 */ 127, 69, 76, 70, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x0010 */ 1, 0, 62, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x0010 */ 1, 0, 62, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x0020 */ 0, 0, 0, 0, 0, 0, 0, 0,144, 25, 0, 0, 0, 0, 0, 0, /* 0x0020 */ 0, 0, 0, 0, 0, 0, 0, 0,160, 25, 0, 0, 0, 0, 0, 0,
/* 0x0030 */ 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 64, 0, 22, 0, 19, 0, /* 0x0030 */ 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 64, 0, 22, 0, 19, 0,
/* 0x0040 */ 80, 86, 87, 80, 82, 85, 72,137,229,232, 0, 0, 0, 0, 85, 83, /* 0x0040 */ 80, 86, 87, 80, 82, 85, 72,137,229,232, 0, 0, 0, 0, 85, 83,
/* 0x0050 */ 81, 82, 72, 1,254, 86, 72,137,254, 72,137,215, 49,219, 49,201, /* 0x0050 */ 81, 82, 72, 1,254, 86, 72,137,254, 72,137,215, 49,219, 49,201,
@ -411,7 +411,7 @@ unsigned char stub_amd64_linux_shlib_init[9544] = {
/* 0x1740 */ 0, 94,106, 2, 95,106, 1, 88, 15, 5,106,127, 95,106, 60, 88, /* 0x1740 */ 0, 94,106, 2, 95,106, 1, 88, 15, 5,106,127, 95,106, 60, 88,
/* 0x1750 */ 15, 5, 90, 72,141,114,226, 72,137,241,173, 72, 41,193,173, 72, /* 0x1750 */ 15, 5, 90, 72,141,114,226, 72,137,241,173, 72, 41,193,173, 72,
/* 0x1760 */ 1,200, 72,137, 69, 40,173, 72, 1,200, 72,137, 69, 16,173, 72, /* 0x1760 */ 1,200, 72,137, 69, 40,173, 72, 1,200, 72,137, 69, 16,173, 72,
/* 0x1770 */ 141, 60, 1, 72,141,119, 12, 80, 80,173,173, 72, 1,198,173,173, /* 0x1770 */ 141, 60, 1, 72,141,119, 24, 80, 80,173,173, 72, 1,198,173,173,
/* 0x1780 */ 72,137,249,129,225,255, 15, 0, 0, 72, 1,200, 80, 72, 41,207, /* 0x1780 */ 72,137,249,129,225,255, 15, 0, 0, 72, 1,200, 80, 72, 41,207,
/* 0x1790 */ 87, 72, 41,200, 72, 1,207, 81,232, 80, 0, 0, 0,131,249, 73, /* 0x1790 */ 87, 72, 41,200, 72, 1,207, 81,232, 80, 0, 0, 0,131,249, 73,
/* 0x17a0 */ 117, 74, 72,137,241, 72,137,254,235, 44,138, 7, 72,131,199, 1, /* 0x17a0 */ 117, 74, 72,137,241, 72,137,254,235, 44,138, 7, 72,131,199, 1,
@ -421,216 +421,217 @@ unsigned char stub_amd64_linux_shlib_init[9544] = {
/* 0x17e0 */ 72,255,201,117,217,235, 5, 72,255,201,117,190,195, 15,182, 78, /* 0x17e0 */ 72,255,201,117,217,235, 5, 72,255,201,117,190,195, 15,182, 78,
/* 0x17f0 */ 5, 81, 15,182, 78, 6, 81, 80, 72,137,225, 87, 82,173,137,194, /* 0x17f0 */ 5, 81, 15,182, 78, 6, 81, 80, 72,137,225, 87, 82,173,137,194,
/* 0x1800 */ 173, 80, 81, 87, 82, 86, 72,139, 69,168, 3, 80,252, 72,139, 69, /* 0x1800 */ 173, 80, 81, 87, 82, 86, 72,139, 69,168, 3, 80,252, 72,139, 69,
/* 0x1810 */ 208, 3, 80,252,232, 92, 0, 0, 0,106, 0, 65, 89,106, 0, 65, /* 0x1810 */ 208, 3, 80,252,232,110, 0, 0, 0,106, 0, 65, 89,106, 0, 65,
/* 0x1820 */ 88,106, 50, 65, 90,106, 3, 90, 72,139,117,232, 72,139,125,224, /* 0x1820 */ 88,106, 50, 65, 90,106, 3, 90, 72,139,117,232, 72,139,125,224,
/* 0x1830 */ 106, 9, 88, 15, 5, 72, 57,248,116, 1,244,139, 77,216, 72,137, /* 0x1830 */ 106, 9, 88, 15, 5, 72, 57,248,116, 1,244,139, 77,216, 72,137,
/* 0x1840 */ 199, 72,139,117,240,131,193, 3,193,233, 2,243,165, 95, 94, 90, /* 0x1840 */ 199, 72,139,117,240,131,193, 3,193,233, 2,243,165, 95, 94, 90,
/* 0x1850 */ 89, 65, 88, 88,255,208, 95, 94, 90, 89, 88, 72,133,201,116, 2, /* 0x1850 */ 89, 65, 88, 88,255,208, 95, 94, 72,141, 4, 55,199, 0, 15, 5,
/* 0x1860 */ 255,208, 89, 95, 94,106, 5, 90,106, 10, 88, 15, 5, 95, 94,106, /* 0x1860 */ 95, 94,198, 64, 4,195, 72,137, 69, 16, 90, 89, 88, 72,133,201,
/* 0x1870 */ 11, 88, 93, 90,195,139,117,216, 1,214, 88, 80, 3,112,252,106, /* 0x1870 */ 116, 2,255,208, 89, 95, 94,106, 5, 90,106, 10, 88, 15, 5, 95,
/* 0x1880 */ 0, 65, 89,106, 0, 65, 88,106, 34, 65, 90,106, 7, 90, 72,137, /* 0x1880 */ 94,106, 11, 88, 93, 90,195,139,117,216, 1,214, 88, 80, 3,112,
/* 0x1890 */ 117,248,106, 0, 95,106, 9, 88, 15, 5, 72, 61, 0,240,255,255, /* 0x1890 */ 252,106, 0, 65, 89,106, 0, 65, 88,106, 34, 65, 90,106, 7, 90,
/* 0x18a0 */ 114, 1,244, 72,137, 69,240, 72,137,199, 88,139, 77,216, 72,139, /* 0x18a0 */ 72,137,117,248,106, 0, 95,106, 9, 88, 15, 5, 72, 61, 0,240,
/* 0x18b0 */ 117,224,131,193, 3,193,233, 2,243,165, 94, 89, 81, 87,131,193, /* 0x18b0 */ 255,255,114, 1,244, 72,137, 69,240, 72,137,199, 88,139, 77,216,
/* 0x18c0 */ 3,193,233, 2,243,165, 72,139,117,168, 72,137,125,168,139, 78, /* 0x18c0 */ 72,139,117,224,131,193, 3,193,233, 2,243,165, 94, 89, 81, 87,
/* 0x18d0 */ 252,243,164, 72,139,117,208, 72,137,125,208,139, 78,252,243,164, /* 0x18d0 */ 131,193, 3,193,233, 2,243,165, 72,139,117,168, 72,137,125,168,
/* 0x18e0 */ 72,137,198, 87,139, 78,252,243,164,195,102,105,108,101, 32,102, /* 0x18e0 */ 139, 78,252,243,164, 72,139,117,208, 72,137,125,208,139, 78,252,
/* 0x18f0 */ 111,114,109, 97,116, 32,101,108,102, 54, 52, 45,120, 56, 54, 45, /* 0x18f0 */ 243,164, 72,137,198, 87,139, 78,252,243,164,195,102,105,108,101,
/* 0x1900 */ 54, 52, 10, 10, 83,101, 99,116,105,111,110,115, 58, 10, 73,100, /* 0x1900 */ 32,102,111,114,109, 97,116, 32,101,108,102, 54, 52, 45,120, 56,
/* 0x1910 */ 120, 32, 78, 97,109,101, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, /* 0x1910 */ 54, 45, 54, 52, 10, 10, 83,101, 99,116,105,111,110,115, 58, 10,
/* 0x1920 */ 83,105,122,101, 32, 32, 32, 32, 32, 32, 86, 77, 65, 32, 32, 32, /* 0x1920 */ 73,100,120, 32, 78, 97,109,101, 32, 32, 32, 32, 32, 32, 32, 32,
/* 0x1930 */ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 76, 77, 65, 32, /* 0x1930 */ 32, 32, 83,105,122,101, 32, 32, 32, 32, 32, 32, 86, 77, 65, 32,
/* 0x1940 */ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 70,105, /* 0x1940 */ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 76, 77,
/* 0x1950 */ 108,101, 32,111,102,102, 32, 32, 65,108,103,110, 32, 32, 70,108, /* 0x1950 */ 65, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
/* 0x1960 */ 97,103,115, 10, 32, 32, 48, 32, 69, 76, 70, 77, 65, 73, 78, 88, /* 0x1960 */ 70,105,108,101, 32,111,102,102, 32, 32, 65,108,103,110, 32, 32,
/* 0x1970 */ 32, 32, 32, 32, 32, 32, 48, 48, 48, 48, 48, 48, 49, 54, 32, 32, /* 0x1970 */ 70,108, 97,103,115, 10, 32, 32, 48, 32, 69, 76, 70, 77, 65, 73,
/* 0x1980 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1980 */ 78, 88, 32, 32, 32, 32, 32, 32, 48, 48, 48, 48, 48, 48, 49, 54,
/* 0x1990 */ 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1990 */ 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x19a0 */ 48, 48, 32, 32, 48, 48, 48, 48, 48, 48, 52, 48, 32, 32, 50, 42, /* 0x19a0 */ 48, 48, 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x19b0 */ 42, 48, 32, 32, 67, 79, 78, 84, 69, 78, 84, 83, 44, 32, 82, 69, /* 0x19b0 */ 48, 48, 48, 48, 32, 32, 48, 48, 48, 48, 48, 48, 52, 48, 32, 32,
/* 0x19c0 */ 76, 79, 67, 44, 32, 82, 69, 65, 68, 79, 78, 76, 89, 10, 32, 32, /* 0x19c0 */ 50, 42, 42, 48, 32, 32, 67, 79, 78, 84, 69, 78, 84, 83, 44, 32,
/* 0x19d0 */ 49, 32, 78, 82, 86, 95, 72, 69, 65, 68, 32, 32, 32, 32, 32, 32, /* 0x19d0 */ 82, 69, 76, 79, 67, 44, 32, 82, 69, 65, 68, 79, 78, 76, 89, 10,
/* 0x19e0 */ 48, 48, 48, 48, 48, 48, 54, 54, 32, 32, 48, 48, 48, 48, 48, 48, /* 0x19e0 */ 32, 32, 49, 32, 78, 82, 86, 95, 72, 69, 65, 68, 32, 32, 32, 32,
/* 0x19f0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48, 48, 48, /* 0x19f0 */ 32, 32, 48, 48, 48, 48, 48, 48, 54, 54, 32, 32, 48, 48, 48, 48,
/* 0x1a00 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48, /* 0x1a00 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48,
/* 0x1a10 */ 48, 48, 48, 48, 53, 54, 32, 32, 50, 42, 42, 48, 32, 32, 67, 79, /* 0x1a10 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32,
/* 0x1a20 */ 78, 84, 69, 78, 84, 83, 44, 32, 82, 69, 65, 68, 79, 78, 76, 89, /* 0x1a20 */ 48, 48, 48, 48, 48, 48, 53, 54, 32, 32, 50, 42, 42, 48, 32, 32,
/* 0x1a30 */ 10, 32, 32, 50, 32, 78, 82, 86, 50, 69, 32, 32, 32, 32, 32, 32, /* 0x1a30 */ 67, 79, 78, 84, 69, 78, 84, 83, 44, 32, 82, 69, 65, 68, 79, 78,
/* 0x1a40 */ 32, 32, 32, 48, 48, 48, 48, 48, 48, 98, 55, 32, 32, 48, 48, 48, /* 0x1a40 */ 76, 89, 10, 32, 32, 50, 32, 78, 82, 86, 50, 69, 32, 32, 32, 32,
/* 0x1a50 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, /* 0x1a50 */ 32, 32, 32, 32, 32, 48, 48, 48, 48, 48, 48, 98, 55, 32, 32, 48,
/* 0x1a60 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, /* 0x1a60 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32,
/* 0x1a70 */ 32, 48, 48, 48, 48, 48, 48, 98, 99, 32, 32, 50, 42, 42, 48, 32, /* 0x1a70 */ 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1a80 */ 32, 67, 79, 78, 84, 69, 78, 84, 83, 44, 32, 82, 69, 76, 79, 67, /* 0x1a80 */ 48, 32, 32, 48, 48, 48, 48, 48, 48, 98, 99, 32, 32, 50, 42, 42,
/* 0x1a90 */ 44, 32, 82, 69, 65, 68, 79, 78, 76, 89, 10, 32, 32, 51, 32, 78, /* 0x1a90 */ 48, 32, 32, 67, 79, 78, 84, 69, 78, 84, 83, 44, 32, 82, 69, 76,
/* 0x1aa0 */ 82, 86, 50, 68, 32, 32, 32, 32, 32, 32, 32, 32, 32, 48, 48, 48, /* 0x1aa0 */ 79, 67, 44, 32, 82, 69, 65, 68, 79, 78, 76, 89, 10, 32, 32, 51,
/* 0x1ab0 */ 48, 48, 48, 57,101, 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1ab0 */ 32, 78, 82, 86, 50, 68, 32, 32, 32, 32, 32, 32, 32, 32, 32, 48,
/* 0x1ac0 */ 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48, 48, 48, 48, 48, 48, /* 0x1ac0 */ 48, 48, 48, 48, 48, 57,101, 32, 32, 48, 48, 48, 48, 48, 48, 48,
/* 0x1ad0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48, 48, 48, 48, /* 0x1ad0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48, 48, 48, 48,
/* 0x1ae0 */ 49, 55, 51, 32, 32, 50, 42, 42, 48, 32, 32, 67, 79, 78, 84, 69, /* 0x1ae0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48, 48,
/* 0x1af0 */ 78, 84, 83, 44, 32, 82, 69, 76, 79, 67, 44, 32, 82, 69, 65, 68, /* 0x1af0 */ 48, 48, 49, 55, 51, 32, 32, 50, 42, 42, 48, 32, 32, 67, 79, 78,
/* 0x1b00 */ 79, 78, 76, 89, 10, 32, 32, 52, 32, 78, 82, 86, 50, 66, 32, 32, /* 0x1b00 */ 84, 69, 78, 84, 83, 44, 32, 82, 69, 76, 79, 67, 44, 32, 82, 69,
/* 0x1b10 */ 32, 32, 32, 32, 32, 32, 32, 48, 48, 48, 48, 48, 48, 57, 48, 32, /* 0x1b10 */ 65, 68, 79, 78, 76, 89, 10, 32, 32, 52, 32, 78, 82, 86, 50, 66,
/* 0x1b20 */ 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1b20 */ 32, 32, 32, 32, 32, 32, 32, 32, 32, 48, 48, 48, 48, 48, 48, 57,
/* 0x1b30 */ 48, 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1b30 */ 48, 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1b40 */ 48, 48, 48, 32, 32, 48, 48, 48, 48, 48, 50, 49, 49, 32, 32, 50, /* 0x1b40 */ 48, 48, 48, 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1b50 */ 42, 42, 48, 32, 32, 67, 79, 78, 84, 69, 78, 84, 83, 44, 32, 82, /* 0x1b50 */ 48, 48, 48, 48, 48, 32, 32, 48, 48, 48, 48, 48, 50, 49, 49, 32,
/* 0x1b60 */ 69, 76, 79, 67, 44, 32, 82, 69, 65, 68, 79, 78, 76, 89, 10, 32, /* 0x1b60 */ 32, 50, 42, 42, 48, 32, 32, 67, 79, 78, 84, 69, 78, 84, 83, 44,
/* 0x1b70 */ 32, 53, 32, 76, 90, 77, 65, 95, 69, 76, 70, 48, 48, 32, 32, 32, /* 0x1b70 */ 32, 82, 69, 76, 79, 67, 44, 32, 82, 69, 65, 68, 79, 78, 76, 89,
/* 0x1b80 */ 32, 48, 48, 48, 48, 48, 48, 54, 52, 32, 32, 48, 48, 48, 48, 48, /* 0x1b80 */ 10, 32, 32, 53, 32, 76, 90, 77, 65, 95, 69, 76, 70, 48, 48, 32,
/* 0x1b90 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48, 48, /* 0x1b90 */ 32, 32, 32, 48, 48, 48, 48, 48, 48, 54, 52, 32, 32, 48, 48, 48,
/* 0x1ba0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, /* 0x1ba0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48,
/* 0x1bb0 */ 48, 48, 48, 48, 50, 97, 49, 32, 32, 50, 42, 42, 48, 32, 32, 67, /* 0x1bb0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32,
/* 0x1bc0 */ 79, 78, 84, 69, 78, 84, 83, 44, 32, 82, 69, 76, 79, 67, 44, 32, /* 0x1bc0 */ 32, 48, 48, 48, 48, 48, 50, 97, 49, 32, 32, 50, 42, 42, 48, 32,
/* 0x1bd0 */ 82, 69, 65, 68, 79, 78, 76, 89, 10, 32, 32, 54, 32, 76, 90, 77, /* 0x1bd0 */ 32, 67, 79, 78, 84, 69, 78, 84, 83, 44, 32, 82, 69, 76, 79, 67,
/* 0x1be0 */ 65, 95, 68, 69, 67, 49, 48, 32, 32, 32, 32, 48, 48, 48, 48, 48, /* 0x1be0 */ 44, 32, 82, 69, 65, 68, 79, 78, 76, 89, 10, 32, 32, 54, 32, 76,
/* 0x1bf0 */ 57,102, 55, 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1bf0 */ 90, 77, 65, 95, 68, 69, 67, 49, 48, 32, 32, 32, 32, 48, 48, 48,
/* 0x1c00 */ 48, 48, 48, 48, 48, 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1c00 */ 48, 48, 57,102, 55, 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1c10 */ 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48, 48, 48, 48, 51, 48, /* 0x1c10 */ 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48, 48, 48, 48, 48, 48,
/* 0x1c20 */ 53, 32, 32, 50, 42, 42, 48, 32, 32, 67, 79, 78, 84, 69, 78, 84, /* 0x1c20 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48, 48, 48, 48,
/* 0x1c30 */ 83, 44, 32, 82, 69, 65, 68, 79, 78, 76, 89, 10, 32, 32, 55, 32, /* 0x1c30 */ 51, 48, 53, 32, 32, 50, 42, 42, 48, 32, 32, 67, 79, 78, 84, 69,
/* 0x1c40 */ 76, 90, 77, 65, 95, 68, 69, 67, 50, 48, 32, 32, 32, 32, 48, 48, /* 0x1c40 */ 78, 84, 83, 44, 32, 82, 69, 65, 68, 79, 78, 76, 89, 10, 32, 32,
/* 0x1c50 */ 48, 48, 48, 57,102, 55, 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1c50 */ 55, 32, 76, 90, 77, 65, 95, 68, 69, 67, 50, 48, 32, 32, 32, 32,
/* 0x1c60 */ 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48, 48, 48, 48, 48, /* 0x1c60 */ 48, 48, 48, 48, 48, 57,102, 55, 32, 32, 48, 48, 48, 48, 48, 48,
/* 0x1c70 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48, 48, 48, /* 0x1c70 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48, 48, 48,
/* 0x1c80 */ 48, 99,102, 99, 32, 32, 50, 42, 42, 48, 32, 32, 67, 79, 78, 84, /* 0x1c80 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48,
/* 0x1c90 */ 69, 78, 84, 83, 44, 32, 82, 69, 65, 68, 79, 78, 76, 89, 10, 32, /* 0x1c90 */ 48, 48, 48, 99,102, 99, 32, 32, 50, 42, 42, 48, 32, 32, 67, 79,
/* 0x1ca0 */ 32, 56, 32, 76, 90, 77, 65, 95, 68, 69, 67, 51, 48, 32, 32, 32, /* 0x1ca0 */ 78, 84, 69, 78, 84, 83, 44, 32, 82, 69, 65, 68, 79, 78, 76, 89,
/* 0x1cb0 */ 32, 48, 48, 48, 48, 48, 48, 49, 52, 32, 32, 48, 48, 48, 48, 48, /* 0x1cb0 */ 10, 32, 32, 56, 32, 76, 90, 77, 65, 95, 68, 69, 67, 51, 48, 32,
/* 0x1cc0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48, 48, /* 0x1cc0 */ 32, 32, 32, 48, 48, 48, 48, 48, 48, 49, 52, 32, 32, 48, 48, 48,
/* 0x1cd0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, /* 0x1cd0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48,
/* 0x1ce0 */ 48, 48, 48, 49, 54,102, 51, 32, 32, 50, 42, 42, 48, 32, 32, 67, /* 0x1ce0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32,
/* 0x1cf0 */ 79, 78, 84, 69, 78, 84, 83, 44, 32, 82, 69, 65, 68, 79, 78, 76, /* 0x1cf0 */ 32, 48, 48, 48, 48, 49, 54,102, 51, 32, 32, 50, 42, 42, 48, 32,
/* 0x1d00 */ 89, 10, 32, 32, 57, 32, 78, 82, 86, 95, 84, 65, 73, 76, 32, 32, /* 0x1d00 */ 32, 67, 79, 78, 84, 69, 78, 84, 83, 44, 32, 82, 69, 65, 68, 79,
/* 0x1d10 */ 32, 32, 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48, /* 0x1d10 */ 78, 76, 89, 10, 32, 32, 57, 32, 78, 82, 86, 95, 84, 65, 73, 76,
/* 0x1d20 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, /* 0x1d20 */ 32, 32, 32, 32, 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32,
/* 0x1d30 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1d30 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1d40 */ 32, 32, 48, 48, 48, 48, 49, 55, 48, 55, 32, 32, 50, 42, 42, 48, /* 0x1d40 */ 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1d50 */ 32, 32, 67, 79, 78, 84, 69, 78, 84, 83, 44, 32, 82, 69, 65, 68, /* 0x1d50 */ 48, 48, 32, 32, 48, 48, 48, 48, 49, 55, 48, 55, 32, 32, 50, 42,
/* 0x1d60 */ 79, 78, 76, 89, 10, 32, 49, 48, 32, 69, 76, 70, 77, 65, 73, 78, /* 0x1d60 */ 42, 48, 32, 32, 67, 79, 78, 84, 69, 78, 84, 83, 44, 32, 82, 69,
/* 0x1d70 */ 89, 32, 32, 32, 32, 32, 32, 48, 48, 48, 48, 48, 48, 51, 97, 32, /* 0x1d70 */ 65, 68, 79, 78, 76, 89, 10, 32, 49, 48, 32, 69, 76, 70, 77, 65,
/* 0x1d80 */ 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1d80 */ 73, 78, 89, 32, 32, 32, 32, 32, 32, 48, 48, 48, 48, 48, 48, 51,
/* 0x1d90 */ 48, 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1d90 */ 97, 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1da0 */ 48, 48, 48, 32, 32, 48, 48, 48, 48, 49, 55, 48, 55, 32, 32, 50, /* 0x1da0 */ 48, 48, 48, 32, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1db0 */ 42, 42, 48, 32, 32, 67, 79, 78, 84, 69, 78, 84, 83, 44, 32, 82, /* 0x1db0 */ 48, 48, 48, 48, 48, 32, 32, 48, 48, 48, 48, 49, 55, 48, 55, 32,
/* 0x1dc0 */ 69, 76, 79, 67, 44, 32, 82, 69, 65, 68, 79, 78, 76, 89, 10, 32, /* 0x1dc0 */ 32, 50, 42, 42, 48, 32, 32, 67, 79, 78, 84, 69, 78, 84, 83, 44,
/* 0x1dd0 */ 49, 49, 32, 69, 76, 70, 77, 65, 73, 78, 90, 32, 32, 32, 32, 32, /* 0x1dd0 */ 32, 82, 69, 76, 79, 67, 44, 32, 82, 69, 65, 68, 79, 78, 76, 89,
/* 0x1de0 */ 32, 48, 48, 48, 48, 48, 49, 97, 57, 32, 32, 48, 48, 48, 48, 48, /* 0x1de0 */ 10, 32, 49, 49, 32, 69, 76, 70, 77, 65, 73, 78, 90, 32, 32, 32,
/* 0x1df0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, 48, 48, /* 0x1df0 */ 32, 32, 32, 48, 48, 48, 48, 48, 49, 98, 98, 32, 32, 48, 48, 48,
/* 0x1e00 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48, /* 0x1e00 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 32, 48,
/* 0x1e10 */ 48, 48, 48, 49, 55, 52, 49, 32, 32, 50, 42, 42, 48, 32, 32, 67, /* 0x1e10 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32,
/* 0x1e20 */ 79, 78, 84, 69, 78, 84, 83, 44, 32, 82, 69, 65, 68, 79, 78, 76, /* 0x1e20 */ 32, 48, 48, 48, 48, 49, 55, 52, 49, 32, 32, 50, 42, 42, 48, 32,
/* 0x1e30 */ 89, 10, 83, 89, 77, 66, 79, 76, 32, 84, 65, 66, 76, 69, 58, 10, /* 0x1e30 */ 32, 67, 79, 78, 84, 69, 78, 84, 83, 44, 32, 82, 69, 65, 68, 79,
/* 0x1e40 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1e40 */ 78, 76, 89, 10, 83, 89, 77, 66, 79, 76, 32, 84, 65, 66, 76, 69,
/* 0x1e50 */ 32,108, 32, 32, 32, 32,100, 32, 32, 78, 82, 86, 95, 72, 69, 65, /* 0x1e50 */ 58, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1e60 */ 68, 9, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1e60 */ 48, 48, 32,108, 32, 32, 32, 32,100, 32, 32, 78, 82, 86, 95, 72,
/* 0x1e70 */ 48, 48, 32, 78, 82, 86, 95, 72, 69, 65, 68, 10, 48, 48, 48, 48, /* 0x1e70 */ 69, 65, 68, 9, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1e80 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32,108, 32, 32, /* 0x1e80 */ 48, 48, 48, 48, 32, 78, 82, 86, 95, 72, 69, 65, 68, 10, 48, 48,
/* 0x1e90 */ 32, 32,100, 32, 32, 76, 90, 77, 65, 95, 68, 69, 67, 51, 48, 9, /* 0x1e90 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32,108,
/* 0x1ea0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1ea0 */ 32, 32, 32, 32,100, 32, 32, 76, 90, 77, 65, 95, 68, 69, 67, 51,
/* 0x1eb0 */ 32, 76, 90, 77, 65, 95, 68, 69, 67, 51, 48, 10, 48, 48, 48, 48, /* 0x1eb0 */ 48, 9, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1ec0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32,108, 32, 32, /* 0x1ec0 */ 48, 48, 32, 76, 90, 77, 65, 95, 68, 69, 67, 51, 48, 10, 48, 48,
/* 0x1ed0 */ 32, 32,100, 32, 32, 69, 76, 70, 77, 65, 73, 78, 89, 9, 48, 48, /* 0x1ed0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32,108,
/* 0x1ee0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 69, /* 0x1ee0 */ 32, 32, 32, 32,100, 32, 32, 69, 76, 70, 77, 65, 73, 78, 89, 9,
/* 0x1ef0 */ 76, 70, 77, 65, 73, 78, 89, 10, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1ef0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1f00 */ 48, 48, 48, 48, 48, 48, 48, 48, 32,108, 32, 32, 32, 32,100, 32, /* 0x1f00 */ 32, 69, 76, 70, 77, 65, 73, 78, 89, 10, 48, 48, 48, 48, 48, 48,
/* 0x1f10 */ 32, 69, 76, 70, 77, 65, 73, 78, 90, 9, 48, 48, 48, 48, 48, 48, /* 0x1f10 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32,108, 32, 32, 32, 32,
/* 0x1f20 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 69, 76, 70, 77, 65, /* 0x1f20 */ 100, 32, 32, 69, 76, 70, 77, 65, 73, 78, 90, 9, 48, 48, 48, 48,
/* 0x1f30 */ 73, 78, 90, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1f30 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 69, 76, 70,
/* 0x1f40 */ 48, 48, 48, 48, 32,108, 32, 32, 32, 32,100, 32, 32, 69, 76, 70, /* 0x1f40 */ 77, 65, 73, 78, 90, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1f50 */ 77, 65, 73, 78, 88, 9, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1f50 */ 48, 48, 48, 48, 48, 48, 32,108, 32, 32, 32, 32,100, 32, 32, 69,
/* 0x1f60 */ 48, 48, 48, 48, 48, 48, 32, 69, 76, 70, 77, 65, 73, 78, 88, 10, /* 0x1f60 */ 76, 70, 77, 65, 73, 78, 88, 9, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1f70 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1f70 */ 48, 48, 48, 48, 48, 48, 48, 48, 32, 69, 76, 70, 77, 65, 73, 78,
/* 0x1f80 */ 32,108, 32, 32, 32, 32,100, 32, 32, 78, 82, 86, 50, 69, 9, 48, /* 0x1f80 */ 88, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1f90 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, /* 0x1f90 */ 48, 48, 32,108, 32, 32, 32, 32,100, 32, 32, 78, 82, 86, 50, 69,
/* 0x1fa0 */ 78, 82, 86, 50, 69, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1fa0 */ 9, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1fb0 */ 48, 48, 48, 48, 48, 48, 32,108, 32, 32, 32, 32,100, 32, 32, 78, /* 0x1fb0 */ 48, 32, 78, 82, 86, 50, 69, 10, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1fc0 */ 82, 86, 50, 68, 9, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x1fc0 */ 48, 48, 48, 48, 48, 48, 48, 48, 32,108, 32, 32, 32, 32,100, 32,
/* 0x1fd0 */ 48, 48, 48, 48, 48, 32, 78, 82, 86, 50, 68, 10, 48, 48, 48, 48, /* 0x1fd0 */ 32, 78, 82, 86, 50, 68, 9, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x1fe0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32,108, 32, 32, /* 0x1fe0 */ 48, 48, 48, 48, 48, 48, 48, 32, 78, 82, 86, 50, 68, 10, 48, 48,
/* 0x1ff0 */ 32, 32,100, 32, 32, 78, 82, 86, 50, 66, 9, 48, 48, 48, 48, 48, /* 0x1ff0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32,108,
/* 0x2000 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 78, 82, 86, 50, /* 0x2000 */ 32, 32, 32, 32,100, 32, 32, 78, 82, 86, 50, 66, 9, 48, 48, 48,
/* 0x2010 */ 66, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x2010 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 78, 82,
/* 0x2020 */ 48, 48, 32,108, 32, 32, 32, 32,100, 32, 32, 76, 90, 77, 65, 95, /* 0x2020 */ 86, 50, 66, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x2030 */ 69, 76, 70, 48, 48, 9, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x2030 */ 48, 48, 48, 48, 32,108, 32, 32, 32, 32,100, 32, 32, 76, 90, 77,
/* 0x2040 */ 48, 48, 48, 48, 48, 48, 32, 76, 90, 77, 65, 95, 69, 76, 70, 48, /* 0x2040 */ 65, 95, 69, 76, 70, 48, 48, 9, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x2050 */ 48, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x2050 */ 48, 48, 48, 48, 48, 48, 48, 48, 32, 76, 90, 77, 65, 95, 69, 76,
/* 0x2060 */ 48, 48, 32,108, 32, 32, 32, 32,100, 32, 32, 76, 90, 77, 65, 95, /* 0x2060 */ 70, 48, 48, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x2070 */ 68, 69, 67, 49, 48, 9, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x2070 */ 48, 48, 48, 48, 32,108, 32, 32, 32, 32,100, 32, 32, 76, 90, 77,
/* 0x2080 */ 48, 48, 48, 48, 48, 48, 32, 76, 90, 77, 65, 95, 68, 69, 67, 49, /* 0x2080 */ 65, 95, 68, 69, 67, 49, 48, 9, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x2090 */ 48, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x2090 */ 48, 48, 48, 48, 48, 48, 48, 48, 32, 76, 90, 77, 65, 95, 68, 69,
/* 0x20a0 */ 48, 48, 32,108, 32, 32, 32, 32,100, 32, 32, 76, 90, 77, 65, 95, /* 0x20a0 */ 67, 49, 48, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x20b0 */ 68, 69, 67, 50, 48, 9, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x20b0 */ 48, 48, 48, 48, 32,108, 32, 32, 32, 32,100, 32, 32, 76, 90, 77,
/* 0x20c0 */ 48, 48, 48, 48, 48, 48, 32, 76, 90, 77, 65, 95, 68, 69, 67, 50, /* 0x20c0 */ 65, 95, 68, 69, 67, 50, 48, 9, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x20d0 */ 48, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x20d0 */ 48, 48, 48, 48, 48, 48, 48, 48, 32, 76, 90, 77, 65, 95, 68, 69,
/* 0x20e0 */ 48, 48, 32,108, 32, 32, 32, 32,100, 32, 32, 78, 82, 86, 95, 84, /* 0x20e0 */ 67, 50, 48, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x20f0 */ 65, 73, 76, 9, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x20f0 */ 48, 48, 48, 48, 32,108, 32, 32, 32, 32,100, 32, 32, 78, 82, 86,
/* 0x2100 */ 48, 48, 48, 48, 32, 78, 82, 86, 95, 84, 65, 73, 76, 10, 48, 48, /* 0x2100 */ 95, 84, 65, 73, 76, 9, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x2110 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32,103, /* 0x2110 */ 48, 48, 48, 48, 48, 48, 32, 78, 82, 86, 95, 84, 65, 73, 76, 10,
/* 0x2120 */ 32, 32, 32, 32, 32, 32, 32, 69, 76, 70, 77, 65, 73, 78, 88, 9, /* 0x2120 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x2130 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x2130 */ 32,103, 32, 32, 32, 32, 32, 32, 32, 69, 76, 70, 77, 65, 73, 78,
/* 0x2140 */ 32, 95,115,116, 97,114,116, 10, 10, 82, 69, 76, 79, 67, 65, 84, /* 0x2140 */ 88, 9, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x2150 */ 73, 79, 78, 32, 82, 69, 67, 79, 82, 68, 83, 32, 70, 79, 82, 32, /* 0x2150 */ 48, 48, 32, 95,115,116, 97,114,116, 10, 10, 82, 69, 76, 79, 67,
/* 0x2160 */ 91, 69, 76, 70, 77, 65, 73, 78, 88, 93, 58, 10, 79, 70, 70, 83, /* 0x2160 */ 65, 84, 73, 79, 78, 32, 82, 69, 67, 79, 82, 68, 83, 32, 70, 79,
/* 0x2170 */ 69, 84, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 84, 89, 80, /* 0x2170 */ 82, 32, 91, 69, 76, 70, 77, 65, 73, 78, 88, 93, 58, 10, 79, 70,
/* 0x2180 */ 69, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 86, /* 0x2180 */ 70, 83, 69, 84, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 84,
/* 0x2190 */ 65, 76, 85, 69, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x2190 */ 89, 80, 69, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
/* 0x21a0 */ 48, 48, 48, 48, 97, 32, 82, 95, 88, 56, 54, 95, 54, 52, 95, 80, /* 0x21a0 */ 32, 86, 65, 76, 85, 69, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x21b0 */ 67, 51, 50, 32, 32, 32, 32, 32, 69, 76, 70, 77, 65, 73, 78, 90, /* 0x21b0 */ 48, 48, 48, 48, 48, 48, 97, 32, 82, 95, 88, 56, 54, 95, 54, 52,
/* 0x21c0 */ 43, 48,120, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x21c0 */ 95, 80, 67, 51, 50, 32, 32, 32, 32, 32, 69, 76, 70, 77, 65, 73,
/* 0x21d0 */ 48, 48,100, 10, 10, 82, 69, 76, 79, 67, 65, 84, 73, 79, 78, 32, /* 0x21d0 */ 78, 90, 43, 48,120, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x21e0 */ 82, 69, 67, 79, 82, 68, 83, 32, 70, 79, 82, 32, 91, 78, 82, 86, /* 0x21e0 */ 48, 48, 48, 48,100, 10, 10, 82, 69, 76, 79, 67, 65, 84, 73, 79,
/* 0x21f0 */ 50, 69, 93, 58, 10, 79, 70, 70, 83, 69, 84, 32, 32, 32, 32, 32, /* 0x21f0 */ 78, 32, 82, 69, 67, 79, 82, 68, 83, 32, 70, 79, 82, 32, 91, 78,
/* 0x2200 */ 32, 32, 32, 32, 32, 32, 84, 89, 80, 69, 32, 32, 32, 32, 32, 32, /* 0x2200 */ 82, 86, 50, 69, 93, 58, 10, 79, 70, 70, 83, 69, 84, 32, 32, 32,
/* 0x2210 */ 32, 32, 32, 32, 32, 32, 32, 32, 86, 65, 76, 85, 69, 10, 48, 48, /* 0x2210 */ 32, 32, 32, 32, 32, 32, 32, 32, 84, 89, 80, 69, 32, 32, 32, 32,
/* 0x2220 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 97,101, 32, 82, /* 0x2220 */ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 86, 65, 76, 85, 69, 10,
/* 0x2230 */ 95, 88, 56, 54, 95, 54, 52, 95, 80, 67, 51, 50, 32, 32, 32, 32, /* 0x2230 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 97,101,
/* 0x2240 */ 32, 78, 82, 86, 95, 72, 69, 65, 68, 43, 48,120, 48, 48, 48, 48, /* 0x2240 */ 32, 82, 95, 88, 56, 54, 95, 54, 52, 95, 80, 67, 51, 50, 32, 32,
/* 0x2250 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 50, 49, 10, 48, 48, 48, /* 0x2250 */ 32, 32, 32, 78, 82, 86, 95, 72, 69, 65, 68, 43, 48,120, 48, 48,
/* 0x2260 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 53, 98, 32, 82, 95, /* 0x2260 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 50, 49, 10, 48,
/* 0x2270 */ 88, 56, 54, 95, 54, 52, 95, 80, 67, 51, 50, 32, 32, 32, 32, 32, /* 0x2270 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 53, 98, 32,
/* 0x2280 */ 69, 76, 70, 77, 65, 73, 78, 89, 43, 48,120,102,102,102,102,102, /* 0x2280 */ 82, 95, 88, 56, 54, 95, 54, 52, 95, 80, 67, 51, 50, 32, 32, 32,
/* 0x2290 */ 102,102,102,102,102,102,102,102,102,102, 99, 10, 10, 82, 69, 76, /* 0x2290 */ 32, 32, 69, 76, 70, 77, 65, 73, 78, 89, 43, 48,120,102,102,102,
/* 0x22a0 */ 79, 67, 65, 84, 73, 79, 78, 32, 82, 69, 67, 79, 82, 68, 83, 32, /* 0x22a0 */ 102,102,102,102,102,102,102,102,102,102,102,102, 99, 10, 10, 82,
/* 0x22b0 */ 70, 79, 82, 32, 91, 78, 82, 86, 50, 68, 93, 58, 10, 79, 70, 70, /* 0x22b0 */ 69, 76, 79, 67, 65, 84, 73, 79, 78, 32, 82, 69, 67, 79, 82, 68,
/* 0x22c0 */ 83, 69, 84, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 84, 89, /* 0x22c0 */ 83, 32, 70, 79, 82, 32, 91, 78, 82, 86, 50, 68, 93, 58, 10, 79,
/* 0x22d0 */ 80, 69, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, /* 0x22d0 */ 70, 70, 83, 69, 84, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
/* 0x22e0 */ 86, 65, 76, 85, 69, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x22e0 */ 84, 89, 80, 69, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
/* 0x22f0 */ 48, 48, 48, 48, 57, 53, 32, 82, 95, 88, 56, 54, 95, 54, 52, 95, /* 0x22f0 */ 32, 32, 86, 65, 76, 85, 69, 10, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x2300 */ 80, 67, 51, 50, 32, 32, 32, 32, 32, 78, 82, 86, 95, 72, 69, 65, /* 0x2300 */ 48, 48, 48, 48, 48, 48, 57, 53, 32, 82, 95, 88, 56, 54, 95, 54,
/* 0x2310 */ 68, 43, 48,120, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x2310 */ 52, 95, 80, 67, 51, 50, 32, 32, 32, 32, 32, 78, 82, 86, 95, 72,
/* 0x2320 */ 48, 48, 50, 49, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, /* 0x2320 */ 69, 65, 68, 43, 48,120, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x2330 */ 48, 48, 48, 53, 98, 32, 82, 95, 88, 56, 54, 95, 54, 52, 95, 80, /* 0x2330 */ 48, 48, 48, 48, 50, 49, 10, 48, 48, 48, 48, 48, 48, 48, 48, 48,
/* 0x2340 */ 67, 51, 50, 32, 32, 32, 32, 32, 69, 76, 70, 77, 65, 73, 78, 89, /* 0x2340 */ 48, 48, 48, 48, 48, 53, 98, 32, 82, 95, 88, 56, 54, 95, 54, 52,
/* 0x2350 */ 43, 48,120,102,102,102,102,102,102,102,102,102,102,102,102,102, /* 0x2350 */ 95, 80, 67, 51, 50, 32, 32, 32, 32, 32, 69, 76, 70, 77, 65, 73,
/* 0x2360 */ 102,102, 99, 10, 10, 82, 69, 76, 79, 67, 65, 84, 73, 79, 78, 32, /* 0x2360 */ 78, 89, 43, 48,120,102,102,102,102,102,102,102,102,102,102,102,
/* 0x2370 */ 82, 69, 67, 79, 82, 68, 83, 32, 70, 79, 82, 32, 91, 78, 82, 86, /* 0x2370 */ 102,102,102,102, 99, 10, 10, 82, 69, 76, 79, 67, 65, 84, 73, 79,
/* 0x2380 */ 50, 66, 93, 58, 10, 79, 70, 70, 83, 69, 84, 32, 32, 32, 32, 32, /* 0x2380 */ 78, 32, 82, 69, 67, 79, 82, 68, 83, 32, 70, 79, 82, 32, 91, 78,
/* 0x2390 */ 32, 32, 32, 32, 32, 32, 84, 89, 80, 69, 32, 32, 32, 32, 32, 32, /* 0x2390 */ 82, 86, 50, 66, 93, 58, 10, 79, 70, 70, 83, 69, 84, 32, 32, 32,
/* 0x23a0 */ 32, 32, 32, 32, 32, 32, 32, 32, 86, 65, 76, 85, 69, 10, 48, 48, /* 0x23a0 */ 32, 32, 32, 32, 32, 32, 32, 32, 84, 89, 80, 69, 32, 32, 32, 32,
/* 0x23b0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, 97, 32, 82, /* 0x23b0 */ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 86, 65, 76, 85, 69, 10,
/* 0x23c0 */ 95, 88, 56, 54, 95, 54, 52, 95, 80, 67, 51, 50, 32, 32, 32, 32, /* 0x23c0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, 97,
/* 0x23d0 */ 32, 78, 82, 86, 95, 72, 69, 65, 68, 43, 48,120, 48, 48, 48, 48, /* 0x23d0 */ 32, 82, 95, 88, 56, 54, 95, 54, 52, 95, 80, 67, 51, 50, 32, 32,
/* 0x23e0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 50, 49, 10, 48, 48, 48, /* 0x23e0 */ 32, 32, 32, 78, 82, 86, 95, 72, 69, 65, 68, 43, 48,120, 48, 48,
/* 0x23f0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 53, 50, 32, 82, 95, /* 0x23f0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 50, 49, 10, 48,
/* 0x2400 */ 88, 56, 54, 95, 54, 52, 95, 80, 67, 51, 50, 32, 32, 32, 32, 32, /* 0x2400 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 53, 50, 32,
/* 0x2410 */ 69, 76, 70, 77, 65, 73, 78, 89, 43, 48,120,102,102,102,102,102, /* 0x2410 */ 82, 95, 88, 56, 54, 95, 54, 52, 95, 80, 67, 51, 50, 32, 32, 32,
/* 0x2420 */ 102,102,102,102,102,102,102,102,102,102, 99, 10, 10, 82, 69, 76, /* 0x2420 */ 32, 32, 69, 76, 70, 77, 65, 73, 78, 89, 43, 48,120,102,102,102,
/* 0x2430 */ 79, 67, 65, 84, 73, 79, 78, 32, 82, 69, 67, 79, 82, 68, 83, 32, /* 0x2430 */ 102,102,102,102,102,102,102,102,102,102,102,102, 99, 10, 10, 82,
/* 0x2440 */ 70, 79, 82, 32, 91, 76, 90, 77, 65, 95, 69, 76, 70, 48, 48, 93, /* 0x2440 */ 69, 76, 79, 67, 65, 84, 73, 79, 78, 32, 82, 69, 67, 79, 82, 68,
/* 0x2450 */ 58, 10, 79, 70, 70, 83, 69, 84, 32, 32, 32, 32, 32, 32, 32, 32, /* 0x2450 */ 83, 32, 70, 79, 82, 32, 91, 76, 90, 77, 65, 95, 69, 76, 70, 48,
/* 0x2460 */ 32, 32, 32, 84, 89, 80, 69, 32, 32, 32, 32, 32, 32, 32, 32, 32, /* 0x2460 */ 48, 93, 58, 10, 79, 70, 70, 83, 69, 84, 32, 32, 32, 32, 32, 32,
/* 0x2470 */ 32, 32, 32, 32, 32, 86, 65, 76, 85, 69, 10, 48, 48, 48, 48, 48, /* 0x2470 */ 32, 32, 32, 32, 32, 84, 89, 80, 69, 32, 32, 32, 32, 32, 32, 32,
/* 0x2480 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 54, 32, 82, 95, 88, 56, /* 0x2480 */ 32, 32, 32, 32, 32, 32, 32, 86, 65, 76, 85, 69, 10, 48, 48, 48,
/* 0x2490 */ 54, 95, 54, 52, 95, 80, 67, 51, 50, 32, 32, 32, 32, 32, 76, 90, /* 0x2490 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 54, 32, 82, 95,
/* 0x24a0 */ 77, 65, 95, 68, 69, 67, 51, 48, 43, 48,120, 48, 48, 48, 48, 48, /* 0x24a0 */ 88, 56, 54, 95, 54, 52, 95, 80, 67, 51, 50, 32, 32, 32, 32, 32,
/* 0x24b0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 49, 48, 10, 10, 82, 69, 76, /* 0x24b0 */ 76, 90, 77, 65, 95, 68, 69, 67, 51, 48, 43, 48,120, 48, 48, 48,
/* 0x24c0 */ 79, 67, 65, 84, 73, 79, 78, 32, 82, 69, 67, 79, 82, 68, 83, 32, /* 0x24c0 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 49, 48, 10, 10, 82,
/* 0x24d0 */ 70, 79, 82, 32, 91, 69, 76, 70, 77, 65, 73, 78, 89, 93, 58, 10, /* 0x24d0 */ 69, 76, 79, 67, 65, 84, 73, 79, 78, 32, 82, 69, 67, 79, 82, 68,
/* 0x24e0 */ 79, 70, 70, 83, 69, 84, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, /* 0x24e0 */ 83, 32, 70, 79, 82, 32, 91, 69, 76, 70, 77, 65, 73, 78, 89, 93,
/* 0x24f0 */ 32, 84, 89, 80, 69, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, /* 0x24f0 */ 58, 10, 79, 70, 70, 83, 69, 84, 32, 32, 32, 32, 32, 32, 32, 32,
/* 0x2500 */ 32, 32, 32, 86, 65, 76, 85, 69, 10, 48, 48, 48, 48, 48, 48, 48, /* 0x2500 */ 32, 32, 32, 84, 89, 80, 69, 32, 32, 32, 32, 32, 32, 32, 32, 32,
/* 0x2510 */ 48, 48, 48, 48, 48, 48, 48, 49, 56, 32, 82, 95, 88, 56, 54, 95, /* 0x2510 */ 32, 32, 32, 32, 32, 86, 65, 76, 85, 69, 10, 48, 48, 48, 48, 48,
/* 0x2520 */ 54, 52, 95, 80, 67, 51, 50, 32, 32, 32, 32, 32, 69, 76, 70, 77, /* 0x2520 */ 48, 48, 48, 48, 48, 48, 48, 48, 48, 49, 56, 32, 82, 95, 88, 56,
/* 0x2530 */ 65, 73, 78, 90, 43, 48,120,102,102,102,102,102,102,102,102,102, /* 0x2530 */ 54, 95, 54, 52, 95, 80, 67, 51, 50, 32, 32, 32, 32, 32, 69, 76,
/* 0x2540 */ 102,102,102,102,102,102, 99, 10 /* 0x2540 */ 70, 77, 65, 73, 78, 90, 43, 48,120,102,102,102,102,102,102,102,
/* 0x2550 */ 102,102,102,102,102,102,102,102, 99, 10
}; };

View File

@ -32,8 +32,8 @@
#define STUB_ARM_LINUX_SHLIB_INIT_SIZE 15566 #define STUB_ARM_LINUX_SHLIB_INIT_SIZE 15566
#define STUB_ARM_LINUX_SHLIB_INIT_ADLER32 0x0dc6189d #define STUB_ARM_LINUX_SHLIB_INIT_ADLER32 0x0dc418a9
#define STUB_ARM_LINUX_SHLIB_INIT_CRC32 0x9fc4eb06 #define STUB_ARM_LINUX_SHLIB_INIT_CRC32 0x8076f24a
unsigned char stub_arm_linux_shlib_init[15566] = { unsigned char stub_arm_linux_shlib_init[15566] = {
/* 0x0000 */ 127, 69, 76, 70, 1, 1, 1, 97, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x0000 */ 127, 69, 76, 70, 1, 1, 1, 97, 0, 0, 0, 0, 0, 0, 0, 0,
@ -326,7 +326,7 @@ unsigned char stub_arm_linux_shlib_init[15566] = {
/* 0x11f0 */ 10, 0, 14, 32,160,225, 32, 16, 66,226, 1, 80,160,225, 4, 64, /* 0x11f0 */ 10, 0, 14, 32,160,225, 32, 16, 66,226, 1, 80,160,225, 4, 64,
/* 0x1200 */ 145,228, 4, 80, 69,224, 4, 64,145,228, 4, 64,133,224, 36, 64, /* 0x1200 */ 145,228, 4, 80, 69,224, 4, 64,145,228, 4, 64,133,224, 36, 64,
/* 0x1210 */ 139,229, 4, 64,145,228, 4, 64,133,224, 4, 64, 45,229, 4, 64, /* 0x1210 */ 139,229, 4, 64,145,228, 4, 64,133,224, 4, 64, 45,229, 4, 64,
/* 0x1220 */ 145,228, 4, 0,133,224, 12, 16,128,226, 8,208, 77,226, 4, 64, /* 0x1220 */ 145,228, 4, 0,133,224, 24, 16,128,226, 8,208, 77,226, 4, 64,
/* 0x1230 */ 145,229, 12, 16,129,226, 4, 16,129,224,168, 0, 0,235, 0, 90, /* 0x1230 */ 145,229, 12, 16,129,226, 4, 16,129,224,168, 0, 0,235, 0, 90,
/* 0x1240 */ 160,225, 37, 91,160,225, 5, 65,132,224, 4, 64, 45,229, 5, 1, /* 0x1240 */ 160,225, 37, 91,160,225, 5, 65,132,224, 4, 64, 45,229, 5, 1,
/* 0x1250 */ 64,224, 4, 0, 45,229, 5, 65, 68,224, 5, 1,128,224, 4, 80, /* 0x1250 */ 64,224, 4, 0, 45,229, 5, 65, 68,224, 5, 1,128,224, 4, 80,

View File

@ -32,8 +32,8 @@
#define STUB_ARMEL_EABI_LINUX_SHLIB_INIT_SIZE 15670 #define STUB_ARMEL_EABI_LINUX_SHLIB_INIT_SIZE 15670
#define STUB_ARMEL_EABI_LINUX_SHLIB_INIT_ADLER32 0x347647eb #define STUB_ARMEL_EABI_LINUX_SHLIB_INIT_ADLER32 0x35f447f7
#define STUB_ARMEL_EABI_LINUX_SHLIB_INIT_CRC32 0x1956494f #define STUB_ARMEL_EABI_LINUX_SHLIB_INIT_CRC32 0x6b0fd042
unsigned char stub_armel_eabi_linux_shlib_init[15670] = { unsigned char stub_armel_eabi_linux_shlib_init[15670] = {
/* 0x0000 */ 127, 69, 76, 70, 1, 1, 1, 97, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x0000 */ 127, 69, 76, 70, 1, 1, 1, 97, 0, 0, 0, 0, 0, 0, 0, 0,
@ -330,7 +330,7 @@ unsigned char stub_armel_eabi_linux_shlib_init[15670] = {
/* 0x1230 */ 32,102, 97,105,108,101,100, 46, 10, 0, 14, 32,160,225, 32, 16, /* 0x1230 */ 32,102, 97,105,108,101,100, 46, 10, 0, 14, 32,160,225, 32, 16,
/* 0x1240 */ 66,226, 1, 80,160,225, 4, 64,145,228, 4, 80, 69,224, 4, 64, /* 0x1240 */ 66,226, 1, 80,160,225, 4, 64,145,228, 4, 80, 69,224, 4, 64,
/* 0x1250 */ 145,228, 4, 64,133,224, 36, 64,139,229, 4, 64,145,228, 4, 64, /* 0x1250 */ 145,228, 4, 64,133,224, 36, 64,139,229, 4, 64,145,228, 4, 64,
/* 0x1260 */ 133,224, 4, 64, 45,229, 4, 64,145,228, 4, 0,133,224, 12, 16, /* 0x1260 */ 133,224, 4, 64, 45,229, 4, 64,145,228, 4, 0,133,224, 24, 16,
/* 0x1270 */ 128,226, 8,208, 77,226, 4, 64,145,229, 12, 16,129,226, 4, 16, /* 0x1270 */ 128,226, 8,208, 77,226, 4, 64,145,229, 12, 16,129,226, 4, 16,
/* 0x1280 */ 129,224,176, 0, 0,235, 0, 90,160,225, 37, 91,160,225, 5, 65, /* 0x1280 */ 129,224,176, 0, 0,235, 0, 90,160,225, 37, 91,160,225, 5, 65,
/* 0x1290 */ 132,224, 4, 64, 45,229, 5, 1, 64,224, 4, 0, 45,229, 5, 65, /* 0x1290 */ 132,224, 4, 64, 45,229, 5, 1, 64,224, 4, 0, 45,229, 5, 65,

File diff suppressed because it is too large Load Diff

View File

@ -72,7 +72,7 @@ M_NRV2E_LE32=8
// .long offset(.) // detect relocation // .long offset(.) // detect relocation
// .long offset(user DT_INIT) // .long offset(user DT_INIT)
// .long offset(escape_hatch) // .long offset(escape_hatch)
// .long offset({p_info; b_info; compressed data}) // .long offset({l_info; p_info; b_info; compressed data})
section ELFMAINX section ELFMAINX
_start: .globl _start _start: .globl _start
//// nop; int3; int3 //// nop; int3; int3
@ -255,8 +255,8 @@ main:
lodsl; sub %rax,%rcx; //mov %rcx,o_reloc(%rbp) lodsl; sub %rax,%rcx; //mov %rcx,o_reloc(%rbp)
lodsl; add %rcx,%rax; mov %rax,o_uinit(%rbp) // reloc DT_INIT for step 12 lodsl; add %rcx,%rax; mov %rax,o_uinit(%rbp) // reloc DT_INIT for step 12
lodsl; add %rcx,%rax; mov %rax,o_hatch(%rbp) // reloc &hatch for step 10 lodsl; add %rcx,%rax; mov %rax,o_hatch(%rbp) // reloc &hatch for step 10
lodsl; lea (%rcx,%rax),%rdi // &p_info; also destination for decompress lodsl; lea (%rcx,%rax),%rdi // &l_info; also destination for decompress
lea sz_p_info(%rdi),%rsi // &b_info lea sz_l_info+sz_p_info(%rdi),%rsi // &b_info
push %rax; push %rax // param space: munmap temp pages step 9 push %rax; push %rax // param space: munmap temp pages step 9
p_unmap= -2*8 p_unmap= -2*8
@ -326,6 +326,12 @@ supervise:
//p_unflt //p_unflt
pop %arg1 pop %arg1
pop %arg2 pop %arg2
lea (%arg1,%arg2),%rax
movl $0x5e5f050f, (%rax) // "syscall; pop %rdi; pop %rsi"
movb $0xc3,4(%rax) // "ret"
mov %rax,o_hatch(%rbp) // hatch beyond .text
pop %arg3 pop %arg3
pop %arg4 pop %arg4
pop %rax; pop %rax;

View File

@ -183,8 +183,8 @@ main:
lodsl; add eax,ecx,eax; str eax,[fp,#o_uinit] // reloc DT_INIT for step 12 lodsl; add eax,ecx,eax; str eax,[fp,#o_uinit] // reloc DT_INIT for step 12
lodsl; add eax,ecx,eax; push eax // reloc &hatch for step 10 lodsl; add eax,ecx,eax; push eax // reloc &hatch for step 10
o_hatch= -1*4 o_hatch= -1*4
lodsl; add edi,ecx,eax // &p_info; also destination for decompress lodsl; add edi,ecx,eax // &l_info; also destination for decompress
add esi,edi,#sz_p_info // &b_info add esi,edi,#sz_l_info + sz_p_info // &b_info
sub sp,sp,#2*4 // param space: munmap temp pages step 9 sub sp,sp,#2*4 // param space: munmap temp pages step 9
p_unmap= -3*4 p_unmap= -3*4

View File

@ -133,6 +133,7 @@ PAGE_MASK= -PAGE_SIZE // AND clears the offset within page
#define szElf32_Ehdr 0x34 #define szElf32_Ehdr 0x34
#define p_memsz 5*4 #define p_memsz 5*4
sz_p_info = 3*4 sz_p_info = 3*4
sz_l_info = 3*4
sz_b_info=3*4 sz_b_info=3*4
sz_unc= 0 sz_unc= 0
sz_cpr= 4 sz_cpr= 4
@ -181,9 +182,9 @@ main:
lodsd; sub ecx,eax; //mov [ebp+o_reloc],ecx lodsd; sub ecx,eax; //mov [ebp+o_reloc],ecx
lodsd; add eax,ecx; mov [ebp+o_uinit],eax // reloc DT_INIT for step 12 lodsd; add eax,ecx; mov [ebp+o_uinit],eax // reloc DT_INIT for step 12
lodsd; add eax,ecx; push eax // reloc &hatch for step 10 lodsd; add eax,ecx; push eax // reloc &hatch for step 10
o_hatch= -1*4 p_hatch= -1*4
lodsd; add eax,ecx; xchg eax,edi // &p_info; also destination for decompress lodsd; add eax,ecx; xchg eax,edi // &l_info; also destination for decompress
lea esi,[edi + sz_p_info] // &b_info lea esi,[edi + sz_l_info + sz_p_info] // &b_info
push eax; push eax // param space: munmap temp pages step 9 push eax; push eax // param space: munmap temp pages step 9
p_unmap= -3*4 p_unmap= -3*4
@ -241,7 +242,14 @@ supervise:
rep movsd rep movsd
call [ebp+o_uncpr] // decompress call [ebp+o_uncpr] // decompress
add esp,5*4 // remove params // decompression can overrun dst by 3 bytes on i386; construct hatch now
pop eax; pop eax // discard src, srclen
pop eax // dst
pop ecx // &dstlen
pop edx // discard method,filter,cto,junk
add eax,[ecx] // dst += dstlen
mov [dword ptr eax],0xc36180cd // "int 0x80; popa; ret"
mov [esp + p_hatch - o_uncpr],eax // hatch at end of .text
//o_uncpr //o_uncpr
pop eax // &decompress pop eax // &decompress
//p_unflt //p_unflt
@ -258,6 +266,7 @@ supervise:
pop ebx // &temp pages pop ebx // &temp pages
pop ecx // length pop ecx // length
push __NR_munmap; pop eax push __NR_munmap; pop eax
//p_hatch
ret // goto escape hatch ret // goto escape hatch
//hatch: //hatch:
int 0x80 // munmap temporary pages int 0x80 // munmap temporary pages

View File

@ -13,7 +13,7 @@ Idx Name Size VMA LMA File off Algn
8 LZMA_DEC30 00000014 0000000000000000 0000000000000000 000016f3 2**0 CONTENTS, READONLY 8 LZMA_DEC30 00000014 0000000000000000 0000000000000000 000016f3 2**0 CONTENTS, READONLY
9 NRV_TAIL 00000000 0000000000000000 0000000000000000 00001707 2**0 CONTENTS, READONLY 9 NRV_TAIL 00000000 0000000000000000 0000000000000000 00001707 2**0 CONTENTS, READONLY
10 ELFMAINY 0000003a 0000000000000000 0000000000000000 00001707 2**0 CONTENTS, RELOC, READONLY 10 ELFMAINY 0000003a 0000000000000000 0000000000000000 00001707 2**0 CONTENTS, RELOC, READONLY
11 ELFMAINZ 000001a9 0000000000000000 0000000000000000 00001741 2**0 CONTENTS, READONLY 11 ELFMAINZ 000001bb 0000000000000000 0000000000000000 00001741 2**0 CONTENTS, READONLY
SYMBOL TABLE: SYMBOL TABLE:
0000000000000000 l d NRV_HEAD 0000000000000000 NRV_HEAD 0000000000000000 l d NRV_HEAD 0000000000000000 NRV_HEAD
0000000000000000 l d LZMA_DEC30 0000000000000000 LZMA_DEC30 0000000000000000 l d LZMA_DEC30 0000000000000000 LZMA_DEC30

View File

@ -169,11 +169,11 @@ Idx Name Size VMA LMA File off Algn Flags
164 ctok32.30 00000007 00000000 00000000 00001aae 2**0 CONTENTS, RELOC, READONLY 164 ctok32.30 00000007 00000000 00000000 00001aae 2**0 CONTENTS, RELOC, READONLY
165 ctok32.40 00000005 00000000 00000000 00001ab5 2**0 CONTENTS, RELOC, READONLY 165 ctok32.40 00000005 00000000 00000000 00001ab5 2**0 CONTENTS, RELOC, READONLY
166 LEXEC017 00000002 00000000 00000000 00001aba 2**0 CONTENTS, READONLY 166 LEXEC017 00000002 00000000 00000000 00001aba 2**0 CONTENTS, READONLY
167 LEXEC020 0000013a 00000000 00000000 00001abc 2**0 CONTENTS, READONLY 167 LEXEC020 00000148 00000000 00000000 00001abc 2**0 CONTENTS, READONLY
168 LUNMP000 00000000 00000000 00000000 00001bf6 2**0 CONTENTS, READONLY 168 LUNMP000 00000000 00000000 00000000 00001c04 2**0 CONTENTS, READONLY
169 LUNMP001 00000000 00000000 00000000 00001bf6 2**0 CONTENTS, READONLY 169 LUNMP001 00000000 00000000 00000000 00001c04 2**0 CONTENTS, READONLY
170 LEXEC025 00000000 00000000 00000000 00001bf6 2**0 CONTENTS, READONLY 170 LEXEC025 00000000 00000000 00000000 00001c04 2**0 CONTENTS, READONLY
171 LEXECDYN 00000000 00000000 00000000 00001bf6 2**0 CONTENTS, READONLY 171 LEXECDYN 00000000 00000000 00000000 00001c04 2**0 CONTENTS, READONLY
SYMBOL TABLE: SYMBOL TABLE:
00000000 l d N2BSMA10 00000000 N2BSMA10 00000000 l d N2BSMA10 00000000 N2BSMA10
00000000 l d N2BFAS11 00000000 N2BFAS11 00000000 l d N2BFAS11 00000000 N2BFAS11