unmap C_TEXT

modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
This commit is contained in:
John Reiser 2020-05-09 09:45:02 -07:00 committed by Markus F.X.J. Oberhumer
parent 926481dace
commit 69e106c0c5
3 changed files with 186 additions and 177 deletions

View File

@ -1,5 +1,5 @@
/* amd64-linux.elf-fold.h
created from amd64-linux.elf-fold.bin, 2322 (0x912) bytes
created from amd64-linux.elf-fold.bin, 2338 (0x922) bytes
This file is part of the UPX executable compressor.
@ -31,155 +31,156 @@
*/
#define STUB_AMD64_LINUX_ELF_FOLD_SIZE 2322
#define STUB_AMD64_LINUX_ELF_FOLD_ADLER32 0xd23464e1
#define STUB_AMD64_LINUX_ELF_FOLD_CRC32 0x725dafa1
#define STUB_AMD64_LINUX_ELF_FOLD_SIZE 2338
#define STUB_AMD64_LINUX_ELF_FOLD_ADLER32 0x48dc6a21
#define STUB_AMD64_LINUX_ELF_FOLD_CRC32 0xb3befff7
unsigned char stub_amd64_linux_elf_fold[2322] = {
unsigned char stub_amd64_linux_elf_fold[2338] = {
/* 0x0000 */ 127, 69, 76, 70, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x0010 */ 2, 0, 62, 0, 1, 0, 0, 0,188, 0, 16, 0, 0, 0, 0, 0,
/* 0x0020 */ 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x0030 */ 0, 0, 0, 0, 64, 0, 56, 0, 2, 0, 0, 0, 0, 0, 0, 0,
/* 0x0040 */ 1, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x0050 */ 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0,
/* 0x0060 */ 18, 9, 0, 0, 0, 0, 0, 0, 20, 9, 0, 0, 0, 0, 0, 0,
/* 0x0060 */ 34, 9, 0, 0, 0, 0, 0, 0, 36, 9, 0, 0, 0, 0, 0, 0,
/* 0x0070 */ 0, 0, 16, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
/* 0x0080 */ 18, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x0080 */ 34, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x0090 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x00a0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0,
/* 0x00b0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,204,232, 74, 0,
/* 0x00c0 */ 0, 0,131,249, 73,117, 68, 83, 87, 72,141, 76, 55,253, 94, 86,
/* 0x00d0 */ 91,235, 47, 72, 57,206,115, 50, 86, 94,172, 60,128,114, 10, 60,
/* 0x00e0 */ 143,119, 6,128,126,254, 15,116, 6, 44,232, 60, 1,119,228, 72,
/* 0x00f0 */ 57,206,115, 22, 86,173, 40,208,117,223, 95, 15,200, 41,248, 1,
/* 0x0100 */ 216,171, 72, 57,206,115, 3,172,235,223, 91,195, 88, 65, 86, 65,
/* 0x0110 */ 87, 80, 72,137,230, 72,129,236, 0, 16, 0, 0, 84, 95,106, 10,
/* 0x0120 */ 89,243, 72,165, 72,131, 62, 0, 72,165,117,248, 73,137,254, 72,
/* 0x0130 */ 171, 72,131, 62, 0, 72,165,117,248, 73,137,252, 72,131, 62, 0,
/* 0x0140 */ 72,165, 72,165,117,246, 73,137,255, 73,137,245, 77, 41,252,186,
/* 0x0150 */ 255, 15, 0, 0, 87, 94, 72,141,123,237,106, 89, 88, 15, 5,133,
/* 0x0160 */ 192,121, 5, 87, 94,106, 15, 88,145,253, 73,141,125,255,176, 0,
/* 0x0170 */ 170, 72,141,116, 14,255,243,164, 72,131,239, 3,199, 7, 32, 32,
/* 0x0180 */ 32, 61, 73,137, 62, 72,131,231,248, 76,137,249, 72, 41,225,137,
/* 0x0190 */ 200, 49,248,131,240, 8,131,224, 8, 72, 41,199, 73,137,254, 72,
/* 0x01a0 */ 131,239, 8, 73,141,119,248, 72,193,233, 3,243, 72,165, 72,141,
/* 0x01b0 */ 103, 8,252, 75,141, 12, 38,139, 67,252,131,224, 1, 72, 1,193,
/* 0x01c0 */ 65, 89, 94, 95, 88, 72,129,236, 0, 8, 0, 0, 72,137,226, 80,
/* 0x01d0 */ 73,137,232,204,232,241, 5, 0, 0,204, 72,129,196, 8, 8, 0,
/* 0x01e0 */ 0, 72,137, 68, 36, 32, 91, 69, 41,201, 65,137,216,106, 2, 65,
/* 0x01f0 */ 90,106, 1, 90,190, 0, 16, 0, 0,106, 0, 95,106, 9, 88, 15,
/* 0x0200 */ 5,137,223,106, 3, 88, 15, 5, 95, 94,106, 11, 88, 65,255,102,
/* 0x0210 */ 248,204,176, 9, 73,137,202, 15,182,192, 15, 5, 72, 61, 0,240,
/* 0x0220 */ 255,255,114, 4, 72,131,200,255,195,176, 60,235, 2,176, 12,235,
/* 0x0230 */ 2,176, 3,235, 2,176, 2,235, 2,176, 11,235, 2,176, 10,235,
/* 0x0240 */ 2,176, 1,235, 2,176, 0,235,206, 0, 0, 0, 81, 72, 57, 23,
/* 0x0250 */ 76,139, 71, 8, 72,141, 74,255,115, 10,191,127, 0, 0, 0,232,
/* 0x0260 */ 197,255,255,255, 72,131,249,255,116, 17, 65, 15,182, 0, 72,255,
/* 0x0270 */ 201, 73,255,192,136, 6, 72,255,198,235,233, 72, 1, 87, 8, 72,
/* 0x0280 */ 41, 23, 88,195, 65, 85, 73,137,213, 65, 84, 73,137,204, 85, 72,
/* 0x0290 */ 137,253, 83, 72,137,243, 72,131,236, 40, 72,131, 62, 0, 15,132,
/* 0x02a0 */ 230, 0, 0, 0, 72,141,116, 36, 16,186, 12, 0, 0, 0, 72,137,
/* 0x02b0 */ 239,232,150,255,255,255,139, 68, 36, 16,139,116, 36, 20,133,192,
/* 0x02c0 */ 117, 21,129,254, 85, 80, 88, 33,117, 17, 72,131,125, 0, 0, 15,
/* 0x02d0 */ 132,181, 0, 0, 0,235, 4,133,246,117, 10,191,127, 0, 0, 0,
/* 0x02e0 */ 232, 68,255,255,255, 57,198,119,242,137,194, 72, 59, 19,119,235,
/* 0x02f0 */ 57,198, 72,139, 67, 8,115,108, 72,137, 84, 36, 8, 72,139,125,
/* 0x0300 */ 8, 72,141, 76, 36, 8, 68,139, 68, 36, 24, 72,137,194, 65,255,
/* 0x0310 */ 213,133,192,117,198,139, 68, 36, 16, 72,139,116, 36, 8, 72, 57,
/* 0x0320 */ 198,117,184, 15,182, 76, 36, 25,132,201, 15,149,194, 49,192, 77,
/* 0x0330 */ 133,228, 15,149,192,133,194,116, 29, 72,129,254, 0, 2, 0, 0,
/* 0x0340 */ 119, 5, 72, 57, 51,117, 15, 15,182, 84, 36, 26, 15,182,201, 72,
/* 0x0350 */ 139,123, 8, 65,255,212,139, 68, 36, 20, 72, 1, 69, 8, 72, 41,
/* 0x0360 */ 69, 0,235, 13,137,242, 72,137,239, 72,137,198,232,219,254,255,
/* 0x0370 */ 255,139, 84, 36, 16, 72,139, 3, 72, 1, 83, 8, 72, 41,208, 72,
/* 0x0380 */ 133,192, 72,137, 3,233, 20,255,255,255, 72,131,196, 40, 91, 93,
/* 0x0390 */ 65, 92, 65, 93,195, 72,133,255, 73,137,209,116, 54, 64,246,199,
/* 0x03a0 */ 1,117, 48, 72,139, 15, 65,137,240, 76, 57,193,116, 18, 72,131,
/* 0x03b0 */ 249, 1, 15,148,194, 49,192,133,246, 15,149,192,133,194,116, 8,
/* 0x03c0 */ 76,137, 7, 76,137, 79, 8,195, 72,133,201,116, 6, 72,131,199,
/* 0x03d0 */ 16,235,208,195, 65, 87, 73,137,255, 65, 86, 65, 85, 73,137,253,
/* 0x03e0 */ 65, 84, 85, 83, 72,131,236,104, 76, 3,111, 32, 72,133,246, 72,
/* 0x03f0 */ 137,116, 36, 64,137, 84, 36, 60, 72,137, 76, 36, 48, 76,137, 68,
/* 0x0400 */ 36, 40, 76,137, 76, 36, 32,116, 62, 72,139,132, 36,160, 0, 0,
/* 0x0410 */ 0, 69, 49,201, 65,131,200,255,185, 50, 0, 0, 0, 49,210, 72,
/* 0x0420 */ 139, 56, 72,139, 71, 32, 72, 1,248, 72, 43,120, 72, 72,139,112,
/* 0x0430 */ 40, 72,141, 4, 62, 72,137, 68, 36, 72,232,210,253,255,255, 73,
/* 0x0440 */ 137,198,233,172, 0, 0, 0,102,131,127, 16, 3,184, 0, 0, 0,
/* 0x0450 */ 0,185, 16, 0, 0, 0, 15,183, 87, 56, 76,137,238, 15, 68,200,
/* 0x0460 */ 72,139,132, 36,160, 0, 0, 0, 72,131,205,255, 49,219, 49,255,
/* 0x0470 */ 131,193, 34, 76,139, 0,255,202,120, 33,131, 62, 1,117, 22, 72,
/* 0x0480 */ 139, 70, 16, 72, 57,232, 72, 15, 66,232, 72, 3, 70, 40, 72, 57,
/* 0x0490 */ 195, 72, 15, 66,216, 72,131,198, 56,235,219, 72,129,229, 0,240,
/* 0x04a0 */ 255,255, 72, 41,235, 72,129,195,255, 15, 0, 0, 72,129,227, 0,
/* 0x04b0 */ 240,255,255,246,193, 16,116, 5, 72,137,239,235, 19, 72,133,237,
/* 0x04c0 */ 117, 14,137,200, 76,137,199,131,200, 16, 77,133,192, 15, 69,200,
/* 0x04d0 */ 69, 49,201, 65,131,200,255, 49,210, 72,137,222,232, 48,253,255,
/* 0x04e0 */ 255, 72,137,199, 72,141, 4, 3, 73,137,254, 72,137, 68, 36, 72,
/* 0x04f0 */ 73, 41,238,102, 65,131,127, 56, 0,199, 68, 36, 28, 0, 0, 0,
/* 0x0500 */ 0, 15,132,162, 2, 0, 0, 72,131,124, 36, 64, 0,116, 34, 65,
/* 0x0510 */ 131,125, 0, 6,117, 27, 73,139, 85, 16, 72,139,124, 36, 48,190,
/* 0x0520 */ 3, 0, 0, 0, 76, 1,242,232,105,254,255,255,233, 97, 2, 0,
/* 0x0530 */ 0, 65,131,125, 0, 1, 15,133, 86, 2, 0, 0, 72,131,124, 36,
/* 0x0540 */ 64, 0,116, 73, 73,131,125, 8, 0,117, 66, 73,139, 85, 16, 72,
/* 0x0550 */ 139,124, 36, 48,190, 3, 0, 0, 0, 76, 1,242, 73, 3, 87, 32,
/* 0x0560 */ 232, 48,254,255,255, 73, 15,183, 87, 56, 72,139,124, 36, 48,190,
/* 0x0570 */ 5, 0, 0, 0,232, 28,254,255,255, 73, 15,183, 87, 54, 72,139,
/* 0x0580 */ 124, 36, 48,190, 4, 0, 0, 0,232, 8,254,255,255, 73,139, 69,
/* 0x0590 */ 16, 65,139, 77, 4, 65,131,200,255, 73,139, 85, 32,199, 68, 36,
/* 0x05a0 */ 24, 64, 98, 81,115, 76, 1,240,131,225, 7, 73,137,196, 72,137,
/* 0x05b0 */ 68, 36, 88, 73,139, 69, 40, 76,137,229,193,225, 2,211,108, 36,
/* 0x05c0 */ 24,129,229,255, 15, 0, 0,131,100, 36, 24, 7, 72,137, 84, 36,
/* 0x05d0 */ 80, 76, 1,224, 72, 1,234, 73, 41,236, 72,137, 68, 36, 8,185,
/* 0x05e0 */ 50, 0, 0, 0, 73,139, 69, 8, 72,137, 84, 36, 16, 72, 41,232,
/* 0x05f0 */ 72,131,124, 36, 64, 0,117, 7, 68,139, 68, 36, 60,177, 18,139,
/* 0x0600 */ 84, 36, 24, 72,139,116, 36, 16, 73,137,193, 76,137,231,131,202,
/* 0x0610 */ 2, 72,131,124, 36, 64, 0, 15, 68, 84, 36, 24,232,240,251,255,
/* 0x0620 */ 255, 73, 57,196, 15,133, 37, 1, 0, 0, 72,131,124, 36, 64, 0,
/* 0x0630 */ 116, 25, 72,139, 76, 36, 32, 72,139, 84, 36, 40, 72,141,116, 36,
/* 0x0640 */ 80, 72,139,124, 36, 64,232, 57,252,255,255, 72,139,108, 36, 16,
/* 0x0650 */ 72,247,221,129,229,255, 15, 0, 0,246, 68, 36, 24, 2,116, 17,
/* 0x0660 */ 72,139, 68, 36, 16, 72,137,233,252, 73,141, 60, 4, 49,192,243,
/* 0x0670 */ 170, 72,131,124, 36, 64, 0, 15,132,220, 0, 0, 0,199, 68, 36,
/* 0x0680 */ 4, 0, 0, 0, 0, 72,184,255,255,255,255, 1, 0, 0, 0, 73,
/* 0x0690 */ 35, 69, 0, 72,186, 1, 0, 0, 0, 1, 0, 0, 0, 72, 57,208,
/* 0x06a0 */ 15,133,148, 0, 0, 0, 73,139, 85, 40, 73,139, 77, 16, 73, 59,
/* 0x06b0 */ 85, 32, 72,141, 4, 10, 74,141, 28, 48,117, 14,137,216,247,216,
/* 0x06c0 */ 37,255, 15, 0, 0,131,248, 3,119, 57, 73,131,125, 8, 0, 74,
/* 0x06d0 */ 141, 92, 49, 12,116, 45, 69, 49,201, 65,131,200,255, 49,255,185,
/* 0x06e0 */ 34, 0, 0, 0,186, 3, 0, 0, 0,190, 0, 16, 0, 0,199, 68,
/* 0x06f0 */ 36, 4, 1, 0, 0, 0,232, 22,251,255,255, 72,133,192, 72,137,
/* 0x0700 */ 195,116, 55,131,124, 36, 4, 0,199, 3, 15, 5, 90,195,116, 18,
/* 0x0710 */ 186, 5, 0, 0, 0,190, 4, 0, 0, 0, 72,137,223,232, 27,251,
/* 0x0720 */ 255,255, 72,133,219,116, 19, 72,139,124, 36, 48, 72,137,218, 49,
/* 0x0730 */ 246, 72,131,231,254,232, 91,252,255,255,139, 84, 36, 24, 72,139,
/* 0x0740 */ 116, 36, 16, 76,137,231,232,242,250,255,255,133,192,116, 10,191,
/* 0x0750 */ 127, 0, 0, 0,232,208,250,255,255, 72,139, 68, 36, 16, 72, 1,
/* 0x0760 */ 232, 73, 1,196, 76, 59,100, 36, 8,115, 39, 76, 41,100, 36, 8,
/* 0x0770 */ 139, 84, 36, 24, 69, 49,201, 72,139,116, 36, 8, 65,131,200,255,
/* 0x0780 */ 185, 50, 0, 0, 0, 76,137,231,232,132,250,255,255, 73, 57,196,
/* 0x0790 */ 117,189,255, 68, 36, 28, 65, 15,183, 71, 56, 73,131,197, 56, 57,
/* 0x07a0 */ 68, 36, 28, 15,140, 94,253,255,255, 72,139,132, 36,160, 0, 0,
/* 0x07b0 */ 0, 76,137, 48, 77, 3,119, 24, 72,131,196,104, 91, 93, 65, 92,
/* 0x07c0 */ 65, 93, 76,137,240, 65, 94, 65, 95,195, 65, 87, 65, 86, 73,137,
/* 0x07d0 */ 206, 49,201, 65, 85, 65, 84, 77,137,204, 85, 72,137,213, 76,141,
/* 0x07e0 */ 109, 64, 83, 76,137,195, 72,131,236, 72,139, 7, 72,137,124, 36,
/* 0x07f0 */ 24, 72,137,124, 36, 40, 76,141,188, 36,128, 0, 0, 0, 72,137,
/* 0x0800 */ 116, 36, 32, 72,141,116, 36, 48, 72,137, 84, 36, 56, 76,137,194,
/* 0x0810 */ 72,137, 68, 36, 48,139, 71, 4, 72,141,124, 36, 16, 72,131,192,
/* 0x0820 */ 12, 72,137, 68, 36, 16,232, 89,250,255,255, 65, 83, 77,137,225,
/* 0x0830 */ 49,210, 73,137,216, 76,137,241, 72,137,239, 72,141,116, 36, 40,
/* 0x0840 */ 65, 87,232,141,251,255,255,190, 9, 0, 0, 0, 72,137,194, 76,
/* 0x0850 */ 137,247, 73,137,196,232, 59,251,255,255, 65, 89, 65, 90,102,131,
/* 0x0860 */ 125, 56, 0,199, 68, 36, 12, 0, 0, 0, 0, 15,132,143, 0, 0,
/* 0x0870 */ 0, 65,131,125, 0, 3,117,114, 73,139, 63, 73, 3,125, 16, 49,
/* 0x0880 */ 210, 49,246,232,173,249,255,255,133,192,137,195,120, 23,186, 0,
/* 0x0890 */ 4, 0, 0, 72,137,238,137,199,232,168,249,255,255, 72, 61, 0,
/* 0x08a0 */ 4, 0, 0,116, 10,191,127, 0, 0, 0,232,122,249,255,255, 73,
/* 0x08b0 */ 199, 7, 0, 0, 0, 0, 65, 80, 69, 49,201, 69, 49,192, 49,201,
/* 0x08c0 */ 65, 87,137,218, 49,246, 72,137,239,232, 6,251,255,255, 73,139,
/* 0x08d0 */ 23,190, 7, 0, 0, 0, 76,137,247, 73,137,196,232,180,250,255,
/* 0x08e0 */ 255,137,223,232, 73,249,255,255, 94, 95,255, 68, 36, 12, 15,183,
/* 0x08f0 */ 69, 56, 73,131,197, 56, 57, 68, 36, 12, 15,130,113,255,255,255,
/* 0x0900 */ 72,131,196, 72, 76,137,224, 91, 93, 65, 92, 65, 93, 65, 94, 65,
/* 0x0910 */ 95,195
/* 0x00b0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 74, 0, 0,
/* 0x00c0 */ 0,131,249, 73,117, 68, 83, 87, 72,141, 76, 55,253, 94, 86, 91,
/* 0x00d0 */ 235, 47, 72, 57,206,115, 50, 86, 94,172, 60,128,114, 10, 60,143,
/* 0x00e0 */ 119, 6,128,126,254, 15,116, 6, 44,232, 60, 1,119,228, 72, 57,
/* 0x00f0 */ 206,115, 22, 86,173, 40,208,117,223, 95, 15,200, 41,248, 1,216,
/* 0x0100 */ 171, 72, 57,206,115, 3,172,235,223, 91,195, 88, 65, 86, 65, 87,
/* 0x0110 */ 80, 72,137,230, 72,129,236, 0, 16, 0, 0, 84, 95,106, 10, 89,
/* 0x0120 */ 243, 72,165, 72,131, 62, 0, 72,165,117,248, 73,137,254, 72,171,
/* 0x0130 */ 72,131, 62, 0, 72,165,117,248, 73,137,252, 72,131, 62, 0, 72,
/* 0x0140 */ 165, 72,165,117,246, 73,137,255, 73,137,245, 77, 41,252,186,255,
/* 0x0150 */ 15, 0, 0, 87, 94, 72,141,123,237,106, 89, 88, 15, 5,133,192,
/* 0x0160 */ 121, 5, 87, 94,106, 15, 88,145,253, 73,141,125,255,176, 0,170,
/* 0x0170 */ 72,141,116, 14,255,243,164, 72,131,239, 3,199, 7, 32, 32, 32,
/* 0x0180 */ 61, 73,137, 62, 72,131,231,248, 76,137,249, 72, 41,225,137,200,
/* 0x0190 */ 49,248,131,240, 8,131,224, 8, 72, 41,199, 73,137,254, 72,131,
/* 0x01a0 */ 239, 8, 73,141,119,248, 72,193,233, 3,243, 72,165, 72,141,103,
/* 0x01b0 */ 8,252, 75,141, 12, 38,139, 67,252,131,224, 1, 72, 1,193, 65,
/* 0x01c0 */ 89, 94, 95, 88, 72,129,236, 0, 8, 0, 0, 72,137,226, 80, 73,
/* 0x01d0 */ 137,197, 73,137,232,232, 0, 6, 0, 0,204, 72,129,196, 8, 8,
/* 0x01e0 */ 0, 0, 72,137, 68, 36, 32, 91, 73,139,181,136, 0, 0, 0, 76,
/* 0x01f0 */ 137,239, 73, 43,117, 80,232, 79, 0, 0, 0, 77, 41,201, 65,137,
/* 0x0200 */ 216,106, 2, 89,106, 1, 90,190, 0, 16, 0, 0, 41,255,232, 16,
/* 0x0210 */ 0, 0, 0,137,223,232, 40, 0, 0, 0, 95, 94,106, 11, 88, 65,
/* 0x0220 */ 255,102,248,176, 9, 73,137,202, 15,182,192, 15, 5, 72, 61, 0,
/* 0x0230 */ 240,255,255,114, 4, 72,131,200,255,195,176, 60,235, 2,176, 12,
/* 0x0240 */ 235, 2,176, 3,235, 2,176, 2,235, 2,176, 11,235, 2,176, 10,
/* 0x0250 */ 235, 2,176, 1,235, 2,176, 0,235,206, 0, 0, 81, 72, 57, 23,
/* 0x0260 */ 76,139, 71, 8, 72,141, 74,255,115, 10,191,127, 0, 0, 0,232,
/* 0x0270 */ 198,255,255,255, 72,131,249,255,116, 17, 65, 15,182, 0, 72,255,
/* 0x0280 */ 201, 73,255,192,136, 6, 72,255,198,235,233, 72, 1, 87, 8, 72,
/* 0x0290 */ 41, 23, 88,195, 65, 85, 73,137,213, 65, 84, 73,137,204, 85, 72,
/* 0x02a0 */ 137,253, 83, 72,137,243, 72,131,236, 40, 72,131, 62, 0, 15,132,
/* 0x02b0 */ 230, 0, 0, 0, 72,141,116, 36, 16,186, 12, 0, 0, 0, 72,137,
/* 0x02c0 */ 239,232,150,255,255,255,139, 68, 36, 16,139,116, 36, 20,133,192,
/* 0x02d0 */ 117, 21,129,254, 85, 80, 88, 33,117, 17, 72,131,125, 0, 0, 15,
/* 0x02e0 */ 132,181, 0, 0, 0,235, 4,133,246,117, 10,191,127, 0, 0, 0,
/* 0x02f0 */ 232, 69,255,255,255, 57,198,119,242,137,194, 72, 59, 19,119,235,
/* 0x0300 */ 57,198, 72,139, 67, 8,115,108, 72,137, 84, 36, 8, 72,139,125,
/* 0x0310 */ 8, 72,141, 76, 36, 8, 68,139, 68, 36, 24, 72,137,194, 65,255,
/* 0x0320 */ 213,133,192,117,198,139, 68, 36, 16, 72,139,116, 36, 8, 72, 57,
/* 0x0330 */ 198,117,184, 15,182, 76, 36, 25,132,201, 15,149,194, 49,192, 77,
/* 0x0340 */ 133,228, 15,149,192,133,194,116, 29, 72,129,254, 0, 2, 0, 0,
/* 0x0350 */ 119, 5, 72, 57, 51,117, 15, 15,182, 84, 36, 26, 15,182,201, 72,
/* 0x0360 */ 139,123, 8, 65,255,212,139, 68, 36, 20, 72, 1, 69, 8, 72, 41,
/* 0x0370 */ 69, 0,235, 13,137,242, 72,137,239, 72,137,198,232,219,254,255,
/* 0x0380 */ 255,139, 84, 36, 16, 72,139, 3, 72, 1, 83, 8, 72, 41,208, 72,
/* 0x0390 */ 133,192, 72,137, 3,233, 20,255,255,255, 72,131,196, 40, 91, 93,
/* 0x03a0 */ 65, 92, 65, 93,195, 72,133,255, 73,137,209,116, 54, 64,246,199,
/* 0x03b0 */ 1,117, 48, 72,139, 15, 65,137,240, 76, 57,193,116, 18, 72,131,
/* 0x03c0 */ 249, 1, 15,148,194, 49,192,133,246, 15,149,192,133,194,116, 8,
/* 0x03d0 */ 76,137, 7, 76,137, 79, 8,195, 72,133,201,116, 6, 72,131,199,
/* 0x03e0 */ 16,235,208,195, 65, 87, 73,137,255, 65, 86, 65, 85, 73,137,253,
/* 0x03f0 */ 65, 84, 85, 83, 72,131,236,104, 76, 3,111, 32, 72,133,246, 72,
/* 0x0400 */ 137,116, 36, 64,137, 84, 36, 60, 72,137, 76, 36, 48, 76,137, 68,
/* 0x0410 */ 36, 40, 76,137, 76, 36, 32,116, 62, 72,139,132, 36,160, 0, 0,
/* 0x0420 */ 0, 69, 49,201, 65,131,200,255,185, 50, 0, 0, 0, 49,210, 72,
/* 0x0430 */ 139, 56, 72,139, 71, 32, 72, 1,248, 72, 43,120, 72, 72,139,112,
/* 0x0440 */ 40, 72,141, 4, 62, 72,137, 68, 36, 72,232,212,253,255,255, 73,
/* 0x0450 */ 137,198,233,172, 0, 0, 0,102,131,127, 16, 3,184, 0, 0, 0,
/* 0x0460 */ 0,185, 16, 0, 0, 0, 15,183, 87, 56, 76,137,238, 15, 68,200,
/* 0x0470 */ 72,139,132, 36,160, 0, 0, 0, 72,131,205,255, 49,219, 49,255,
/* 0x0480 */ 131,193, 34, 76,139, 0,255,202,120, 33,131, 62, 1,117, 22, 72,
/* 0x0490 */ 139, 70, 16, 72, 57,232, 72, 15, 66,232, 72, 3, 70, 40, 72, 57,
/* 0x04a0 */ 195, 72, 15, 66,216, 72,131,198, 56,235,219, 72,129,229, 0,240,
/* 0x04b0 */ 255,255, 72, 41,235, 72,129,195,255, 15, 0, 0, 72,129,227, 0,
/* 0x04c0 */ 240,255,255,246,193, 16,116, 5, 72,137,239,235, 19, 72,133,237,
/* 0x04d0 */ 117, 14,137,200, 76,137,199,131,200, 16, 77,133,192, 15, 69,200,
/* 0x04e0 */ 69, 49,201, 65,131,200,255, 49,210, 72,137,222,232, 50,253,255,
/* 0x04f0 */ 255, 72,137,199, 72,141, 4, 3, 73,137,254, 72,137, 68, 36, 72,
/* 0x0500 */ 73, 41,238,102, 65,131,127, 56, 0,199, 68, 36, 28, 0, 0, 0,
/* 0x0510 */ 0, 15,132,162, 2, 0, 0, 72,131,124, 36, 64, 0,116, 34, 65,
/* 0x0520 */ 131,125, 0, 6,117, 27, 73,139, 85, 16, 72,139,124, 36, 48,190,
/* 0x0530 */ 3, 0, 0, 0, 76, 1,242,232,105,254,255,255,233, 97, 2, 0,
/* 0x0540 */ 0, 65,131,125, 0, 1, 15,133, 86, 2, 0, 0, 72,131,124, 36,
/* 0x0550 */ 64, 0,116, 73, 73,131,125, 8, 0,117, 66, 73,139, 85, 16, 72,
/* 0x0560 */ 139,124, 36, 48,190, 3, 0, 0, 0, 76, 1,242, 73, 3, 87, 32,
/* 0x0570 */ 232, 48,254,255,255, 73, 15,183, 87, 56, 72,139,124, 36, 48,190,
/* 0x0580 */ 5, 0, 0, 0,232, 28,254,255,255, 73, 15,183, 87, 54, 72,139,
/* 0x0590 */ 124, 36, 48,190, 4, 0, 0, 0,232, 8,254,255,255, 73,139, 69,
/* 0x05a0 */ 16, 65,139, 77, 4, 65,131,200,255, 73,139, 85, 32,199, 68, 36,
/* 0x05b0 */ 24, 64, 98, 81,115, 76, 1,240,131,225, 7, 73,137,196, 72,137,
/* 0x05c0 */ 68, 36, 88, 73,139, 69, 40, 76,137,229,193,225, 2,211,108, 36,
/* 0x05d0 */ 24,129,229,255, 15, 0, 0,131,100, 36, 24, 7, 72,137, 84, 36,
/* 0x05e0 */ 80, 76, 1,224, 72, 1,234, 73, 41,236, 72,137, 68, 36, 8,185,
/* 0x05f0 */ 50, 0, 0, 0, 73,139, 69, 8, 72,137, 84, 36, 16, 72, 41,232,
/* 0x0600 */ 72,131,124, 36, 64, 0,117, 7, 68,139, 68, 36, 60,177, 18,139,
/* 0x0610 */ 84, 36, 24, 72,139,116, 36, 16, 73,137,193, 76,137,231,131,202,
/* 0x0620 */ 2, 72,131,124, 36, 64, 0, 15, 68, 84, 36, 24,232,242,251,255,
/* 0x0630 */ 255, 73, 57,196, 15,133, 37, 1, 0, 0, 72,131,124, 36, 64, 0,
/* 0x0640 */ 116, 25, 72,139, 76, 36, 32, 72,139, 84, 36, 40, 72,141,116, 36,
/* 0x0650 */ 80, 72,139,124, 36, 64,232, 57,252,255,255, 72,139,108, 36, 16,
/* 0x0660 */ 72,247,221,129,229,255, 15, 0, 0,246, 68, 36, 24, 2,116, 17,
/* 0x0670 */ 72,139, 68, 36, 16, 72,137,233,252, 73,141, 60, 4, 49,192,243,
/* 0x0680 */ 170, 72,131,124, 36, 64, 0, 15,132,220, 0, 0, 0,199, 68, 36,
/* 0x0690 */ 4, 0, 0, 0, 0, 72,184,255,255,255,255, 1, 0, 0, 0, 73,
/* 0x06a0 */ 35, 69, 0, 72,186, 1, 0, 0, 0, 1, 0, 0, 0, 72, 57,208,
/* 0x06b0 */ 15,133,148, 0, 0, 0, 73,139, 85, 40, 73,139, 77, 16, 73, 59,
/* 0x06c0 */ 85, 32, 72,141, 4, 10, 74,141, 28, 48,117, 14,137,216,247,216,
/* 0x06d0 */ 37,255, 15, 0, 0,131,248, 3,119, 57, 73,131,125, 8, 0, 74,
/* 0x06e0 */ 141, 92, 49, 12,116, 45, 69, 49,201, 65,131,200,255, 49,255,185,
/* 0x06f0 */ 34, 0, 0, 0,186, 3, 0, 0, 0,190, 0, 16, 0, 0,199, 68,
/* 0x0700 */ 36, 4, 1, 0, 0, 0,232, 24,251,255,255, 72,133,192, 72,137,
/* 0x0710 */ 195,116, 55,131,124, 36, 4, 0,199, 3, 15, 5, 90,195,116, 18,
/* 0x0720 */ 186, 5, 0, 0, 0,190, 4, 0, 0, 0, 72,137,223,232, 28,251,
/* 0x0730 */ 255,255, 72,133,219,116, 19, 72,139,124, 36, 48, 72,137,218, 49,
/* 0x0740 */ 246, 72,131,231,254,232, 91,252,255,255,139, 84, 36, 24, 72,139,
/* 0x0750 */ 116, 36, 16, 76,137,231,232,243,250,255,255,133,192,116, 10,191,
/* 0x0760 */ 127, 0, 0, 0,232,209,250,255,255, 72,139, 68, 36, 16, 72, 1,
/* 0x0770 */ 232, 73, 1,196, 76, 59,100, 36, 8,115, 39, 76, 41,100, 36, 8,
/* 0x0780 */ 139, 84, 36, 24, 69, 49,201, 72,139,116, 36, 8, 65,131,200,255,
/* 0x0790 */ 185, 50, 0, 0, 0, 76,137,231,232,134,250,255,255, 73, 57,196,
/* 0x07a0 */ 117,189,255, 68, 36, 28, 65, 15,183, 71, 56, 73,131,197, 56, 57,
/* 0x07b0 */ 68, 36, 28, 15,140, 94,253,255,255, 72,139,132, 36,160, 0, 0,
/* 0x07c0 */ 0, 76,137, 48, 77, 3,119, 24, 72,131,196,104, 91, 93, 65, 92,
/* 0x07d0 */ 65, 93, 76,137,240, 65, 94, 65, 95,195, 65, 87, 65, 86, 73,137,
/* 0x07e0 */ 206, 49,201, 65, 85, 65, 84, 77,137,204, 85, 72,137,213, 76,141,
/* 0x07f0 */ 109, 64, 83, 76,137,195, 72,131,236, 72,139, 7, 72,137,124, 36,
/* 0x0800 */ 24, 72,137,124, 36, 40, 76,141,188, 36,128, 0, 0, 0, 72,137,
/* 0x0810 */ 116, 36, 32, 72,141,116, 36, 48, 72,137, 84, 36, 56, 76,137,194,
/* 0x0820 */ 72,137, 68, 36, 48,139, 71, 4, 72,141,124, 36, 16, 72,131,192,
/* 0x0830 */ 12, 72,137, 68, 36, 16,232, 89,250,255,255, 65, 83, 77,137,225,
/* 0x0840 */ 49,210, 73,137,216, 76,137,241, 72,137,239, 72,141,116, 36, 40,
/* 0x0850 */ 65, 87,232,141,251,255,255,190, 9, 0, 0, 0, 72,137,194, 76,
/* 0x0860 */ 137,247, 73,137,196,232, 59,251,255,255, 65, 89, 65, 90,102,131,
/* 0x0870 */ 125, 56, 0,199, 68, 36, 12, 0, 0, 0, 0, 15,132,143, 0, 0,
/* 0x0880 */ 0, 65,131,125, 0, 3,117,114, 73,139, 63, 73, 3,125, 16, 49,
/* 0x0890 */ 210, 49,246,232,174,249,255,255,133,192,137,195,120, 23,186, 0,
/* 0x08a0 */ 4, 0, 0, 72,137,238,137,199,232,169,249,255,255, 72, 61, 0,
/* 0x08b0 */ 4, 0, 0,116, 10,191,127, 0, 0, 0,232,123,249,255,255, 73,
/* 0x08c0 */ 199, 7, 0, 0, 0, 0, 65, 80, 69, 49,201, 69, 49,192, 49,201,
/* 0x08d0 */ 65, 87,137,218, 49,246, 72,137,239,232, 6,251,255,255, 73,139,
/* 0x08e0 */ 23,190, 7, 0, 0, 0, 76,137,247, 73,137,196,232,180,250,255,
/* 0x08f0 */ 255,137,223,232, 74,249,255,255, 94, 95,255, 68, 36, 12, 15,183,
/* 0x0900 */ 69, 56, 73,131,197, 56, 57, 68, 36, 12, 15,130,113,255,255,255,
/* 0x0910 */ 72,131,196, 72, 76,137,224, 91, 93, 65, 92, 65, 93, 65, 94, 65,
/* 0x0920 */ 95,195
};

View File

@ -67,12 +67,12 @@ __NR_brk= 12
__NR_exit= 60
__NR_readlink= 89
// IN:
// IN: [ADRX,+LENX): compressed data; [ADRU,+LENU): expanded fold (w/ upx_main)
// %rbx= 4+ &O_BINFO; %rbp= f_exp; %r14= ADRX; %r15= LENX;
// rsp/ elfaddr,fd,ADRU,LENU,rdx,%entry, argc,argv,0,envp,0,auxv,0,strings
fold_begin:
int3 // DEBUG only
//// int3 // DEBUG only
call L90
#include "arch/amd64/bxx.S"
L90:
@ -139,39 +139,47 @@ L90:
pop %rax # elfaddr
subq $ OVERHEAD,%rsp
movq %rsp,%arg3 # &ELf64_Ehdr temporary space
push %rax # elfaddr 7th arg
push %rax; mov %rax,%r13 # elfaddr 7th arg
movq %rbp,%arg5 # &decompress: f_expand
int3
call upx_main # Out: %rax= entry
/* entry= upx_main(b_info *arg1, total_size arg2, Elf64_Ehdr *arg3,
Elf32_Auxv_t *arg4, f_decompr arg5, f_unf arg6,
Elf64_Addr elfaddr )
*/
int3
addq $1*NBPW+OVERHEAD,%rsp # toss elfaddr, too
// rsp/ elfaddr,{OVERHEAD},fd,ADRU,LENU,rdx,%entry, argc,argv,0,envp,0,auxv,0,strings
addq $1*NBPW+OVERHEAD,%rsp # also discard elfaddr
movq %rax,4*NBPW(%rsp) # entry
pop %rbx # fd
// Map 1 page of /proc/self/exe so that it does not disappear.
sub %arg6l,%arg6l # 0 offset
sz_Ehdr= 8*NBPW
sz_Phdr= 7*NBPW
p_vaddr= 4+4+8
// Discard pages of compressed data (includes [ADRX,+LENX) )
movq p_vaddr+sz_Phdr+sz_Ehdr(%r13),%arg2 # Phdr[C_TEXT= 1].p_vaddr
movq %r13,%arg1 # hi elfaddr
subq p_vaddr +sz_Ehdr(%r13),%arg2 # - Phdr[C_BASE= 0].p_vaddr ==> len
call munmap # discard C_TEXT compressed data
// Map 1 page of /proc/self/exe so that the symlink does not disappear.
subq %arg6,%arg6 # 0 offset
mov %ebx,%arg5l # fd
push $MAP_PRIVATE; pop %sys4 # BEWARE: %sys4
push $MAP_PRIVATE; pop %arg4
push $PROT_READ; pop %arg3
mov $PAGE_SIZE,%arg2l
push $0; pop %arg1
push $__NR_mmap; pop %rax; syscall
subl %arg1l,%arg1l # 0
call mmap
mov %ebx,%edi # fd
push $__NR_close; pop %rax; syscall
call close
pop %arg1 # ADRU
pop %arg1 # ADRU: unfolded upx_main etc.
pop %arg2 # LENU
push $ __NR_munmap; pop %rax
push $__NR_munmap; pop %rax
jmp *-8(%r14) # goto: syscall; pop %rdx; ret
mmap: .globl mmap
int3
movb $ __NR_mmap,%al
movq %arg4,%sys4
sysgo: # NOTE: kernel demands 4th arg in %sys4, NOT %arg4

View File

@ -8,33 +8,33 @@ Linker script and memory map
0x00000000001000bc . = ((0x100000 + SIZEOF_HEADERS) + 0xc)
.text 0x00000000001000bc 0x858
.text 0x00000000001000bc 0x868
*(.text)
.text 0x00000000001000bc 0x18d tmp/amd64-linux.elf-fold.o
0x0000000000100239 munmap
0x0000000000100211 mmap
0x0000000000100241 write
0x0000000000100245 read
0x0000000000100229 exit
0x000000000010022d brk
0x0000000000100235 open
0x000000000010023d mprotect
0x0000000000100231 close
*fill* 0x0000000000100249 0x3 00
.text 0x000000000010024c 0x6c6 tmp/amd64-linux.elf-main.o
0x00000000001007ca upx_main
.text 0x00000000001000bc 0x19e tmp/amd64-linux.elf-fold.o
0x000000000010024a munmap
0x0000000000100223 mmap
0x0000000000100252 write
0x0000000000100256 read
0x000000000010023a exit
0x000000000010023e brk
0x0000000000100246 open
0x000000000010024e mprotect
0x0000000000100242 close
*fill* 0x000000000010025a 0x2 00
.text 0x000000000010025c 0x6c6 tmp/amd64-linux.elf-main.o
0x00000000001007da upx_main
*(.data)
*fill* 0x0000000000100912 0x2 00
.data 0x0000000000100914 0x0 tmp/amd64-linux.elf-fold.o
.data 0x0000000000100914 0x0 tmp/amd64-linux.elf-main.o
*fill* 0x0000000000100922 0x2 00
.data 0x0000000000100924 0x0 tmp/amd64-linux.elf-fold.o
.data 0x0000000000100924 0x0 tmp/amd64-linux.elf-main.o
.data
.bss 0x0000000000100914 0x0
.bss 0x0000000000100914 0x0 tmp/amd64-linux.elf-fold.o
.bss 0x0000000000100914 0x0 tmp/amd64-linux.elf-main.o
.bss 0x0000000000100924 0x0
.bss 0x0000000000100924 0x0 tmp/amd64-linux.elf-fold.o
.bss 0x0000000000100924 0x0 tmp/amd64-linux.elf-main.o
.rela.dyn 0x0000000000100918 0x0
.rela.dyn 0x0000000000100928 0x0
.rela.text 0x0000000000000000 0x0 tmp/amd64-linux.elf-fold.o
LOAD tmp/amd64-linux.elf-fold.o
LOAD tmp/amd64-linux.elf-main.o