mach-o

Alternative for .string pseudo op?

心不动则不痛 提交于 2019-12-02 18:39:49
问题 I am trying to run an assembly file on Mac OS X that uses .string pseudo-ops, which apparently aren't recognized. How should the following lines be replaced so it will work on a mac? ArrayIndexOutOfBoundsException: .long 35 .string "Array index out of bounds exception" The line I am using to execute the assembly file is: gcc -m32 -g3 runtime.c foo.s -o foo Where runtime.c is a file with functions that can be invoked by foo.s program. 回答1: .asciz , or if you don't have that then whatever you

How to insert a LC_LOAD_DYLIB command into a Mach-O binary or join a static library to an existing binary (IOS)

僤鯓⒐⒋嵵緔 提交于 2019-12-02 18:27:40
This is the first time I am asking on stackoverflow and I am desperate. My task is to load a dylib or join a static lib to an already existing executable for an IOS device. I will be using the static void __attribute__((constructor)) initialize(void) to start the swizzling. This executable is for in house enterprise appstore so i do not need to go thru the apple appstore (since they will reject it). The reason for this is to take an existing IPA from a customer and their signing keys and add a new functionality to their application without requiring a developer intervention. There is one

Alternative for .string pseudo op?

主宰稳场 提交于 2019-12-02 12:26:20
I am trying to run an assembly file on Mac OS X that uses .string pseudo-ops, which apparently aren't recognized. How should the following lines be replaced so it will work on a mac? ArrayIndexOutOfBoundsException: .long 35 .string "Array index out of bounds exception" The line I am using to execute the assembly file is: gcc -m32 -g3 runtime.c foo.s -o foo Where runtime.c is a file with functions that can be invoked by foo.s program. .asciz , or if you don't have that then whatever you have for ascii text and add a terminating 0 byte manually. Update : if you have .asciz then just use that in

Mach-o Linker Error

巧了我就是萌 提交于 2019-12-02 07:18:50
问题 I can't build my project because I keep getting this error. As I understood it deals with the constant tagShift I'm using in my code. I would appreciate if anyone could help me to solve this issue 回答1: I had faced the same issue someday and figured out the result as: Here You have a int tagShit of constant type . So you can not make constant type variables of same name in two or more classes. Change that tagShit variable name in one of the class (may be as tagShift1 or anything else) and it

Base addresses (Program Counters) of symbols (methods and functions) do not match. Off by 1

谁说我不能喝 提交于 2019-12-02 06:45:51
I have some code in my app that sends me the stack trace of uncaught exceptions. "0 CoreFoundation 0x3ad073ff <redacted> + 186", "1 libobjc.A.dylib 0x39412963 objc_exception_throw + 30", "2 CoreFoundation 0x3ad0729d <redacted> + 0", "3 Foundation 0x39f3b7b3 <redacted> + 90", "4 UIKit 0x34a3ae29 <redacted> + 4184", "5 MyApp 0x0001feab -[MAMyClassA firstMethod:withParameter1:andParameter2:] + 374", "6 MyApp 0x000f76b5 -[MAMyClassB secondMethod:withParameter1:andParameter2:] + 164", "7 UIKit 0x34bd0fe1 <redacted> + 84", "8 UIKit 0x34af2047 <redacted> + 70", "9 UIKit 0x34af1ffb <redacted> + 30",

Mach-o Linker Error

亡梦爱人 提交于 2019-12-02 04:04:40
I can't build my project because I keep getting this error. As I understood it deals with the constant tagShift I'm using in my code. I would appreciate if anyone could help me to solve this issue I had faced the same issue someday and figured out the result as: Here You have a int tagShit of constant type . So you can not make constant type variables of same name in two or more classes. Change that tagShit variable name in one of the class (may be as tagShift1 or anything else) and it will be good to go. Hope it'll help you. I guess you have included TrafficLightG.h in more than one file.

duplicate symbols for architecture arm64 (Xcode error)

谁说胖子不能爱 提交于 2019-12-01 17:36:49
I deleted all reference to GoogleMobileAdsSDKiOS-7.1 from my project and added 7.4.1. When I ran app on simulator everything works fine but when running on device I get App Mach-O Linker Error. duplicate symbol l017 in: /Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS- 7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADAdNetworkJavaScriptAdViewDelegate.o) /Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADRewardBasedVideoAd+Mediation.o) duplicate symbol l018 in: /Users/ib/Desktop/Monster GoogleAds7.4.1

duplicate symbols for architecture arm64 (Xcode error)

此生再无相见时 提交于 2019-12-01 16:28:23
问题 I deleted all reference to GoogleMobileAdsSDKiOS-7.1 from my project and added 7.4.1. When I ran app on simulator everything works fine but when running on device I get App Mach-O Linker Error. duplicate symbol l017 in: /Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS- 7.4.1/GoogleMobileAds.framework/GoogleMobileAds(GADAdNetworkJavaScriptAdViewDelegate.o) /Users/ib/Desktop/Monster GoogleAds7.4.1/GoogleMobileAdsSdkiOS-7.4.1/GoogleMobileAds.framework/GoogleMobileAds

fork Cocoa process and re-init Cocoa. how?

时光总嘲笑我的痴心妄想 提交于 2019-12-01 13:18:50
I tried to fork() a Cocoa process and setup a new Cocoa/ObjC environment but I get the error: The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec(). Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug. Is there a way to re-initialize Cocoa/ObjC in the forked process? I know that the documentation about fork() does say it is limited, however I wonder if there is still a way to do it, not just what the documentation says. I tried to read the source code of the XNU kernel which handles

Position Independent Code pointing to wrong address

左心房为你撑大大i 提交于 2019-12-01 10:59:03
I have a small example program written in NASM(2.11.08) targeting the macho64 architecture. I'm running OSX 10.10.3: bits 64 section .data msg1 db 'Message One', 10, 0 msg1len equ $-msg1 msg2 db 'Message Two', 10, 0 msg2len equ $-msg2 section .text global _main extern _printf _main: sub rsp, 8 ; align lea rdi, [rel msg1] xor rax, rax call _printf lea rdi, [rel msg2] xor rax, rax call _printf add rsp, 8 ret I'm compiling and linking using the following command line: /usr/local/bin/nasm -f macho64 test2.s ld -macosx_version_min 10.10.0 -lSystem -o test2 test2.o When I do an object dump on the