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:46:51 -07:00
committed by Markus F.X.J. Oberhumer
parent 69e106c0c5
commit 2a849444db
3 changed files with 36 additions and 37 deletions
+25 -25
View File
@@ -32,8 +32,8 @@
#define STUB_AMD64_LINUX_ELF_FOLD_SIZE 2338 #define STUB_AMD64_LINUX_ELF_FOLD_SIZE 2338
#define STUB_AMD64_LINUX_ELF_FOLD_ADLER32 0x48dc6a21 #define STUB_AMD64_LINUX_ELF_FOLD_ADLER32 0x88546947
#define STUB_AMD64_LINUX_ELF_FOLD_CRC32 0xb3befff7 #define STUB_AMD64_LINUX_ELF_FOLD_CRC32 0xfef4f1c4
unsigned char stub_amd64_linux_elf_fold[2338] = { 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, /* 0x0000 */ 127, 69, 76, 70, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -65,17 +65,17 @@ unsigned char stub_amd64_linux_elf_fold[2338] = {
/* 0x01a0 */ 239, 8, 73,141,119,248, 72,193,233, 3,243, 72,165, 72,141,103, /* 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, /* 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, /* 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, /* 0x01d0 */ 137,197, 73,137,232,232, 0, 6, 0, 0, 72,129,196, 8, 8, 0,
/* 0x01e0 */ 0, 0, 72,137, 68, 36, 32, 91, 73,139,181,136, 0, 0, 0, 76, /* 0x01e0 */ 0, 72,137, 68, 36, 32, 91, 73,139,181,136, 0, 0, 0, 76,137,
/* 0x01f0 */ 137,239, 73, 43,117, 80,232, 79, 0, 0, 0, 77, 41,201, 65,137, /* 0x01f0 */ 239, 73, 43,117, 80,232, 79, 0, 0, 0, 77, 41,201, 65,137,216,
/* 0x0200 */ 216,106, 2, 89,106, 1, 90,190, 0, 16, 0, 0, 41,255,232, 16, /* 0x0200 */ 106, 2, 89,106, 1, 90,190, 0, 16, 0, 0, 41,255,232, 16, 0,
/* 0x0210 */ 0, 0, 0,137,223,232, 40, 0, 0, 0, 95, 94,106, 11, 88, 65, /* 0x0210 */ 0, 0,137,223,232, 40, 0, 0, 0, 95, 94,106, 11, 88, 65,255,
/* 0x0220 */ 255,102,248,176, 9, 73,137,202, 15,182,192, 15, 5, 72, 61, 0, /* 0x0220 */ 102,248,176, 9, 73,137,202, 15,182,192, 15, 5, 72, 61, 0,240,
/* 0x0230 */ 240,255,255,114, 4, 72,131,200,255,195,176, 60,235, 2,176, 12, /* 0x0230 */ 255,255,114, 4, 72,131,200,255,195,176, 60,235, 2,176, 12,235,
/* 0x0240 */ 235, 2,176, 3,235, 2,176, 2,235, 2,176, 11,235, 2,176, 10, /* 0x0240 */ 2,176, 3,235, 2,176, 2,235, 2,176, 11,235, 2,176, 10,235,
/* 0x0250 */ 235, 2,176, 1,235, 2,176, 0,235,206, 0, 0, 81, 72, 57, 23, /* 0x0250 */ 2,176, 1,235, 2,176, 0,235,206, 0, 0, 0, 81, 72, 57, 23,
/* 0x0260 */ 76,139, 71, 8, 72,141, 74,255,115, 10,191,127, 0, 0, 0,232, /* 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, /* 0x0270 */ 197,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, /* 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, /* 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, /* 0x02a0 */ 137,253, 83, 72,137,243, 72,131,236, 40, 72,131, 62, 0, 15,132,
@@ -83,7 +83,7 @@ unsigned char stub_amd64_linux_elf_fold[2338] = {
/* 0x02c0 */ 239,232,150,255,255,255,139, 68, 36, 16,139,116, 36, 20,133,192, /* 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, /* 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, /* 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, /* 0x02f0 */ 232, 68,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, /* 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, /* 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, /* 0x0320 */ 213,133,192,117,198,139, 68, 36, 16, 72,139,116, 36, 8, 72, 57,
@@ -104,7 +104,7 @@ unsigned char stub_amd64_linux_elf_fold[2338] = {
/* 0x0410 */ 36, 40, 76,137, 76, 36, 32,116, 62, 72,139,132, 36,160, 0, 0, /* 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, /* 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, /* 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, /* 0x0440 */ 40, 72,141, 4, 62, 72,137, 68, 36, 72,232,211,253,255,255, 73,
/* 0x0450 */ 137,198,233,172, 0, 0, 0,102,131,127, 16, 3,184, 0, 0, 0, /* 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, /* 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, /* 0x0470 */ 72,139,132, 36,160, 0, 0, 0, 72,131,205,255, 49,219, 49,255,
@@ -114,7 +114,7 @@ unsigned char stub_amd64_linux_elf_fold[2338] = {
/* 0x04b0 */ 255,255, 72, 41,235, 72,129,195,255, 15, 0, 0, 72,129,227, 0, /* 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, /* 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, /* 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, /* 0x04e0 */ 69, 49,201, 65,131,200,255, 49,210, 72,137,222,232, 49,253,255,
/* 0x04f0 */ 255, 72,137,199, 72,141, 4, 3, 73,137,254, 72,137, 68, 36, 72, /* 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, /* 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, /* 0x0510 */ 0, 15,132,162, 2, 0, 0, 72,131,124, 36, 64, 0,116, 34, 65,
@@ -134,7 +134,7 @@ unsigned char stub_amd64_linux_elf_fold[2338] = {
/* 0x05f0 */ 50, 0, 0, 0, 73,139, 69, 8, 72,137, 84, 36, 16, 72, 41,232, /* 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, /* 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, /* 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, /* 0x0620 */ 2, 72,131,124, 36, 64, 0, 15, 68, 84, 36, 24,232,241,251,255,
/* 0x0630 */ 255, 73, 57,196, 15,133, 37, 1, 0, 0, 72,131,124, 36, 64, 0, /* 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, /* 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, /* 0x0650 */ 80, 72,139,124, 36, 64,232, 57,252,255,255, 72,139,108, 36, 16,
@@ -148,16 +148,16 @@ unsigned char stub_amd64_linux_elf_fold[2338] = {
/* 0x06d0 */ 37,255, 15, 0, 0,131,248, 3,119, 57, 73,131,125, 8, 0, 74, /* 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, /* 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, /* 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, /* 0x0700 */ 36, 4, 1, 0, 0, 0,232, 23,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, /* 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, /* 0x0720 */ 186, 5, 0, 0, 0,190, 4, 0, 0, 0, 72,137,223,232, 27,251,
/* 0x0730 */ 255,255, 72,133,219,116, 19, 72,139,124, 36, 48, 72,137,218, 49, /* 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, /* 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, /* 0x0750 */ 116, 36, 16, 76,137,231,232,242,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, /* 0x0760 */ 127, 0, 0, 0,232,208,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, /* 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, /* 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, /* 0x0790 */ 185, 50, 0, 0, 0, 76,137,231,232,133,250,255,255, 73, 57,196,
/* 0x07a0 */ 117,189,255, 68, 36, 28, 65, 15,183, 71, 56, 73,131,197, 56, 57, /* 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, /* 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, /* 0x07c0 */ 0, 76,137, 48, 77, 3,119, 24, 72,131,196,104, 91, 93, 65, 92,
@@ -173,13 +173,13 @@ unsigned char stub_amd64_linux_elf_fold[2338] = {
/* 0x0860 */ 137,247, 73,137,196,232, 59,251,255,255, 65, 89, 65, 90,102,131, /* 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, /* 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, /* 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, /* 0x0890 */ 210, 49,246,232,173,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, /* 0x08a0 */ 4, 0, 0, 72,137,238,137,199,232,168,249,255,255, 72, 61, 0,
/* 0x08b0 */ 4, 0, 0,116, 10,191,127, 0, 0, 0,232,123,249,255,255, 73, /* 0x08b0 */ 4, 0, 0,116, 10,191,127, 0, 0, 0,232,122,249,255,255, 73,
/* 0x08c0 */ 199, 7, 0, 0, 0, 0, 65, 80, 69, 49,201, 69, 49,192, 49,201, /* 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, /* 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, /* 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, /* 0x08f0 */ 255,137,223,232, 73,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, /* 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, /* 0x0910 */ 72,131,196, 72, 76,137,224, 91, 93, 65, 92, 65, 93, 65, 94, 65,
/* 0x0920 */ 95,195 /* 0x0920 */ 95,195
-1
View File
@@ -147,7 +147,6 @@ L90:
Elf32_Auxv_t *arg4, f_decompr arg5, f_unf arg6, Elf32_Auxv_t *arg4, f_decompr arg5, f_unf arg6,
Elf64_Addr elfaddr ) Elf64_Addr elfaddr )
*/ */
int3
// rsp/ elfaddr,{OVERHEAD},fd,ADRU,LENU,rdx,%entry, argc,argv,0,envp,0,auxv,0,strings // rsp/ elfaddr,{OVERHEAD},fd,ADRU,LENU,rdx,%entry, argc,argv,0,envp,0,auxv,0,strings
addq $1*NBPW+OVERHEAD,%rsp # also discard elfaddr addq $1*NBPW+OVERHEAD,%rsp # also discard elfaddr
movq %rax,4*NBPW(%rsp) # entry movq %rax,4*NBPW(%rsp) # entry
+11 -11
View File
@@ -10,17 +10,17 @@ Linker script and memory map
.text 0x00000000001000bc 0x868 .text 0x00000000001000bc 0x868
*(.text) *(.text)
.text 0x00000000001000bc 0x19e tmp/amd64-linux.elf-fold.o .text 0x00000000001000bc 0x19d tmp/amd64-linux.elf-fold.o
0x000000000010024a munmap 0x0000000000100249 munmap
0x0000000000100223 mmap 0x0000000000100222 mmap
0x0000000000100252 write 0x0000000000100251 write
0x0000000000100256 read 0x0000000000100255 read
0x000000000010023a exit 0x0000000000100239 exit
0x000000000010023e brk 0x000000000010023d brk
0x0000000000100246 open 0x0000000000100245 open
0x000000000010024e mprotect 0x000000000010024d mprotect
0x0000000000100242 close 0x0000000000100241 close
*fill* 0x000000000010025a 0x2 00 *fill* 0x0000000000100259 0x3 00
.text 0x000000000010025c 0x6c6 tmp/amd64-linux.elf-main.o .text 0x000000000010025c 0x6c6 tmp/amd64-linux.elf-main.o
0x00000000001007da upx_main 0x00000000001007da upx_main
*(.data) *(.data)