otool

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

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 he...

What's the trick to use otool on the mac?

I want to see the headers of an application. I try this: myMac:~ me$ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/otool [-fahlLDtdorSTMRIHvVcXm] /Developer/Platforms/TheIPhoneApplication -f The file is definitely there. but it tells me "no file found". Any idea? ...

Using otool (recursively) to find shared libraries needed by an app

I have a Cocoa app that uses otool to find required shared libraries that an app needs to function properly. For example, say I run otool -L on an app that uses QTKit.framework. I get a list of the shared libraries used by the program (including the basic frameworks like Cocoa.framework and AppKit.framework): /System/Library/Frameworks/...

Building OSX App Bundle

Hi Suppose I have have made a an osX app without using Xcode. After compiling with GCC I get an executable which is linked to several other libraries. Some of those libraries might again be dynamically linked to other non-standard system libraries Is there any tool which exists which makes an OSX App bundle by first making the required ...

How can I determine the location of disassembled code within an executable?

Hi all, I've got an executable file (C++, i386, compiled under MacOS/X Tiger, if it matters) that contains a bug. The fix for the bug is straightforward -- there's a place in the code where it calls fork() and it shouldn't. Because the fix is simple, and because recompiling the executable from scratch would be difficult at this point ...

MacOSX: How to collect dependencies into a local bundle?

I am creating a plugin application (dylib) that depends on several other libraries. These other libraries are installed on my system, but are not guaranteed to be installed on any user's system. So I need to find a way bundle the dependencies along with my application. I found that I can use otool to list or change the paths to other dy...

Problem with understanding arm assembly code structure

code is listed as follows, I want to know in the ending part 0000e0b4 001d22d0 ldrsbeq r2, [sp], -r0 does this do calculation for this line of code since it loads the address defined in the ending part 0000e03c e59f4070 ldr r4, [pc, #112] ; 0xe0b4 and why are code organized in this way? -[Cube message1]: 0000e02c ...

Why is the first column of the results from otool not continuous?

Hi, I'm sorry if this is a really noob question. I'm using otool to disassemble a file and this is the result of a method that I'm interested in: _KTDriverIsRunning: 0000000000000d98 pushq %rbp 0000000000000d99 movq %rsp,%rbp 0000000000000d9c xorl %eax,%eax 0000000000000d9e testq %rdi,%rdi 0000000000000da1 je 0x00000dac 0000000000000da...