mach-o

Xcode error “Duplicate Symbol” causing Apple Mach-O Linker Error

笑着哭i 提交于 2019-12-13 00:27:48
问题 duplicate symbol _leagueTableLoaded in: /Users/Brendan/Library/Developer/Xcode/DerivedData/2013-dbhrwzgxgwhfbqatgqpfrmqyucyu/Build/Intermediates/2013.build/Debug-iphonesimulator/2013.build/Objects-normal/i386/LTGlobalResultsViewController.o /Users/Brendan/Library/Developer/Xcode/DerivedData/2013-dbhrwzgxgwhfbqatgqpfrmqyucyu/Build/Intermediates/2013.build/Debug-iphonesimulator/2013.build/Objects-normal/i386/LTJumpToMeViewController.o duplicate symbol _showGLobalCompany in: /Users/Brendan

Reversed Mach-O 64-bit x86 Assembly analysis

冷暖自知 提交于 2019-12-12 06:25:01
问题 This question is for Intel x86 assembly experts to answer. Thanks for your effort in advance! Problem Specification I am analysing a binary file, which match Mach-O 64-bit x86 assembly . I am currently using MacOS 64 OS. The assembly comes from objdump . The problem is that when I am learning assembly, I can see variable name "$xxx", I can see string value in ascii and I can also see the callee name like "call _printf" But in this assembly, I can get nothing above: no main function:

Apple Mach O Linker warning

烂漫一生 提交于 2019-12-11 04:47:31
问题 I am getting this annoying warning Apple Mach-O Linker Warning Alignment lost in merging tentative definition _searchFlag i have declared the search flag in the constant.h file like this BOOL searchFlag I am stuck up on this issue from the past 2 days and i have tried all the possible solutions from google but none of them seems to be working. My app supports both armv6 and v7 arch for which i have added the settings but this dosent seems to be the problem, its just this bool flag that is

Calling getsectiondata from Swift

泪湿孤枕 提交于 2019-12-09 16:22:08
问题 This question and answer describe how to read data from a Mach-O section with Objective-C on modern OS X/macOS versions: Crash reading bytes from getsectbyname The described answer works. I'm trying to implement the same thing with Swift. I can't make it work. I have the following in "Other linker flags": -Wl,-sectcreate,__LOCALIZATIONS,__base,en.lproj/Localizable.strings,-segprot,__LOCALIZATIONS,r,r . This Swift code gets me the a pointer to the embedded data, until I try to run the code

Objective C - How to check if Executable can be launched (eg. terminal)

此生再无相见时 提交于 2019-12-08 04:49:58
问题 I am currently building an Executable handling application in Objective C and I just wanna know a simple code that can determine if an executable file can be launched (without launching it) or if it is just a loadable one. Thanks. 回答1: Once you've taken care of permission bits and whether the file is a Mach-O, there are three things you need to consider: File type CPU compatibility Fat binaries File type Whether your Mach-O is an executable, dylib, kext, etc., can be determined from a field

Add load command to mach-o binary

前提是你 提交于 2019-12-07 23:08:47
问题 Is it possible to add an LC_LOAD_DYLIB to a binary? There has been protection against DYLD_INSERT_LIBRARIES being used so I need another to load a dylib into an app 回答1: I open-sourced optool which does exactly this. 来源: https://stackoverflow.com/questions/8862602/add-load-command-to-mach-o-binary

Objective C - How to check if Executable can be launched (eg. terminal)

被刻印的时光 ゝ 提交于 2019-12-07 02:38:30
I am currently building an Executable handling application in Objective C and I just wanna know a simple code that can determine if an executable file can be launched (without launching it) or if it is just a loadable one. Thanks. Once you've taken care of permission bits and whether the file is a Mach-O, there are three things you need to consider: File type CPU compatibility Fat binaries File type Whether your Mach-O is an executable, dylib, kext, etc., can be determined from a field in its header. From <mach-o/loader.h> : struct mach_header { uint32_t magic; cpu_type_t cputype; cpu_subtype

MacOSX: find out if a process (given a PID) is running in 32bit or in 64bit Intel mode

泄露秘密 提交于 2019-12-06 07:22:57
I have a PID and I want to find out if the process is running in 32bit or in 64bit Intel mode. How? I can do via NSRunningApplication . [[NSRunningApplication runningApplicationWithProcessIdentifier:pid] executableArchitecture] returns the Mach-O architecture constant . This works only for GUI applications, though... 来源: https://stackoverflow.com/questions/7335245/macosx-find-out-if-a-process-given-a-pid-is-running-in-32bit-or-in-64bit-inte

Finding Offsets of Local Symbols in Shared Libraries Programmatically on OS X

扶醉桌前 提交于 2019-12-04 21:25:59
问题 I need to find the offset of a local symbol in a shared library on OS X. Local symbol as in non-exported symbol. Therefore dyld("symbol_name") will not work. I can however use nm to find these offsets, for example $ nm /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/DesktopServicesPriv | grep -e ChildSetLabel -e NodeVolumeEject 000000000006cccd T _NodeVolumeEject 000000000009dbd7 t __ChildSetLabel There we see the exported ( T ) symbol NodeVolumeEject which's offset 0x6cccd I

mach_vm_region_recurse, mapping memory and shared libraries on osx

做~自己de王妃 提交于 2019-12-04 13:40:01
问题 I'm using vm_region_recurse_64 to map out the memory for a given process, vmmap style. Trying to get a complete list of shared libraries loaded by the application by examining each library's Mach-O header in memory, however, vm_region_recurse seems to disagree with the vmmap command line tool about specifically where some of the specific memory sections begin and end. This becomes especially true in the 90000000-a0000000 system submap where most of the os shared libraries are loaded. And now