diff --git a/src/stub/amd64-darwin.macho-fold.h b/src/stub/amd64-darwin.macho-fold.h index 30eee4b1..c01eda3d 100644 --- a/src/stub/amd64-darwin.macho-fold.h +++ b/src/stub/amd64-darwin.macho-fold.h @@ -1,5 +1,5 @@ /* amd64-darwin.macho-fold.h - created from amd64-darwin.macho-fold.bin, 3300 (0xce4) bytes + created from amd64-darwin.macho-fold.bin, 1760 (0x6e0) bytes This file is part of the UPX executable compressor. @@ -31,11 +31,11 @@ */ -#define STUB_AMD64_DARWIN_MACHO_FOLD_SIZE 3300 -#define STUB_AMD64_DARWIN_MACHO_FOLD_ADLER32 0xacbe06bb -#define STUB_AMD64_DARWIN_MACHO_FOLD_CRC32 0xace91f80 +#define STUB_AMD64_DARWIN_MACHO_FOLD_SIZE 1760 +#define STUB_AMD64_DARWIN_MACHO_FOLD_ADLER32 0x055fc520 +#define STUB_AMD64_DARWIN_MACHO_FOLD_CRC32 0xdffb08c7 -unsigned char stub_amd64_darwin_macho_fold[3300] = { +unsigned char stub_amd64_darwin_macho_fold[1760] = { /* 0x0000 */ 232, 74, 0, 0, 0,131,249, 73,117, 68, 83, 87, 72,141, 76, 55, /* 0x0010 */ 253, 94, 86, 91,235, 47, 72, 57,206,115, 50, 86, 94,172, 60,128, /* 0x0020 */ 114, 10, 60,143,119, 6,128,126,254, 15,116, 6, 44,232, 60, 1, @@ -43,7 +43,7 @@ unsigned char stub_amd64_darwin_macho_fold[3300] = { /* 0x0040 */ 41,248, 1,216,171, 72, 57,206,115, 3,172,235,223, 91,195, 65, /* 0x0050 */ 89, 76,137,247, 76,137,254, 73,137,228,139, 79, 24,184, 0, 8, /* 0x0060 */ 0, 0, 57,193, 15, 66,200, 73,141, 68, 36, 32, 73,137,232, 72, -/* 0x0070 */ 41,204, 72,137,226, 80,232, 68, 10, 0, 0, 72,139, 40, 72,139, +/* 0x0070 */ 41,204, 72,137,226, 80,232,221, 4, 0, 0, 72,139, 40, 72,139, /* 0x0080 */ 136,128, 0, 0, 0, 76,137,228, 72,137, 76, 36, 24, 95,232, 45, /* 0x0090 */ 0, 0, 0, 95, 94,184, 73, 0, 0, 2,255,229,139, 7, 15,200, /* 0x00a0 */ 137, 7,131,238, 4, 72,141,127, 4,119,241,195,176, 4,235, 2, @@ -57,190 +57,93 @@ unsigned char stub_amd64_darwin_macho_fold[3300] = { /* 0x0120 */ 131,200,255,195, 72,141, 53, 28, 0, 0, 0, 72,137,194,185, 16, /* 0x0130 */ 0, 0, 0, 72,193,194, 4,137,208,131,224, 15, 15,182, 4, 6, /* 0x0140 */ 170,131,233, 1,117,237,195, 48, 49, 50, 51, 52, 53, 54, 55, 56, -/* 0x0150 */ 57, 97, 98, 99,100,101,102,144, 83,137,249, 65,137,208,191, 10, -/* 0x0160 */ 0, 0, 0, 49,210,137,200,247,247,131,248, 9,118, 5,107,255, -/* 0x0170 */ 10,235,240,131,249, 9,118, 47,137,200, 49,210,247,247,186, 10, -/* 0x0180 */ 0, 0, 0,137,211, 49,210, 65,137,193,137,248, 65, 15,175,193, -/* 0x0190 */ 41,193,137,248,247,243, 65,141, 81, 48,137,199, 73, 99,192, 65, -/* 0x01a0 */ 255,192,136, 20, 6,235,204, 91,141, 65, 48, 73, 99,208, 65,255, -/* 0x01b0 */ 192,136, 4, 22, 68,137,192,195, 73,137,243, 65,137,210,184, 15, -/* 0x01c0 */ 0, 0, 0, 73,185, 0, 0, 0, 0, 0, 0, 0,240, 76,133,207, -/* 0x01d0 */ 117, 8, 73,193,233, 4,255,200,117,243, 77,133,201,116, 52, 68, -/* 0x01e0 */ 141, 4,133, 0, 0, 0, 0, 68,137,193, 72,137,248, 73, 99,242, -/* 0x01f0 */ 72,211,232, 65,255,194,131,224, 15,141, 80, 87,141, 72, 48,131, -/* 0x0200 */ 248, 10, 15, 66,209, 65,131,232, 4, 73,193,233, 4, 65,136, 20, -/* 0x0210 */ 51,117,212, 68,137,208,195, 65, 85, 69, 49,237, 65, 84, 69, 49, -/* 0x0220 */ 228, 85, 72,137,253, 83, 72,129,236,248, 0, 0, 0, 72,137, 84, -/* 0x0230 */ 36, 80, 15,182,208, 72,137,116, 36, 72, 72,141, 4,149, 0, 0, -/* 0x0240 */ 0, 0, 72,141, 21, 75, 0, 0, 0, 72,137, 76, 36, 88, 76,137, -/* 0x0250 */ 68, 36, 96, 76,137, 76, 36,104, 72, 41,194, 72,141,132, 36,239, -/* 0x0260 */ 0, 0, 0,199, 4, 36, 8, 0, 0, 0,199, 68, 36, 4, 48, 0, -/* 0x0270 */ 0, 0,255,226, 15, 41,120,241, 15, 41,112,225, 15, 41,104,209, -/* 0x0280 */ 15, 41, 96,193, 15, 41, 88,177, 15, 41, 80,161, 15, 41, 72,145, -/* 0x0290 */ 15, 41, 64,129, 72,141,132, 36, 32, 1, 0, 0, 72,137, 68, 36, -/* 0x02a0 */ 8, 72,141, 68, 36, 64, 72,137, 68, 36, 16, 15,182, 93, 0, 72, -/* 0x02b0 */ 255,197,132,219,117, 11, 77,133,237, 15,132,148, 1, 0, 0,235, -/* 0x02c0 */ 20,128,251, 37,116, 10, 77,133,237,117,224, 73,137,237,235,219, -/* 0x02d0 */ 77,133,237,116, 34, 73,141,117,255, 72,137,234,191, 2, 0, 0, -/* 0x02e0 */ 0, 76, 41,234, 69, 49,237,232,192,253,255,255, 65, 1,196,132, -/* 0x02f0 */ 219, 15,132, 92, 1, 0, 0, 15,190, 69, 0, 72,255,197,131,248, -/* 0x0300 */ 112, 15,132,179, 0, 0, 0,127, 15,133,192, 15,132, 66, 1, 0, -/* 0x0310 */ 0,131,248,100,116, 86,235, 14,131,248,117,116, 23,131,248,120, -/* 0x0320 */ 15,132,210, 0, 0, 0, 72,141,117,255,186, 1, 0, 0, 0,233, -/* 0x0330 */ 13, 1, 0, 0,139, 4, 36, 72,141,116, 36, 32,131,248, 48,115, -/* 0x0340 */ 15,137,193, 72, 3, 76, 36, 16,131,192, 8,137, 4, 36,235, 14, -/* 0x0350 */ 72,139, 76, 36, 8, 72,141, 65, 8, 72,137, 68, 36, 8,139, 57, -/* 0x0360 */ 49,210,232,241,253,255,255,233,205, 0, 0, 0,139, 4, 36,131, -/* 0x0370 */ 248, 48,115, 15,137,194, 72, 3, 84, 36, 16,131,192, 8,137, 4, -/* 0x0380 */ 36,235, 14, 72,139, 84, 36, 8, 72,141, 66, 8, 72,137, 68, 36, -/* 0x0390 */ 8,139, 58, 49,210, 72,141, 92, 36, 32,133,255,121, 9,247,223, -/* 0x03a0 */ 198, 68, 36, 32, 45,178, 1, 72,137,222,232,169,253,255,255, 72, -/* 0x03b0 */ 137,222, 72, 99,208,233,135, 0, 0, 0,139, 4, 36,198, 68, 36, -/* 0x03c0 */ 32, 48, 72,141,116, 36, 32,198, 68, 36, 33,120,131,248, 48,115, -/* 0x03d0 */ 15,137,193, 72, 3, 76, 36, 16,131,192, 8,137, 4, 36,235, 14, -/* 0x03e0 */ 72,139, 76, 36, 8, 72,141, 65, 8, 72,137, 68, 36, 8, 72,139, -/* 0x03f0 */ 57,186, 2, 0, 0, 0,235, 60,139, 4, 36,198, 68, 36, 32, 48, -/* 0x0400 */ 72,141,116, 36, 32,198, 68, 36, 33,120,131,248, 48,115, 15,137, -/* 0x0410 */ 194, 72, 3, 84, 36, 16,131,192, 8,137, 4, 36,235, 14, 72,139, -/* 0x0420 */ 84, 36, 8, 72,141, 66, 8, 72,137, 68, 36, 8, 72, 99, 58,186, -/* 0x0430 */ 2, 0, 0, 0,232,127,253,255,255, 72,141,116, 36, 32, 72, 99, -/* 0x0440 */ 208,191, 2, 0, 0, 0,232, 97,252,255,255, 65, 1,196,233, 88, -/* 0x0450 */ 254,255,255, 72,129,196,248, 0, 0, 0, 68,137,224, 91, 93, 65, -/* 0x0460 */ 92, 65, 93,195, 65, 85, 73,137,209, 73,137,240, 49,192, 65, 84, -/* 0x0470 */ 73,137,244, 85, 72,137,213, 83, 72,137,251, 72,137,222, 81, 76, -/* 0x0480 */ 139,111, 8, 72,139, 19,232, 23, 0, 0, 0,120,114,101, 97,100, -/* 0x0490 */ 32, 37,112, 40, 37,120, 32, 37,112, 41, 32, 37,112, 32, 37,120, -/* 0x04a0 */ 10, 0, 95, 76,137,233,232,108,253,255,255, 72,139, 19, 72, 57, -/* 0x04b0 */ 234,115, 63, 72,139, 75, 8, 73,137,233, 77,137,224, 72,137,222, -/* 0x04c0 */ 49,192,232, 27, 0, 0, 0,120,114,101, 97,100,102, 97,105,108, -/* 0x04d0 */ 32, 37,112, 40, 37,120, 32, 37,112, 41, 32, 37,112, 32, 37,120, -/* 0x04e0 */ 10, 0, 95,232, 47,253,255,255,191,127, 0, 0, 0,232,190,251, -/* 0x04f0 */ 255,255, 72,141, 85,255, 72,131,250,255,116, 20, 65, 15,182, 69, -/* 0x0500 */ 0, 72,255,202, 73,255,197, 65,136, 4, 36, 73,255,196,235,230, -/* 0x0510 */ 72, 1,107, 8, 72, 41, 43, 88, 91, 93, 65, 92, 65, 93,195, 65, -/* 0x0520 */ 85, 73,137,213, 73,137,240, 49,192, 65, 84, 73,137,204, 85, 72, -/* 0x0530 */ 137,253,232, 49, 0, 0, 0,117,110,112, 97, 99,107, 69,120,116, -/* 0x0540 */ 101,110,116, 32,105,110, 61, 37,112, 40, 37,120, 32, 37,112, 41, -/* 0x0550 */ 32, 32,111,117,116, 61, 37,112, 40, 37,120, 32, 37,112, 41, 32, -/* 0x0560 */ 32, 37,112, 32, 37,112, 10, 0, 95, 83, 72,137,243, 72,131,236, -/* 0x0570 */ 48, 72,139, 77, 8, 65, 84, 82,255,118, 8, 76,139, 14, 72,139, -/* 0x0580 */ 85, 0, 72,137,238,232,141,252,255,255, 72,131,196, 32, 72,131, -/* 0x0590 */ 59, 0, 15,132, 14, 1, 0, 0, 72,141,116, 36, 16,186, 12, 0, -/* 0x05a0 */ 0, 0, 72,137,239,232,186,254,255,255,139, 84, 36, 16,139,116, -/* 0x05b0 */ 36, 20,133,210,117, 21,129,254, 85, 80, 88, 33,117, 17, 72,131, -/* 0x05c0 */ 125, 0, 0, 15,132,221, 0, 0, 0,235, 4,133,246,117, 10,191, -/* 0x05d0 */ 127, 0, 0, 0,232,215,250,255,255, 57,214,119, 7,137,208, 72, -/* 0x05e0 */ 59, 3,118, 53, 72,139, 11, 49,192,232, 35, 0, 0, 0,115,122, -/* 0x05f0 */ 95, 99,112,114, 61, 37,120, 32, 32,115,122, 95,117,110, 99, 61, -/* 0x0600 */ 37,120, 32, 32,120,111, 45, 62,115,105,122,101, 61, 37,120, 10, -/* 0x0610 */ 0, 95,232, 0,252,255,255,235,182, 57,214, 76,139, 75, 8,115, -/* 0x0620 */ 95, 68, 15,182, 68, 36, 24, 72,137, 68, 36, 8, 72,141, 76, 36, -/* 0x0630 */ 8, 72,139,125, 8, 76,137,202, 65,255,213,133,192,117,144,139, -/* 0x0640 */ 68, 36, 16, 72,139,116, 36, 8, 72, 57,198,117,130, 15,182, 76, -/* 0x0650 */ 36, 25,132,201, 15,149,194, 49,192, 77,133,228, 15,149,192,133, -/* 0x0660 */ 194,116, 15, 15,182, 84, 36, 26, 15,182,201, 72,139,123, 8, 65, -/* 0x0670 */ 255,212,139, 68, 36, 20, 72, 1, 69, 8, 72, 41, 69, 0,235, 13, -/* 0x0680 */ 137,242, 72,137,239, 76,137,206,232,215,253,255,255,139, 84, 36, -/* 0x0690 */ 16, 72,139, 3, 72, 1, 83, 8, 72, 41,208, 72,133,192, 72,137, -/* 0x06a0 */ 3,233,236,254,255,255, 72,131,196, 40, 91, 93, 65, 92, 65, 93, -/* 0x06b0 */ 195, 65, 87, 65, 86, 65, 85, 73,137,253, 73,131,197, 32, 65, 84, -/* 0x06c0 */ 85, 83, 72,131,196,128, 72,139,132, 36,184, 0, 0, 0, 72,137, -/* 0x06d0 */ 84, 36, 80, 49,210, 72,137,124, 36, 96,137,116, 36, 92,232, 49, -/* 0x06e0 */ 0, 0, 0,100,111, 95,120,109, 97,112, 32, 32,102,100,105, 61, -/* 0x06f0 */ 37,120, 32, 32,109,104,100,114, 61, 37,112, 32, 32,120,105, 61, -/* 0x0700 */ 37,112, 40, 37,120, 32, 37,112, 41, 32,102, 95,117,110,102, 61, -/* 0x0710 */ 37,112, 10, 0, 95, 72,137, 68, 36, 48, 49,192, 72,131,124, 36, -/* 0x0720 */ 80, 0,137, 76, 36, 76, 76,137, 68, 36, 64, 76,137, 76, 36, 56, -/* 0x0730 */ 72,199, 68, 36, 40, 0, 0, 0, 0, 72,199, 68, 36, 32, 0, 0, -/* 0x0740 */ 0, 0,116, 12, 72,139, 76, 36, 80, 72,139, 81, 8, 72,139, 1, -/* 0x0750 */ 255,116, 36, 48, 73,137,209, 72,139, 76, 36, 88, 72,139, 84, 36, -/* 0x0760 */ 104,139,116, 36, 84, 73,137,192, 49,192,232,168,250,255,255, 65, -/* 0x0770 */ 88, 65, 89, 49,210, 72,139, 68, 36, 88,199, 68, 36, 20, 0, 0, -/* 0x0780 */ 0, 0, 59, 80, 16, 15,131, 32, 3, 0, 0, 65,139, 69, 0,131, -/* 0x0790 */ 248, 25, 15,133,202, 2, 0, 0, 73,139, 77, 32, 72,133,201, 15, -/* 0x07a0 */ 132,189, 2, 0, 0, 73,139, 85, 48, 72,139,124, 36, 24, 72,137, -/* 0x07b0 */ 84, 36, 96, 73, 3,125, 24, 73,137,215, 72,137,251, 72,137,253, -/* 0x07c0 */ 72,141, 12, 15,129,227,255, 15, 0, 0, 72,137,124, 36,104, 72, -/* 0x07d0 */ 41,221, 73, 1,223, 72,137, 76, 36, 8, 15,132, 28, 1, 0, 0, -/* 0x07e0 */ 72,131,124, 36, 72, 0, 73,141, 71, 3, 72,139, 76, 36, 56, 73, -/* 0x07f0 */ 15, 68,199, 72,137, 4, 36, 72,139, 1, 72,131,248, 1, 25,192, -/* 0x0800 */ 131,224,240, 72,131,124, 36, 72, 0, 68,141,112, 18,117, 5, 72, -/* 0x0810 */ 133,210,117, 7, 65,129,206, 0, 16, 0, 0,131,203,255, 73,131, -/* 0x0820 */ 125, 48, 0, 68,139,100, 36, 84, 15, 69, 92, 36, 68, 69, 3,101, -/* 0x0830 */ 40, 69,137,240,255,116, 36, 24,185, 3, 0, 0, 0, 72,137,238, -/* 0x0840 */ 49,192,232, 67, 0, 0, 0,109,109, 97,112, 32, 32, 97,100,100, -/* 0x0850 */ 114, 61, 37,112, 32, 32,108,101,110, 61, 37,112, 32, 32,112,114, -/* 0x0860 */ 111,116, 61, 37,120, 32, 32,102,108, 97,103,115, 61, 37,120, 32, -/* 0x0870 */ 32,102,100, 61, 37,100, 32, 32,111,102,102, 61, 37,112, 32, 32, -/* 0x0880 */ 114,101,108,111, 99, 61, 37,112, 10, 0, 95, 65, 84, 72,139, 84, -/* 0x0890 */ 36, 16, 65,137,217,232,125,249,255,255, 94, 95, 69,137,225, 65, -/* 0x08a0 */ 137,216, 68,137,241,186, 3, 0, 0, 0, 72,137,239, 72,139, 52, -/* 0x08b0 */ 36,232, 18,248,255,255, 72,137,198, 72,139, 68, 36, 56, 72,131, -/* 0x08c0 */ 56, 0,117, 11, 72,137,245, 72,137, 48, 72,137,116, 36, 24, 72, -/* 0x08d0 */ 57,245,116, 40, 72,137,234, 49,192,232, 19, 0, 0, 0,109, 97, -/* 0x08e0 */ 100,100,114, 61, 37,112, 32, 32, 97,100,100,114, 61, 37,112, 10, -/* 0x08f0 */ 0, 95,232, 32,249,255,255,233,250, 0, 0, 0, 72,131,124, 36, -/* 0x0900 */ 72, 0,116, 47, 73,131,125, 48, 0,116, 40, 73,131,125, 40, 0, -/* 0x0910 */ 117, 8, 72,139, 84, 36, 56, 72,137, 42, 72,139, 76, 36, 40, 72, -/* 0x0920 */ 139, 84, 36, 48, 72,141,116, 36, 96, 72,139,124, 36, 72,232,236, -/* 0x0930 */ 251,255,255, 72,139, 76, 36, 56, 72,131, 57, 0, 15,149,194, 49, -/* 0x0940 */ 192, 77,133,255, 15,149,192,133,194,116,111, 73,131,125, 40, 0, -/* 0x0950 */ 117,104, 65,131,125, 64, 0,116, 97, 76,137,233, 72, 43, 76, 36, -/* 0x0960 */ 88, 73,137,232, 49,192,232, 37, 0, 0, 0,104, 97,116, 99,104, -/* 0x0970 */ 61, 37,112, 32, 32,115,101, 99,112, 61, 37,112, 32, 32,115,101, -/* 0x0980 */ 103,112, 61, 37,112, 32, 32,109,104,100,114, 61, 37,112, 10, 0, -/* 0x0990 */ 95, 72,141, 76, 13, 0, 72,141, 81, 72,139, 90, 48, 72,141, 92, -/* 0x09a0 */ 29, 0, 76,141, 99,252, 76,137,230,232,105,248,255,255,199, 67, -/* 0x09b0 */ 252,144, 15, 5,195, 76,137,100, 36, 32, 76,137,251, 74,141, 84, -/* 0x09c0 */ 61, 0, 72,247,219,129,227,255, 15, 0, 0, 72,137,216, 72,133, -/* 0x09d0 */ 219,116, 11,198, 2, 0, 72,255,194, 72,255,200,235,243, 77,133, -/* 0x09e0 */ 255,116, 29, 65,139, 85, 60, 76,137,254, 72,137,239,232,194,246, -/* 0x09f0 */ 255,255,133,192,116, 10,191,127, 0, 0, 0,232,176,246,255,255, -/* 0x0a00 */ 73,141, 4, 31, 72, 1,197, 72, 59,108, 36, 8,115, 46, 72,133, -/* 0x0a10 */ 237,116,124, 72, 41,108, 36, 8, 65,139, 85, 60, 69, 49,201, 72, -/* 0x0a20 */ 139,116, 36, 8, 65,131,200,255,185, 18, 16, 0, 0, 72,137,239, -/* 0x0a30 */ 232,147,246,255,255, 72, 57,197,116, 85,235,186, 72,131,124, 36, -/* 0x0a40 */ 72, 0,116, 75, 73,131,199, 3, 65,129,231,255, 15, 0, 0, 73, -/* 0x0a50 */ 131,255, 3,119, 58, 76,137,254, 72,137,239,232, 88,246,255,255, -/* 0x0a60 */ 235, 45,131,232, 4,131,248, 1,119, 37, 72,184, 4, 0, 0, 0, -/* 0x0a70 */ 42, 0, 0, 0, 73, 57, 69, 8,117, 21, 72,139, 68, 36, 24, 73, -/* 0x0a80 */ 1,133,144, 0, 0, 0, 73,141, 85, 16, 72,137, 84, 36, 32, 65, -/* 0x0a90 */ 139, 69, 4, 72,139, 76, 36, 88,255, 68, 36, 20, 73, 1,197,139, -/* 0x0aa0 */ 68, 36, 20, 59, 65, 16,233,218,252,255,255, 72,139, 68, 36, 32, -/* 0x0ab0 */ 72,131,196,120, 91, 93, 65, 92, 65, 93, 65, 94, 65, 95,195, 65, -/* 0x0ac0 */ 87, 77,137,207, 65, 86, 65, 85, 77,137,197, 65, 84, 85, 72,137, -/* 0x0ad0 */ 213, 72,141, 87, 24, 83, 72,131,236,104, 68,139, 79, 24, 72,137, -/* 0x0ae0 */ 116, 36, 88, 72,139, 68, 36, 88, 76,141,116, 36, 48, 76,139,164, -/* 0x0af0 */ 36,160, 0, 0, 0, 72,137, 76, 36, 16, 76,137,249, 72,137, 84, -/* 0x0b00 */ 36, 72, 72,137, 84, 36, 40, 77,137,240, 72,131,232, 24, 76,137, -/* 0x0b10 */ 76, 36, 48, 72,139,116, 36, 88, 72,137, 68, 36, 64, 72,137, 68, -/* 0x0b20 */ 36, 32, 72,199, 68, 36, 8, 0, 0, 0, 0,199, 68, 36, 4, 0, -/* 0x0b30 */ 0, 0, 0, 72,137,108, 36, 56, 65,255, 52, 36,232, 88, 0, 0, -/* 0x0b40 */ 0,117,112,120, 95,109, 97,105,110, 32,115,122, 99, 61, 37,120, -/* 0x0b50 */ 32, 32,102, 95,100,101, 99, 61, 37,112, 32, 32,102, 95,117,110, -/* 0x0b60 */ 102, 61, 37,112, 32, 32, 32, 32,120,111, 61, 37,112, 40, 37,120, -/* 0x0b70 */ 32, 37,112, 41, 32, 32,120,105, 61, 37,112, 40, 37,120, 32, 37, -/* 0x0b80 */ 112, 41, 32, 32,109,104,100,114,112,112, 61, 37,112, 32, 32,109, -/* 0x0b90 */ 104,100,114,112, 61, 37,112, 10, 0, 95, 65, 84, 82, 76,137,234, -/* 0x0ba0 */ 80, 49,192, 72,141, 92, 36, 96, 83, 85,232,104,246,255,255, 72, -/* 0x0bb0 */ 131,196, 48, 76,137,234, 76,137,246, 49,201, 72,137,223,232, 92, -/* 0x0bc0 */ 249,255,255, 80, 77,137,233, 77,137,224,131,201,255, 49,246, 72, -/* 0x0bd0 */ 137,239, 72,141, 84, 36, 40, 65, 87,232,211,250,255,255, 65, 92, -/* 0x0be0 */ 65, 94,139,117, 16, 72,141, 85, 32, 73,137,197, 49,201, 57,241, -/* 0x0bf0 */ 15,131,218, 0, 0, 0,131, 58, 14, 15,133,196, 0, 0, 0,139, -/* 0x0c00 */ 122, 8, 49,246, 49,192, 72,141, 60, 58, 49,210,232,179,244,255, -/* 0x0c10 */ 255,133,192, 65,137,196,120, 27,139, 76, 36, 4, 72,139, 84, 36, -/* 0x0c20 */ 16, 72,137,238, 68,137,231,232,144,244,255,255, 72, 57, 68, 36, -/* 0x0c30 */ 16,116, 19,191,127, 0, 0, 0,232,115,244,255,255,139, 91, 8, -/* 0x0c40 */ 137, 92, 36, 4,235,210,139, 69, 0, 61,202,254,186,190,116, 7, -/* 0x0c50 */ 61,190,186,254,202,117, 49, 72, 15,182,117, 7, 72,137,239, 72, -/* 0x0c60 */ 141, 93, 8, 72,107,246, 20,131,198, 8,232, 45,244,255,255,139, -/* 0x0c70 */ 69, 4, 49,201, 57,193,115, 16,129, 59, 7, 0, 0, 1,116,189, -/* 0x0c80 */ 255,193, 72,131,195, 20,235,236, 72,199, 68, 36, 24, 0, 0, 0, -/* 0x0c90 */ 0, 83, 69, 49,201, 68,137,225, 49,210,106, 0,139,116, 36, 20, -/* 0x0ca0 */ 72,137,239, 76,141, 68, 36, 40,232, 4,250,255,255, 68,137,231, -/* 0x0cb0 */ 76,137, 40, 72,137, 68, 36, 24,232, 3,244,255,255, 65, 90, 65, -/* 0x0cc0 */ 91,235, 13,139, 66, 4,255,193, 72, 1,194,233, 30,255,255,255, -/* 0x0cd0 */ 72,139, 68, 36, 8, 72,131,196,104, 91, 93, 65, 92, 65, 93, 65, -/* 0x0ce0 */ 94, 65, 95,195 +/* 0x0150 */ 57, 97, 98, 99,100,101,102,144, 81, 72, 57, 23, 76,139, 71, 8, +/* 0x0160 */ 72,141, 74,255,115, 10,191,127, 0, 0, 0,232, 64,255,255,255, +/* 0x0170 */ 72,131,249,255,116, 17, 65, 15,182, 0, 72,255,201, 73,255,192, +/* 0x0180 */ 136, 6, 72,255,198,235,233, 72, 1, 87, 8, 72, 41, 23, 88,195, +/* 0x0190 */ 65, 85, 73,137,213, 65, 84, 73,137,204, 85, 72,137,253, 83, 72, +/* 0x01a0 */ 137,243, 72,131,236, 40, 72,131, 62, 0, 15,132,217, 0, 0, 0, +/* 0x01b0 */ 72,141,116, 36, 16,186, 12, 0, 0, 0, 72,137,239,232,150,255, +/* 0x01c0 */ 255,255,139, 68, 36, 16,139,116, 36, 20,133,192,117, 21,129,254, +/* 0x01d0 */ 85, 80, 88, 33,117, 17, 72,131,125, 0, 0, 15,132,168, 0, 0, +/* 0x01e0 */ 0,235, 4,133,246,117, 10,191,127, 0, 0, 0,232,191,254,255, +/* 0x01f0 */ 255, 57,198,119,242,137,194, 72, 59, 19,119,235, 57,198, 72,139, +/* 0x0200 */ 67, 8,115, 95, 68, 15,182, 68, 36, 24, 72,137, 84, 36, 8, 72, +/* 0x0210 */ 141, 76, 36, 8, 72,139,125, 8, 72,137,194, 65,255,213,133,192, +/* 0x0220 */ 117,197,139, 68, 36, 16, 72,139,116, 36, 8, 72, 57,198,117,183, +/* 0x0230 */ 15,182, 76, 36, 25,132,201, 15,149,194, 49,192, 77,133,228, 15, +/* 0x0240 */ 149,192,133,194,116, 15, 15,182, 84, 36, 26, 15,182,201, 72,139, +/* 0x0250 */ 123, 8, 65,255,212,139, 68, 36, 20, 72, 1, 69, 8, 72, 41, 69, +/* 0x0260 */ 0,235, 13,137,242, 72,137,239, 72,137,198,232,232,254,255,255, +/* 0x0270 */ 139, 84, 36, 16, 72,139, 3, 72, 1, 83, 8, 72, 41,208, 72,133, +/* 0x0280 */ 192, 72,137, 3,233, 33,255,255,255, 72,131,196, 40, 91, 93, 65, +/* 0x0290 */ 92, 65, 93,195, 65, 87, 77,137,199, 65, 86, 65, 85, 65, 84, 73, +/* 0x02a0 */ 137,252, 73,131,196, 32, 85, 83, 72,131,236,104, 72,139,132, 36, +/* 0x02b0 */ 160, 0, 0, 0, 72,137, 84, 36, 56, 72,137,250, 72,137,124, 36, +/* 0x02c0 */ 72,137,116, 36, 68,137, 76, 36, 52, 76,137, 76, 36, 40, 72,137, +/* 0x02d0 */ 68, 36, 32, 72,199, 68, 36, 24, 0, 0, 0, 0, 49,192, 72,199, +/* 0x02e0 */ 68, 36, 16, 0, 0, 0, 0,199, 68, 36, 12, 0, 0, 0, 0, 59, +/* 0x02f0 */ 66, 16, 15,131, 76, 2, 0, 0, 65,139, 4, 36,131,248, 25, 15, +/* 0x0300 */ 133,245, 1, 0, 0, 73,139, 76, 36, 32, 72,133,201, 15,132,231, +/* 0x0310 */ 1, 0, 0, 77,139, 76, 36, 40, 77,133,201,117, 32, 73,131,124, +/* 0x0320 */ 36, 48, 0,116, 24, 73,139, 7, 72,133,192,116, 16,246, 64, 26, +/* 0x0330 */ 32,116, 10, 73, 43, 68, 36, 24, 72,137, 68, 36, 16, 73,139, 84, +/* 0x0340 */ 36, 48, 72,139,124, 36, 16, 72,137, 84, 36, 80, 73, 3,124, 36, +/* 0x0350 */ 24, 73,137,213, 72,137,251, 72,137,253, 72,137,124, 36, 88,129, +/* 0x0360 */ 227,255, 15, 0, 0, 76,141, 52, 15, 72, 41,221, 73, 1,221,116, +/* 0x0370 */ 108, 72,131,124, 36, 56, 0, 73,141, 69, 3, 76,137,238, 72, 15, +/* 0x0380 */ 69,240, 73,139, 7, 72,131,248, 1, 25,192,131,224,240, 72,131, +/* 0x0390 */ 124, 36, 56, 0,141, 72, 18,117, 5, 72,133,210,117, 3,128,205, +/* 0x03a0 */ 16, 65,131,200,255, 73,131,124, 36, 48, 0,186, 3, 0, 0, 0, +/* 0x03b0 */ 68, 15, 69, 68, 36, 52, 68, 3, 76, 36, 68, 72,137,239,232, 5, +/* 0x03c0 */ 253,255,255, 73,131, 63, 0,117, 11, 72,137,197, 73,137, 7, 72, +/* 0x03d0 */ 137, 68, 36, 16, 72, 57,197, 15,133,181, 0, 0, 0, 72,131,124, +/* 0x03e0 */ 36, 56, 0,116, 44, 73,131,124, 36, 48, 0,116, 36, 73,131,124, +/* 0x03f0 */ 36, 40, 0,117, 3, 73,137, 47, 72,139, 76, 36, 32, 72,139, 84, +/* 0x0400 */ 36, 40, 72,141,116, 36, 80, 72,139,124, 36, 56,232,127,253,255, +/* 0x0410 */ 255, 73,131, 63, 0, 15,149,194, 49,192, 77,133,237, 15,149,192, +/* 0x0420 */ 133,194,116, 49, 73,131,124, 36, 40, 0,117, 41, 65,131,124, 36, +/* 0x0430 */ 64, 0,116, 33, 76,137,224, 72, 43, 68, 36, 72,139, 68, 5,120, +/* 0x0440 */ 72,141, 68, 5, 0,199, 64,252,144, 15, 5,195, 72,131,232, 4, +/* 0x0450 */ 72,137, 68, 36, 24, 76,137,235, 74,141, 84, 45, 0, 72,247,219, +/* 0x0460 */ 129,227,255, 15, 0, 0, 72,137,216, 72,133,219,116, 11,198, 2, +/* 0x0470 */ 0, 72,255,194, 72,255,200,235,243, 77,133,237,116, 30, 65,139, +/* 0x0480 */ 84, 36, 60, 76,137,238, 72,137,239,232, 38,252,255,255,133,192, +/* 0x0490 */ 116, 10,191,127, 0, 0, 0,232, 20,252,255,255, 73,141, 68, 29, +/* 0x04a0 */ 0, 72, 1,197, 76, 57,245,115, 43, 72,133,237,116,124, 65,139, +/* 0x04b0 */ 84, 36, 60, 73, 41,238, 69, 49,201, 65,131,200,255,185, 18, 16, +/* 0x04c0 */ 0, 0, 76,137,246, 72,137,239,232,251,251,255,255, 72, 57,197, +/* 0x04d0 */ 116, 88,235,190, 72,131,124, 36, 56, 0,116, 78, 73,131,197, 3, +/* 0x04e0 */ 65,129,229,255, 15, 0, 0, 73,131,253, 3,119, 61, 76,137,238, +/* 0x04f0 */ 72,137,239,232,192,251,255,255,235, 48,131,232, 4,131,248, 1, +/* 0x0500 */ 119, 40, 72,184, 4, 0, 0, 0, 42, 0, 0, 0, 73, 57, 68, 36, +/* 0x0510 */ 8,117, 23, 72,139, 84, 36, 16, 73, 1,148, 36,144, 0, 0, 0, +/* 0x0520 */ 73,141, 68, 36, 16, 72,137, 68, 36, 24, 65,139, 68, 36, 4,255, +/* 0x0530 */ 68, 36, 12, 72,139, 84, 36, 72, 73, 1,196,139, 68, 36, 12,233, +/* 0x0540 */ 171,253,255,255, 72,139, 68, 36, 24, 72,131,196,104, 91, 93, 65, +/* 0x0550 */ 92, 65, 93, 65, 94, 65, 95,195, 65, 87, 73,137,207, 49,201, 65, +/* 0x0560 */ 86, 69, 49,246, 65, 85, 69, 49,237, 65, 84, 77,137,204, 85, 72, +/* 0x0570 */ 137,213, 72,141, 87, 24, 83, 76,137,195, 72,131,236, 88,139,127, +/* 0x0580 */ 24, 72,137,116, 36, 72, 72,139, 68, 36, 72, 72,141,116, 36, 32, +/* 0x0590 */ 72,137, 84, 36, 56, 72,137, 84, 36, 24, 76,137,194, 72,137,108, +/* 0x05a0 */ 36, 40, 72,137,124, 36, 32, 72,141,124, 36, 48, 72,131,232, 24, +/* 0x05b0 */ 72,137, 68, 36, 48, 72,137, 68, 36, 16,232,209,251,255,255, 65, +/* 0x05c0 */ 83, 73,137,217,131,201,255, 49,246, 72,137,239, 72,141, 84, 36, +/* 0x05d0 */ 24, 65, 84, 76,139,132, 36,160, 0, 0, 0,232,180,252,255,255, +/* 0x05e0 */ 72,137, 68, 36, 16,139,117, 16, 72,141, 85, 32, 65, 89, 65, 90, +/* 0x05f0 */ 49,201, 57,241, 15,131,212, 0, 0, 0,131, 58, 14, 15,133,190, +/* 0x0600 */ 0, 0, 0,139,122, 8, 49,246, 49,192, 72,141, 60, 58, 49,210, +/* 0x0610 */ 232,175,250,255,255,133,192, 65,137,196,120, 22, 68,137,241, 76, +/* 0x0620 */ 137,250, 72,137,238, 68,137,231,232,143,250,255,255, 73, 57,199, +/* 0x0630 */ 116, 16,191,127, 0, 0, 0,232,116,250,255,255, 68,139,115, 8, +/* 0x0640 */ 235,218,139, 69, 0, 61,202,254,186,190,116, 7, 61,190,186,254, +/* 0x0650 */ 202,117, 49, 72, 15,182,117, 7, 72,137,239, 72,141, 93, 8, 72, +/* 0x0660 */ 107,246, 20,131,198, 8,232, 49,250,255,255,139, 69, 4, 49,201, +/* 0x0670 */ 57,193,115, 16,129, 59, 7, 0, 0, 1,116,192,255,193, 72,131, +/* 0x0680 */ 195, 20,235,236, 72,199, 68, 36, 8, 0, 0, 0, 0, 65, 80, 68, +/* 0x0690 */ 137,246, 69, 49,201, 68,137,225,106, 0, 49,210, 72,137,239, 76, +/* 0x06a0 */ 141, 68, 36, 24,232,235,251,255,255, 73,137,197, 72,139, 68, 36, +/* 0x06b0 */ 16, 68,137,231, 73,137, 69, 0,232, 3,250,255,255, 94, 95,235, +/* 0x06c0 */ 13,139, 66, 4,255,193, 72, 1,194,233, 36,255,255,255, 72,131, +/* 0x06d0 */ 196, 88, 76,137,232, 91, 93, 65, 92, 65, 93, 65, 94, 65, 95,195 }; diff --git a/src/stub/src/amd64-darwin.macho-main.c b/src/stub/src/amd64-darwin.macho-main.c index b242965f..e3bf76ba 100644 --- a/src/stub/src/amd64-darwin.macho-main.c +++ b/src/stub/src/amd64-darwin.macho-main.c @@ -34,7 +34,7 @@ #include "include/darwin.h" #ifndef DEBUG /*{*/ -#define DEBUG 1 +#define DEBUG 0 #endif /*}*/ /************************************************************************* @@ -293,6 +293,7 @@ typedef struct { }; enum e3 { MH_NOUNDEFS = 1 + , MH_PIE = 0x200000 // ASLR }; typedef struct { @@ -404,12 +405,17 @@ do_xmap( size_t reloc = 0; unsigned j; - DPRINTF("do_xmap fdi=%%x mhdr=%%p xi=%%p(%%x %%p) f_unf=%%p\\n", - fdi, mhdr, xi, (xi? xi->size: 0), (xi? xi->buf: 0), f_unf); + DPRINTF("do_xmap fdi=%%x mhdr=%%p *mhdrpp=%%p xi=%%p(%%x %%p) f_unf=%%p\\n", + fdi, mhdr, (mhdrpp ? *mhdrpp : 0), xi, (xi? xi->size: 0), (xi? xi->buf: 0), f_unf); for ( j=0; j < mhdr->ncmds; ++j, (sc = (Mach_segment_command *)(sc->cmdsize + (unsigned char *)sc)) - ) if (LC_SEGMENT_64==sc->cmd && sc->vmsize!=0) { + ) if (LC_SEGMENT_64==sc->cmd && sc->vmsize) { + if (!sc->fileoff && sc->filesize // should be __TEXT + && *mhdrpp && ((*mhdrpp)->flags & MH_PIE)) { + reloc = (size_t)*mhdrpp - sc->vmaddr; + DPRINTF("reloc=%%p\\n", reloc); + } Extent xo; size_t mlen = xo.size = sc->filesize; unsigned char *addr = xo.buf = reloc + (unsigned char *)sc->vmaddr; diff --git a/src/stub/tmp/amd64-darwin.macho-fold.map b/src/stub/tmp/amd64-darwin.macho-fold.map index 9e27443d..a6283c0f 100644 --- a/src/stub/tmp/amd64-darwin.macho-fold.map +++ b/src/stub/tmp/amd64-darwin.macho-fold.map @@ -72,7 +72,7 @@ LOAD tmp/amd64-darwin.macho-main.o .plt *(.plt) -.text 0x0000000008048000 0xce4 +.text 0x0000000008048000 0x6e0 *(.text .stub .text.* .gnu.linkonce.t.*) .text 0x0000000008048000 0x157 tmp/amd64-darwin.macho-fold.o 0x00000000080480b8 munmap @@ -87,17 +87,17 @@ LOAD tmp/amd64-darwin.macho-main.o 0x00000000080480b4 mprotect 0x00000000080480c0 close *fill* 0x0000000008048157 0x1 90909090 - .text 0x0000000008048158 0xb8c tmp/amd64-darwin.macho-main.o - 0x00000000080486b1 do_xmap - 0x0000000008048abf upx_main + .text 0x0000000008048158 0x588 tmp/amd64-darwin.macho-main.o + 0x0000000008048294 do_xmap + 0x0000000008048558 upx_main *(.text.*personality*) *(.gnu.warning) .fini *(.fini) - 0x0000000008048ce4 PROVIDE (__etext, .) - 0x0000000008048ce4 PROVIDE (_etext, .) - 0x0000000008048ce4 PROVIDE (etext, .) + 0x00000000080486e0 PROVIDE (__etext, .) + 0x00000000080486e0 PROVIDE (_etext, .) + 0x00000000080486e0 PROVIDE (etext, .) .rodata *(.rodata .rodata.* .gnu.linkonce.r.*) @@ -113,8 +113,8 @@ LOAD tmp/amd64-darwin.macho-main.o .gcc_except_table *(.gcc_except_table .gcc_except_table.*) - 0x0000000008048ce4 . = (ALIGN (0x1000) - ((0x1000 - .) & 0xfff)) - 0x0000000008049ce4 . = (0x1000 DATA_SEGMENT_ALIGN 0x1000) + 0x00000000080486e0 . = (ALIGN (0x1000) - ((0x1000 - .) & 0xfff)) + 0x00000000080496e0 . = (0x1000 DATA_SEGMENT_ALIGN 0x1000) .eh_frame *(.eh_frame) @@ -129,22 +129,22 @@ LOAD tmp/amd64-darwin.macho-main.o *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) -.preinit_array 0x0000000008049ce4 0x0 - 0x0000000008049ce4 PROVIDE (__preinit_array_start, .) +.preinit_array 0x00000000080496e0 0x0 + 0x00000000080496e0 PROVIDE (__preinit_array_start, .) *(.preinit_array) - 0x0000000008049ce4 PROVIDE (__preinit_array_end, .) + 0x00000000080496e0 PROVIDE (__preinit_array_end, .) -.init_array 0x0000000008049ce4 0x0 - 0x0000000008049ce4 PROVIDE (__init_array_start, .) +.init_array 0x00000000080496e0 0x0 + 0x00000000080496e0 PROVIDE (__init_array_start, .) *(SORT(.init_array.*)) *(.init_array) - 0x0000000008049ce4 PROVIDE (__init_array_end, .) + 0x00000000080496e0 PROVIDE (__init_array_end, .) -.fini_array 0x0000000008049ce4 0x0 - 0x0000000008049ce4 PROVIDE (__fini_array_start, .) +.fini_array 0x00000000080496e0 0x0 + 0x00000000080496e0 PROVIDE (__fini_array_start, .) *(.fini_array) *(SORT(.fini_array.*)) - 0x0000000008049ce4 PROVIDE (__fini_array_end, .) + 0x00000000080496e0 PROVIDE (__fini_array_end, .) .ctors *crtbegin*.o(.ctors) @@ -170,35 +170,35 @@ LOAD tmp/amd64-darwin.macho-main.o .got *(.got) - 0x0000000008049ce4 . = (. DATA_SEGMENT_RELRO_END 0xc) + 0x00000000080496e0 . = (. DATA_SEGMENT_RELRO_END 0xc) .got.plt *(.got.plt) -.data 0x0000000008049ce4 0x0 +.data 0x00000000080496e0 0x0 *(.data .data.* .gnu.linkonce.d.*) - .data 0x0000000008049ce4 0x0 tmp/amd64-darwin.macho-fold.o - .data 0x0000000008049ce4 0x0 tmp/amd64-darwin.macho-main.o + .data 0x00000000080496e0 0x0 tmp/amd64-darwin.macho-fold.o + .data 0x00000000080496e0 0x0 tmp/amd64-darwin.macho-main.o *(.gnu.linkonce.d.*personality*) .data1 *(.data1) - 0x0000000008049ce4 _edata = . - 0x0000000008049ce4 PROVIDE (edata, .) - 0x0000000008049ce4 __bss_start = . + 0x00000000080496e0 _edata = . + 0x00000000080496e0 PROVIDE (edata, .) + 0x00000000080496e0 __bss_start = . -.bss 0x0000000008049ce4 0x0 +.bss 0x00000000080496e0 0x0 *(.dynbss) *(.bss .bss.* .gnu.linkonce.b.*) - .bss 0x0000000008049ce4 0x0 tmp/amd64-darwin.macho-fold.o - .bss 0x0000000008049ce4 0x0 tmp/amd64-darwin.macho-main.o + .bss 0x00000000080496e0 0x0 tmp/amd64-darwin.macho-fold.o + .bss 0x00000000080496e0 0x0 tmp/amd64-darwin.macho-main.o *(COMMON) - 0x0000000008049ce4 . = ALIGN ((. != 0x0)?0x4:0x1) - 0x0000000008049ce4 . = ALIGN (0x4) - 0x0000000008049ce4 . = ALIGN (0x4) - 0x0000000008049ce4 _end = . - 0x0000000008049ce4 PROVIDE (end, .) - 0x0000000008049ce4 . = DATA_SEGMENT_END (.) + 0x00000000080496e0 . = ALIGN ((. != 0x0)?0x4:0x1) + 0x00000000080496e0 . = ALIGN (0x4) + 0x00000000080496e0 . = ALIGN (0x4) + 0x00000000080496e0 _end = . + 0x00000000080496e0 PROVIDE (end, .) + 0x00000000080496e0 . = DATA_SEGMENT_END (.) .stab *(.stab)