1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

Fix bug in Mach-O stub.

modified:   amd64-darwin.macho-upxmain.exe
	modified:   amd64-darwin.macho-upxmain.h
	modified:   src/amd64-darwin.macho-upxmain.c
This commit is contained in:
John Reiser 2016-09-24 19:44:00 -07:00
parent 53c3817d4d
commit 3c786acf2b
3 changed files with 7 additions and 8 deletions

View File

@ -32,8 +32,8 @@
#define STUB_AMD64_DARWIN_MACHO_UPXMAIN_EXE_SIZE 4136
#define STUB_AMD64_DARWIN_MACHO_UPXMAIN_EXE_ADLER32 0x0ba0fe1b
#define STUB_AMD64_DARWIN_MACHO_UPXMAIN_EXE_CRC32 0x87768003
#define STUB_AMD64_DARWIN_MACHO_UPXMAIN_EXE_ADLER32 0xb100fe8b
#define STUB_AMD64_DARWIN_MACHO_UPXMAIN_EXE_CRC32 0xf5a9d4fb
unsigned char stub_amd64_darwin_macho_upxmain_exe[4136] = {
/* 0x0000 */ 207,250,237,254, 7, 0, 0, 1, 3, 0, 0,128, 2, 0, 0, 0,
@ -265,18 +265,18 @@ unsigned char stub_amd64_darwin_macho_upxmain_exe[4136] = {
/* 0x0e20 */ 1,205, 65, 57,223, 15,130,217,253,255,255, 72,131,196,120, 91,
/* 0x0e30 */ 65, 92, 65, 93, 65, 94, 65, 95, 93,195,191,127, 0, 0, 0,232,
/* 0x0e40 */ 50, 1, 0, 0, 85, 72,137,229, 65, 87, 65, 86, 65, 85, 65, 84,
/* 0x0e50 */ 83, 72,129,236, 24, 8, 0, 0, 68,139,109, 8, 76,141,101, 16,
/* 0x0e50 */ 83, 72,129,236, 24, 64, 0, 0, 68,139,109, 8, 76,141,101, 16,
/* 0x0e60 */ 72,141, 5,221,255,255,255, 72, 37, 0, 0,255,255,139, 72, 16,
/* 0x0e70 */ 133,201,116, 72, 72,131,200, 32, 49,210, 72,190, 76, 73, 78, 75,
/* 0x0e80 */ 69, 68, 73, 84,131, 56, 25,117, 6, 72, 57,112, 10,116, 14,255,
/* 0x0e90 */ 194,139,120, 4, 72, 1,248, 57,202,114,233,235, 31, 72,139, 88,
/* 0x0ea0 */ 24, 68, 15,183, 3, 73, 1,216, 76,141, 75, 2, 68,139,115,252,
/* 0x0eb0 */ 72,131,195,252, 77,133,246,116,243, 76, 41,243, 76,137,224, 72,
/* 0x0ec0 */ 131,192,240, 72,137, 4, 36, 72,141,149,208,247,255,255,185, 0,
/* 0x0ed0 */ 8, 0, 0, 72,137,223, 76,137,246,232, 31,250,255,255, 73,137,
/* 0x0ec0 */ 131,192,240, 72,137, 4, 36, 72,141,149,208,191,255,255,185, 0,
/* 0x0ed0 */ 64, 0, 0, 72,137,223, 76,137,246,232, 31,250,255,255, 73,137,
/* 0x0ee0 */ 199, 72,137,223, 76,137,246,232,146, 0, 0, 0, 73, 99,197, 73,
/* 0x0ef0 */ 137, 68, 36,248, 73,141,100, 36,240, 65,255,231, 49,192, 72,129,
/* 0x0f00 */ 196, 24, 8, 0, 0, 91, 65, 92, 65, 93, 65, 94, 65, 95, 93,195,
/* 0x0f00 */ 196, 24, 64, 0, 0, 91, 65, 92, 65, 93, 65, 94, 65, 95, 93,195,
/* 0x0f10 */ 72,139, 15, 72, 57,209,114, 52, 72,139, 71, 8, 72,133,210,116,
/* 0x0f20 */ 29, 72,137,209, 72,255,201, 68,138, 0, 72,141, 64, 1, 68,136,
/* 0x0f30 */ 6, 72,141,118, 1,117,237, 72,139, 15, 72,139, 71, 8, 72, 1,

View File

@ -659,8 +659,7 @@ upx_main(
err_exit(18);
}
for (;;) { // possibly 2 times for 'fat' binary
unsigned const fatmax = sizeof(Fat_header) + 10 * sizeof(Fat_arch);
if (fatmax!=pread(fdi, (void *)mhdr, fatmax, fat_offset)) {
if (sz_mhdr!=pread(fdi, (void *)mhdr, sz_mhdr, fat_offset)) {
ERR_LAB
err_exit(19);
}