From 1b3eb467a718239565edc92c468d5f976515dbe1 Mon Sep 17 00:00:00 2001 From: cocay Date: Wed, 8 Nov 2023 22:36:28 +0700 Subject: [PATCH] fix x86_64 shellcode --- macho-go/pkg/ios/macho/edit.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/macho-go/pkg/ios/macho/edit.go b/macho-go/pkg/ios/macho/edit.go index 673df36..8ee12a9 100644 --- a/macho-go/pkg/ios/macho/edit.go +++ b/macho-go/pkg/ios/macho/edit.go @@ -471,9 +471,9 @@ func (mc *MachoContext) ReworkForObjc() { ins_size_byte := 4 main_offset := int(mc.entryoff) var shellcode_offset int - + if mc.header.cputype == 12{ - shellcode := []uint32{ + shellcode = []uint32{ 0x10000008, 0, // x9 = (offset end of __DATA) - (offset shellcode) 0x8B090108, @@ -514,7 +514,7 @@ func (mc *MachoContext) ReworkForObjc() { fmt.Printf("// lc_main_offset=%x\n", lc_main_offset) } else { // TODO: fix to work with offset larger than 0xffff - shellcode := []uint32{ + shellcode = []uint32{ 0x00058d4c, 0x66000000, 0, // offset