mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
workaround linux bug which demands writeable PT_LOAD for .bss
This commit is contained in:
parent
6135d61e3d
commit
ec9d6c4fd2
|
@ -84,6 +84,27 @@ const int *PackLinuxI386::getFilters() const
|
|||
return filters;
|
||||
}
|
||||
|
||||
static void
|
||||
set_stub_brk(Elf_LE32_Phdr *const phdr1, unsigned brka)
|
||||
{
|
||||
#define PAGE_MASK (~0ul<<12)
|
||||
// linux-2.6.14 binfmt_elf.c: SIGKILL if (0==.p_memsz) on a page boundary
|
||||
unsigned const brkb = brka | ((0==(~PAGE_MASK & brka)) ? 0x20 : 0);
|
||||
phdr1->p_type = PT_LOAD; // be sure
|
||||
phdr1->p_offset = ~PAGE_MASK & brkb;
|
||||
phdr1->p_vaddr = brkb;
|
||||
phdr1->p_paddr = brkb;
|
||||
phdr1->p_filesz = 0;
|
||||
phdr1->p_memsz = 0;
|
||||
if (0==phdr1->p_flags) {
|
||||
phdr1->p_flags = Elf32_Phdr::PF_R|Elf32_Phdr::PF_W;
|
||||
}
|
||||
if (0==phdr1->p_align) {
|
||||
phdr1->p_align = 0x1000;
|
||||
}
|
||||
#undef PAGE_MASK
|
||||
}
|
||||
|
||||
void
|
||||
PackLinuxI386::generateElfHdr(
|
||||
OutputFile *fo,
|
||||
|
@ -91,7 +112,6 @@ PackLinuxI386::generateElfHdr(
|
|||
unsigned const brka
|
||||
)
|
||||
{
|
||||
cprElfHdr1 *const h1 = (cprElfHdr1 *)&elfout;
|
||||
cprElfHdr2 *const h2 = (cprElfHdr2 *)&elfout;
|
||||
cprElfHdr3 *const h3 = (cprElfHdr3 *)&elfout;
|
||||
memcpy(h3, proto, sizeof(*h3)); // reads beyond, but OK
|
||||
|
@ -111,32 +131,17 @@ PackLinuxI386::generateElfHdr(
|
|||
|
||||
// Info for OS kernel to set the brk()
|
||||
if (brka) {
|
||||
#define PAGE_MASK (~0ul<<12)
|
||||
// linux-2.6.14 binfmt_elf.c: SIGKILL if (0==.p_memsz) on a page boundary
|
||||
unsigned const brkb = brka | ((0==(~PAGE_MASK & brka)) ? 0x20 : 0);
|
||||
h2->phdr[1].p_type = PT_LOAD; // be sure
|
||||
h2->phdr[1].p_offset = ~PAGE_MASK & brkb;
|
||||
h2->phdr[1].p_vaddr = brkb;
|
||||
h2->phdr[1].p_paddr = brkb;
|
||||
h2->phdr[1].p_filesz = 0;
|
||||
h2->phdr[1].p_memsz = 0;
|
||||
if (0==h2->phdr[1].p_flags) {
|
||||
h2->phdr[1].p_flags = Elf32_Phdr::PF_R|Elf32_Phdr::PF_W;
|
||||
}
|
||||
if (0==h2->phdr[1].p_align) {
|
||||
h2->phdr[1].p_align = 0x1000;
|
||||
}
|
||||
#undef PAGE_MASK
|
||||
set_stub_brk(&h2->phdr[1], brka);
|
||||
}
|
||||
|
||||
if (ph.format==UPX_F_LINUX_i386 ) {
|
||||
assert(h1->ehdr.e_phnum==1);
|
||||
memset(&h1->linfo, 0, sizeof(h1->linfo));
|
||||
fo->write(h1, sizeof(*h1));
|
||||
}
|
||||
else if (ph.format==UPX_F_LINUX_SH_i386) {
|
||||
assert(h2->ehdr.e_phnum==1);
|
||||
h2->ehdr.e_phnum = 1;
|
||||
if (ph.format==UPX_F_LINUX_i386
|
||||
|| ph.format==UPX_F_LINUX_SH_i386 ) {
|
||||
// SELinux, PAx, grSecurity demand no PF_W if PF_X.
|
||||
// kernel-2.6.12-2.3.legacy_FC3 has a bug which demands
|
||||
// a PT_LOAD with PF_W, else SIGSEGV when clearing page fragment
|
||||
// on low page of ".bss", which is the high page of .text.
|
||||
// So the minimum number of PT_LOAD is 2.
|
||||
assert(h2->ehdr.e_phnum==2);
|
||||
memset(&h2->linfo, 0, sizeof(h2->linfo));
|
||||
fo->write(h2, sizeof(*h2));
|
||||
}
|
||||
|
@ -166,9 +171,11 @@ PackLinuxI386::pack4(OutputFile *fo, Filter &ft)
|
|||
(elfout.ehdr.e_phentsize * elfout.ehdr.e_phnum) +
|
||||
sizeof(l_info) +
|
||||
((elfout.ehdr.e_phnum==3) ? (unsigned) elfout.phdr[2].p_memsz : 0) ;
|
||||
elfout.phdr[0].p_filesz = fo->getBytesWritten();
|
||||
unsigned nw = fo->getBytesWritten();
|
||||
elfout.phdr[0].p_filesz = nw;
|
||||
nw = -(-elfout.phdr[0].p_align & -nw); // ALIGN_UP
|
||||
super::pack4(fo, ft); // write PackHeader and overlay_offset
|
||||
|
||||
set_stub_brk(&elfout.phdr[1], nw + elfout.phdr[0].p_vaddr);
|
||||
|
||||
#if 0 // {
|
||||
// /usr/bin/strip from RedHat 8.0 (binutils-2.13.90.0.2-2)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* i386-linux.elf.execve-fold.h -- created from i386-linux.elf.execve-fold.bin, 899 (0x383) bytes
|
||||
/* i386-linux.elf.execve-fold.h -- created from i386-linux.elf.execve-fold.bin, 931 (0x3a3) bytes
|
||||
|
||||
This file is part of the UPX executable compressor.
|
||||
|
||||
|
@ -27,66 +27,68 @@
|
|||
*/
|
||||
|
||||
|
||||
#define LINUX_I386EXEC_FOLD_SIZE 899
|
||||
#define LINUX_I386EXEC_FOLD_ADLER32 0x53147681
|
||||
#define LINUX_I386EXEC_FOLD_CRC32 0x480dc20f
|
||||
#define LINUX_I386EXEC_FOLD_SIZE 931
|
||||
#define LINUX_I386EXEC_FOLD_ADLER32 0x488877dc
|
||||
#define LINUX_I386EXEC_FOLD_CRC32 0x399780ea
|
||||
|
||||
unsigned char linux_i386exec_fold[899] = {
|
||||
unsigned char linux_i386exec_fold[931] = {
|
||||
127, 69, 76, 70, 1, 1, 1, 0, 76,105,110,117,120, 0, 0, 0, /* 0x 0 */
|
||||
2, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, /* 0x 10 */
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 1, 0, 0, 0, /* 0x 20 */
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 2, 0, 0, 0, /* 0x 20 */
|
||||
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 16, 64, 0, /* 0x 30 */
|
||||
0, 16, 64, 0,131, 3, 0, 0,132, 3, 0, 0, 5, 0, 0, 0, /* 0x 40 */
|
||||
0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 50 */
|
||||
88,137,225,141, 84,132, 4,139,123, 24,141,115, 96, 41,247,141, /* 0x 60 */
|
||||
93, 2, 96,232,199, 0, 0, 0,244, 83,141, 92, 36, 8,106, 90, /* 0x 70 */
|
||||
88,205,128, 91,195, 0, 0, 0, 83,137,195,139, 76, 36, 8,136, /* 0x 80 */
|
||||
208,131,224, 31, 60, 25,118, 3,131,232, 43,131,192, 65, 75,136, /* 0x 90 */
|
||||
3,137,208,193,232, 5,137,194,226,229, 91,195, 85, 49,201,137, /* 0x a0 */
|
||||
229, 87, 86,137,202, 83,131,236, 44,139, 93, 8,106, 5, 88,205, /* 0x b0 */
|
||||
128,133,192,137,198,120,108,199, 69,212, 47,112,114,111,199, 69, /* 0x c0 */
|
||||
216, 99, 47, 0, 0,106, 20, 88,205,128,141, 85,218,141,125,212, /* 0x d0 */
|
||||
232,123, 2, 0, 0,141, 80, 4,137,251,199, 0, 47,102,100, 47, /* 0x e0 */
|
||||
137,240,232,105, 2, 0, 0,186, 1, 0, 0, 0,106, 33, 88,106, /* 0x f0 */
|
||||
5, 89,205,128, 61, 85, 80, 88, 50,117, 33,139, 93, 8,106, 10, /* 0x 100 */
|
||||
88,205,128,185, 2, 0, 0, 0,137,243,106, 55, 88,205,128,137, /* 0x 110 */
|
||||
251,139, 77, 12,139, 85, 16,106, 11, 88,205,128,137,243,106, 6, /* 0x 120 */
|
||||
88,205,128,131,196, 44,137,240, 91, 94, 95,201,194, 12, 0, 85, /* 0x 130 */
|
||||
137,229, 87, 86, 83,131,236,124,141,125,228,139, 69, 16,139,117, /* 0x 140 */
|
||||
12,137, 69,156,165,165,165,131,109, 8, 12,129,125,228, 85, 80, /* 0x 150 */
|
||||
88, 51,137,117, 12, 15,133,112, 1, 0, 0,199, 69,196, 47,116, /* 0x 160 */
|
||||
109,112,199, 69,200, 47,117,112,120,141, 77,215,106, 20, 88,205, /* 0x 170 */
|
||||
128,137,194,106, 4,137,200,141,125,211,232,249,254,255,255,139, /* 0x 180 */
|
||||
85,228,198, 69,215, 0, 49,201, 49,208,141, 93,172,137, 69,132, /* 0x 190 */
|
||||
106, 78, 88,205,128,139, 85,172,137,248, 49, 85,132,139, 85,176, /* 0x 1a0 */
|
||||
199, 4, 36, 7, 0, 0, 0,141, 93,196,193,226, 12, 51, 85,132, /* 0x 1b0 */
|
||||
232,195,254,255,255, 88,106, 10, 88,205,128,131,248,254,116, 8, /* 0x 1c0 */
|
||||
133,192, 15,133, 3, 1, 0, 0,185,194, 0, 0, 0,186,192, 1, /* 0x 1d0 */
|
||||
0, 0,141, 93,196,106, 5, 88,205,128,139, 85,232,137, 69,148, /* 0x 1e0 */
|
||||
137,195,137,209,106, 93, 88,205,128,133,192, 15,133,210, 0, 0, /* 0x 1f0 */
|
||||
0,106, 0,255,117,148,106, 1,106, 3, 82,106, 0,232,103,254, /* 0x 200 */
|
||||
255,255,131,196, 24, 61, 0,240,255,255,137, 69,136, 15,135,176, /* 0x 210 */
|
||||
0, 0, 0,139, 69,232,106, 0,106,255, 5,255, 15, 0, 0,106, /* 0x 220 */
|
||||
50, 37, 0,240,255,255,106, 3, 3, 69,136,104, 0, 16, 0, 0, /* 0x 230 */
|
||||
80,232, 51,254,255,255,131,196, 24,141,125,180,139,117, 12,165, /* 0x 240 */
|
||||
165,165,139, 77,180,131,109, 8, 12,133,201,137,117, 12,139, 85, /* 0x 250 */
|
||||
184,117, 16,129,250, 85, 80, 88, 33,117,104,131,125,232, 0,116, /* 0x 260 */
|
||||
116,235, 96, 57,202,119, 92, 59, 85,236,119, 87, 57,202,115, 37, /* 0x 270 */
|
||||
141, 69,168,255,117,188, 80,255,117,136, 82,255,117, 12,137, 77, /* 0x 280 */
|
||||
168,255, 85,156,131,196, 20,133,192,117, 56,139, 69,180, 57, 69, /* 0x 290 */
|
||||
168,117, 48,235, 8,139,125,136,139,117, 12,243,164,139, 85,180, /* 0x 2a0 */
|
||||
139, 93,136,137,209,106, 91, 88,205,128,139, 69,184, 41, 69, 8, /* 0x 2b0 */
|
||||
1, 85,136, 41, 85,232, 1, 69, 12,131,125, 8, 0, 15,137,118, /* 0x 2c0 */
|
||||
255,255,255,141, 93,196,106, 10, 88,205,128,106,127, 91,106, 1, /* 0x 2d0 */
|
||||
88,205,128,235,254,139, 93,148,106, 6, 88,205,128,133,192,117, /* 0x 2e0 */
|
||||
226,255,117, 28,255,117, 32,141,117,196, 86,232,172,253,255,255, /* 0x 2f0 */
|
||||
133,192,120,207,106, 2, 88,205,128,133,192,117, 51,106, 2, 88, /* 0x 300 */
|
||||
205,128,133,192,137,193,117, 31,199, 69,160, 85, 80, 88, 52,184, /* 0x 310 */
|
||||
162, 0, 0, 0,141, 93,160,199, 69,164, 0, 0, 0, 0,205,128, /* 0x 320 */
|
||||
137,243,106, 10, 88,205,128, 49,219,106, 1, 88,205,128,235,254, /* 0x 330 */
|
||||
49,201,131,203,255,137,202,106, 7, 88,205,128,141, 93,196,139, /* 0x 340 */
|
||||
77, 32,139, 85, 28,106, 11, 88,205,128,233,116,255,255,255, 0, /* 0x 350 */
|
||||
87,137,215,106, 10,252, 89,232, 5, 0, 0, 0,136, 39,151, 95, /* 0x 360 */
|
||||
195,153,247,241, 82,133,192,116, 5,232,243,255,255,255, 88, 4, /* 0x 370 */
|
||||
48,170,195 /* 0x 380 */
|
||||
0, 16, 64, 0,163, 3, 0, 0,164, 3, 0, 0, 5, 0, 0, 0, /* 0x 40 */
|
||||
0, 16, 0, 0, 1, 0, 0, 0,163, 3, 0, 0, 0, 0, 0, 0, /* 0x 50 */
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 60 */
|
||||
0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 70 */
|
||||
88,137,225,141, 84,132, 4,139,123, 24,141,179,128, 0, 0, 0, /* 0x 80 */
|
||||
41,247,141, 93, 2, 96,232,196, 0, 0, 0,244, 83,141, 92, 36, /* 0x 90 */
|
||||
8,106, 90, 88,205,128, 91,195, 83,137,195,139, 76, 36, 8,136, /* 0x a0 */
|
||||
208,131,224, 31, 60, 25,118, 3,131,232, 43,131,192, 65, 75,136, /* 0x b0 */
|
||||
3,137,208,193,232, 5,137,194,226,229, 91,195, 85, 49,201,137, /* 0x c0 */
|
||||
229, 87, 86,137,202, 83,131,236, 44,139, 93, 8,106, 5, 88,205, /* 0x d0 */
|
||||
128,133,192,137,198,120,108,199, 69,212, 47,112,114,111,199, 69, /* 0x e0 */
|
||||
216, 99, 47, 0, 0,106, 20, 88,205,128,141, 85,218,141,125,212, /* 0x f0 */
|
||||
232,123, 2, 0, 0,141, 80, 4,137,251,199, 0, 47,102,100, 47, /* 0x 100 */
|
||||
137,240,232,105, 2, 0, 0,186, 1, 0, 0, 0,106, 33, 88,106, /* 0x 110 */
|
||||
5, 89,205,128, 61, 85, 80, 88, 50,117, 33,139, 93, 8,106, 10, /* 0x 120 */
|
||||
88,205,128,185, 2, 0, 0, 0,137,243,106, 55, 88,205,128,137, /* 0x 130 */
|
||||
251,139, 77, 12,139, 85, 16,106, 11, 88,205,128,137,243,106, 6, /* 0x 140 */
|
||||
88,205,128,131,196, 44,137,240, 91, 94, 95,201,194, 12, 0, 85, /* 0x 150 */
|
||||
137,229, 87, 86, 83,131,236,124,141,125,228,139, 69, 16,139,117, /* 0x 160 */
|
||||
12,137, 69,156,165,165,165,131,109, 8, 12,129,125,228, 85, 80, /* 0x 170 */
|
||||
88, 51,137,117, 12, 15,133,112, 1, 0, 0,199, 69,196, 47,116, /* 0x 180 */
|
||||
109,112,199, 69,200, 47,117,112,120,141, 77,215,106, 20, 88,205, /* 0x 190 */
|
||||
128,137,194,106, 4,137,200,141,125,211,232,249,254,255,255,139, /* 0x 1a0 */
|
||||
85,228,198, 69,215, 0, 49,201, 49,208,141, 93,172,137, 69,132, /* 0x 1b0 */
|
||||
106, 78, 88,205,128,139, 85,172,137,248, 49, 85,132,139, 85,176, /* 0x 1c0 */
|
||||
199, 4, 36, 7, 0, 0, 0,141, 93,196,193,226, 12, 51, 85,132, /* 0x 1d0 */
|
||||
232,195,254,255,255, 88,106, 10, 88,205,128,131,248,254,116, 8, /* 0x 1e0 */
|
||||
133,192, 15,133, 3, 1, 0, 0,185,194, 0, 0, 0,186,192, 1, /* 0x 1f0 */
|
||||
0, 0,141, 93,196,106, 5, 88,205,128,139, 85,232,137, 69,148, /* 0x 200 */
|
||||
137,195,137,209,106, 93, 88,205,128,133,192, 15,133,210, 0, 0, /* 0x 210 */
|
||||
0,106, 0,255,117,148,106, 1,106, 3, 82,106, 0,232,106,254, /* 0x 220 */
|
||||
255,255,131,196, 24, 61, 0,240,255,255,137, 69,136, 15,135,176, /* 0x 230 */
|
||||
0, 0, 0,139, 69,232,106, 0,106,255, 5,255, 15, 0, 0,106, /* 0x 240 */
|
||||
50, 37, 0,240,255,255,106, 3, 3, 69,136,104, 0, 16, 0, 0, /* 0x 250 */
|
||||
80,232, 54,254,255,255,131,196, 24,141,125,180,139,117, 12,165, /* 0x 260 */
|
||||
165,165,139, 77,180,131,109, 8, 12,133,201,137,117, 12,139, 85, /* 0x 270 */
|
||||
184,117, 16,129,250, 85, 80, 88, 33,117,104,131,125,232, 0,116, /* 0x 280 */
|
||||
116,235, 96, 57,202,119, 92, 59, 85,236,119, 87, 57,202,115, 37, /* 0x 290 */
|
||||
141, 69,168,255,117,188, 80,255,117,136, 82,255,117, 12,137, 77, /* 0x 2a0 */
|
||||
168,255, 85,156,131,196, 20,133,192,117, 56,139, 69,180, 57, 69, /* 0x 2b0 */
|
||||
168,117, 48,235, 8,139,125,136,139,117, 12,243,164,139, 85,180, /* 0x 2c0 */
|
||||
139, 93,136,137,209,106, 91, 88,205,128,139, 69,184, 41, 69, 8, /* 0x 2d0 */
|
||||
1, 85,136, 41, 85,232, 1, 69, 12,131,125, 8, 0, 15,137,118, /* 0x 2e0 */
|
||||
255,255,255,141, 93,196,106, 10, 88,205,128,106,127, 91,106, 1, /* 0x 2f0 */
|
||||
88,205,128,235,254,139, 93,148,106, 6, 88,205,128,133,192,117, /* 0x 300 */
|
||||
226,255,117, 28,255,117, 32,141,117,196, 86,232,172,253,255,255, /* 0x 310 */
|
||||
133,192,120,207,106, 2, 88,205,128,133,192,117, 51,106, 2, 88, /* 0x 320 */
|
||||
205,128,133,192,137,193,117, 31,199, 69,160, 85, 80, 88, 52,184, /* 0x 330 */
|
||||
162, 0, 0, 0,141, 93,160,199, 69,164, 0, 0, 0, 0,205,128, /* 0x 340 */
|
||||
137,243,106, 10, 88,205,128, 49,219,106, 1, 88,205,128,235,254, /* 0x 350 */
|
||||
49,201,131,203,255,137,202,106, 7, 88,205,128,141, 93,196,139, /* 0x 360 */
|
||||
77, 32,139, 85, 28,106, 11, 88,205,128,233,116,255,255,255, 0, /* 0x 370 */
|
||||
87,137,215,106, 10,252, 89,232, 5, 0, 0, 0,136, 39,151, 95, /* 0x 380 */
|
||||
195,153,247,241, 82,133,192,116, 5,232,243,255,255,255, 88, 4, /* 0x 390 */
|
||||
48,170,195 /* 0x 3a0 */
|
||||
};
|
||||
|
|
|
@ -28,18 +28,18 @@
|
|||
|
||||
|
||||
#define LINUX_I386SH_FOLD_SIZE 1194
|
||||
#define LINUX_I386SH_FOLD_ADLER32 0x276af84a
|
||||
#define LINUX_I386SH_FOLD_CRC32 0xd84cc9ea
|
||||
#define LINUX_I386SH_FOLD_ADLER32 0x63b3f90a
|
||||
#define LINUX_I386SH_FOLD_CRC32 0xe2bc019d
|
||||
|
||||
unsigned char linux_i386sh_fold[1194] = {
|
||||
127, 69, 76, 70, 1, 1, 1, 0, 76,105,110,117,120, 0, 0, 0, /* 0x 0 */
|
||||
2, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, /* 0x 10 */
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 1, 0, 0, 0, /* 0x 20 */
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 2, 0, 0, 0, /* 0x 20 */
|
||||
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 1, /* 0x 30 */
|
||||
0, 0, 64, 1,170, 4, 0, 0,172, 4, 0, 0, 5, 0, 0, 0, /* 0x 40 */
|
||||
0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 50 */
|
||||
0, 16, 0, 0, 1, 0, 0, 0,170, 4, 0, 0, 0, 0, 0, 0, /* 0x 50 */
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 60 */
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 70 */
|
||||
0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 70 */
|
||||
137,230,129,236, 80, 1, 0, 0,137,231,173,171,133,192,117,250, /* 0x 80 */
|
||||
173,171,133,192,117,250, 87, 64,106, 82, 89,243,171, 72,171,171, /* 0x 90 */
|
||||
95,173,133,192,145,173,116, 15,131,249, 42,115,244,137, 76,207, /* 0x a0 */
|
||||
|
|
|
@ -49,7 +49,7 @@ fold_begin: ; enter: %ebx= &Elf32_Ehdr of this program
|
|||
mov ecx, esp ; argv starts just at the current stack top
|
||||
lea edx, [esp+eax*4+4] ; envp = &argv[argc + 1]
|
||||
mov edi, [ebx + e_entry]
|
||||
lea esi, [ebx + szElf32_Ehdr + szElf32_Phdr + szl_info]
|
||||
lea esi, [ebx + szElf32_Ehdr + 2*szElf32_Phdr + szl_info]
|
||||
sub edi, esi ; length
|
||||
lea ebx, [2 + ebp] ; f_unfilter, maybe
|
||||
pusha ; (cprLen, cprSrc, f_decpr, xx, f_unf, envp, argv, argc)
|
||||
|
|
|
@ -31,14 +31,14 @@
|
|||
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
|
||||
OUTPUT_ARCH(i386)
|
||||
/*ENTRY(_start)*/
|
||||
PHDRS /* force exactly 1 ELF32_Phdr: in particular, no PT_GNU_STACK */
|
||||
PHDRS
|
||||
{
|
||||
phdr0 PT_LOAD FILEHDR PHDRS FLAGS(5); /* no PF_W: strict SELinux, PaX, grSecurity */
|
||||
phdr1 PT_LOAD; /* kernel-2.6.12-2.3.legacy_FC3 bug: SIGSEGV if no PF_W for ".bss" */
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
/* 0x00401000: l_lx_exec86.asm assumes 1 page up from 64KB boundary */
|
||||
. = 0x00401000 + SIZEOF_HEADERS + 12; /* 12==sizeof(l_info) */
|
||||
.data : { /* put everything together in one Phdr */
|
||||
*(.text)
|
||||
|
|
|
@ -31,9 +31,10 @@
|
|||
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
|
||||
OUTPUT_ARCH(i386)
|
||||
/*ENTRY(_start)*/
|
||||
PHDRS /* force exactly 1 ELF32_Phdr: in particular, no PT_GNU_STACK */
|
||||
PHDRS
|
||||
{
|
||||
phdr0 PT_LOAD FILEHDR PHDRS FLAGS(5);
|
||||
phdr0 PT_LOAD FILEHDR PHDRS FLAGS(5); /* no PF_W: strict SELinux, PaX, grSecurity */
|
||||
phdr1 PT_LOAD; /* kernel-2.6.12-2.3.legacy_FC3 bug: SIGSEGV if no PF_W for ".bss" */
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
|
|
Loading…
Reference in New Issue
Block a user