From 8aa01bfbcd3ff0fdcca20c69a0567c0482ebb8ad Mon Sep 17 00:00:00 2001 From: usiegl00 <50933431+usiegl00@users.noreply.github.com> Date: Fri, 30 Sep 2022 06:46:45 +0900 Subject: [PATCH] Back from the dyld: fix addr_main assignment. When using the legacy technique, addr_main was being redifined. This caused the access to addr_main outside the if statement to segfault. --- external/source/shellcode/osx/stager/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/external/source/shellcode/osx/stager/main.c b/external/source/shellcode/osx/stager/main.c index 73eeac2792..0532a6500d 100644 --- a/external/source/shellcode/osx/stager/main.c +++ b/external/source/shellcode/osx/stager/main.c @@ -699,7 +699,7 @@ int main(int argc, char** argv) return 1; } - void * addr_main = NSAddressOfSymbol_func(sym_main); + addr_main = NSAddressOfSymbol_func(sym_main); if (!addr_main) { return 1; } @@ -707,7 +707,6 @@ int main(int argc, char** argv) #ifdef DEBUG print("found main!\n"); #endif - }; int(*main_func)(int, char**) = (int(*)(int, char**))addr_main; char* socket = (char*)(size_t)argc;