fix: check cputype

This commit is contained in:
cocay 2023-12-14 10:37:56 +07:00
parent 1b3eb467a7
commit c805fc56b3

View File

@ -472,7 +472,7 @@ func (mc *MachoContext) ReworkForObjc() {
main_offset := int(mc.entryoff) main_offset := int(mc.entryoff)
var shellcode_offset int var shellcode_offset int
if mc.header.cputype == 12{ if (mc.header.cputype & 0xff) == 12{
shellcode = []uint32{ shellcode = []uint32{
0x10000008, 0x10000008,
0, // x9 = (offset end of __DATA) - (offset shellcode) 0, // x9 = (offset end of __DATA) - (offset shellcode)