otool

how to use otool

别说谁变了你拦得住时间么 提交于 2019-12-20 08:46:23
问题 apple suggested me to use "strings" or "otool" to dect the private api (isinf) in my code , I am totally newbie so any help how to use those tools 回答1: Open Terminal ( Ctrl + Space -> Type 'Terminal').. and print example: otool -MVv yourlib.a for help: otool --help 回答2: I use nm to inspect my binaries. Usage can't be simpler: nm <filename> It will list some weird memory-address or whatever, then a visibility character and lastly the symbol. T is public, but check out the man page of nm to

How to insert a LC_LOAD_DYLIB command into a Mach-O binary (OSX)

删除回忆录丶 提交于 2019-12-18 11:56:31
问题 I'm looking to patch a piece of abandonware with some code. The software is carbon based, so I can not use an InputManager (at least, I do not think I can). My idea was to add a dylib reference to the mach-o header, and launch a new thread when the initialization routine is called. I have mucked around with the mach-o header using a hexeditor to add the appropriate load command (LC_ LOAD_DYLIB). otool reports what I expect to see, so I'm fairly confident that the file is correctly formatted.

C std library don't appear to be linked in object file

人走茶凉 提交于 2019-12-13 05:04:48
问题 I am using a program like this with math.h function "sin" and stdio.h function"printf" used #include <stdio.h> #include <math.h> int main () { int x = sin(14); printf("hello"); return 0; } And as stated by ephemient here that libc.so and libm.so (for math functions) should have been linked with the program , though when I run otool (similar to objdump) on the object file with the option "-L" that prints the shared libraries used, None of libc.so or libm.so are printed out otool -L com_ex1.o

XCode 4, dylib & install_name_tool

只愿长相守 提交于 2019-12-10 18:12:51
问题 I'm trying to get a dylib working in my OSX project. Ive been reading a few samples, this one specifically: XCode 4 adding dylib But I still cannot get it to work. Here are the steps I have performed: Copied the testing.1.dylib to my XCode projects folder. Ran sudo install_name_tool -id @executable_path/../Frameworks/testing.1.dylib testing.1.dylib Ran: otool -L testing.1.dylib and received the following: testing.1.dylib: @executable_path/../Frameworks/testing.1.dylib (compatibility version 2

Dependencies on boost library don't have full path

拟墨画扇 提交于 2019-12-10 12:37:05
问题 I have my dynamic library built successfully with dependencies on boost libraries which were built and installed with custom prefix ( ./b2 install --prefix=PREFIX ). However, when I run otool -L on my library I get output like this: ... libboost_regex.dylib (compatibility version 0.0.0, current version 0.0.0) libboost_system.dylib (compatibility version 0.0.0, current version 0.0.0) ... Which is, unlike other dependencies, presented without full path towards these boost libraries. This

install-name-tool does not add path to library when viewed through otool?

我只是一个虾纸丫 提交于 2019-12-09 22:48:08
问题 I finished my mac app using Xcode and Qt. Now I would like to prepare it for deployment to other macs. Inorder to do that I utilized macdeployqt. I just created an app bundle with macdeployqt. However some of the libraries are missing. I attempted to follow [this][1] answer. Turns out I need to copy the missing dylib from my computer to the .app and then run install name tool. I have not gotten to the install-name tool yet as I am confused as to use -id or -change with it especially in my

install_name_tool difference between -change and -id

試著忘記壹切 提交于 2019-12-07 09:26:30
问题 I have been struggling with this concept for a while and I cannot really understand what the difference is between -change and -id .The man page states -id name Changes the shared library identification name of a dynamic shared library to name. If the Mach-O binary is not a dynamic shared library and the -id option is specified it is ignored. -change old new Changes the dependent shared library install name old to new in the specified Mach-O binary. More than one of these options can be

install_name_tool difference between -change and -id

青春壹個敷衍的年華 提交于 2019-12-05 11:48:25
I have been struggling with this concept for a while and I cannot really understand what the difference is between -change and -id .The man page states -id name Changes the shared library identification name of a dynamic shared library to name. If the Mach-O binary is not a dynamic shared library and the -id option is specified it is ignored. -change old new Changes the dependent shared library install name old to new in the specified Mach-O binary. More than one of these options can be specified. If the Mach-O binary does not contain the old install name in a specified -change option the

Matching up offsets in iOS crash dump to disassembled binary

瘦欲@ 提交于 2019-12-04 16:43:21
问题 I'm having trouble matching up the offsets in the stack traces of iOS crash dumps with offsets in the disassembly of the binary as output by otool. Can anybody confirm how in principle I match these up. For example, if I get a line in the crash dump: 0 myapp 0x00005b0a 0x1000 + 19210 would I expect the offset of the offending instruction in the binary file to be 0x5b0a, 0x4b0a.... or something else? In its decoding of the header information, otool also gives, for example, this information

install-name-tool does not add path to library when viewed through otool?

淺唱寂寞╮ 提交于 2019-12-04 15:16:24
I finished my mac app using Xcode and Qt. Now I would like to prepare it for deployment to other macs. Inorder to do that I utilized macdeployqt. I just created an app bundle with macdeployqt. However some of the libraries are missing. I attempted to follow [this][1] answer. Turns out I need to copy the missing dylib from my computer to the .app and then run install name tool. I have not gotten to the install-name tool yet as I am confused as to use -id or -change with it especially in my current scenario. Do I even need to use it ? Here is what I did so far. Step 1: Running macdeployqt - this