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.
Load command 63 cmd LC_LOAD_DYLIB cmdsize 60 name @executable_path/libAltInput.dylib (offset 24) time stamp 1183743291 Fri Jul 6 19:34:51 2007 current version 0.0.0 compatibility version 0.0.0
However, launching the binary gives me the following error
dyld: bad external relocation length
All I can guess this means is that I need to modify the LC_ SYMTAB or LC_ DYNSYMTAB sections...
Anyone have any ideas?