1
0
mirror of https://github.com/upx/upx.git synced 2025-08-07 22:46:51 +08:00

Look for PackHeader in the right place.

https://github.com/upx/upx/issues/606
	modified:   p_mach.cpp
This commit is contained in:
John Reiser
2022-10-11 08:08:55 -07:00
committed by Markus F.X.J. Oberhumer
parent 48ad5513ff
commit 72613d06a5

View File

@ -1724,7 +1724,7 @@ int PackMachBase<T>::canUnpack()
}
int const small = 32 + sizeof(overlay_offset);
unsigned bufsize = 4096;
unsigned bufsize = 4096 + sizeof(PackHeader);
if (391 == style) { // PackHeader precedes __LINKEDIT
fi->seek(offLINK - bufsize, SEEK_SET);
} else
@ -1740,7 +1740,7 @@ int PackMachBase<T>::canUnpack()
}
} else
if (395 == style) {
fi->seek(offLINK - bufsize - sizeof(PackHeader), SEEK_SET);
fi->seek(offLINK - bufsize, SEEK_SET);
}
MemBuffer buf(bufsize);
MemBuffer buf3(bufsize);