fix x86_64 shellcode

This commit is contained in:
cocay 2023-11-08 22:36:28 +07:00
parent 54f61f36ab
commit 1b3eb467a7

View File

@ -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