Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

GRMrGecko

macrumors member
Original poster
Jun 7, 2008
89
0
Nowhere and everywhere
Hello, I'm trying to find a disassembler for Mach-O mac Binary file, I can't really find one that works the way I expect it. The one I found to be the closest is objconv at http://www.agner.org/optimize/ but it's syntax output isn't correct for GAS or also know as AT&T. The sections that come from C, such as cstring, causes a problem since the gnu assembler doesn't know about it. When I get the raw code from gcc, it works fine. Reason I'm asking is because I'm trying to learn Assembly and it'll be nice to have something that outputs right code from a Mach-O binary.

Thanks for any tips,
Mr. Gecko
 
I wouldn't bother trying to learn by disassembling things.

Your best bet is just to compile C code with -S flag for gcc which will output assembly from the C rather than a binary.
 
otool is the name of the disassembler in Mac OS X. It works similar to GNU's objdump (but for Mach-O binaries instead of ELF.) Read the man page.
 
otool is the name of the disassembler in Mac OS X. It works similar to GNU's objdump (but for Mach-O binaries instead of ELF.) Read the man page.

Objdump supports Mach-O binaries, I'm using it now to help me in making this assembly code all right. I also know of OTX and am using it as well. No I'm not using this to steal apps, using it for educational reasons and finding out how hard it'll be to crack my own app that I have source code to and all of that. I don't want to use GCC -S to do this.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.