Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 579 Vote(s) - 3.48 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disassemble into x86_64 on OSX10.6 (But with _Intel_ Syntax)

#1
I know of `otool -tv`, but I would much rather use the _Intel_ syntax rather than AT&Ts, mainly to easily follow along in a book and not have to look over thousands of `%`'s and `$`'s.

I'd also appreciate any tips to where I might find `gdb`'s config file.

EDIT: I forgot: I'm running a 64bit processor, but was wondering if it would be possible to also disassemble into 32 bit assembly? Not only that, but does OSX's `gdb`'s `list` command work differently than the standard `GNU` version?

Thanks so much!

(Also, if you have any idea where I might find a little disassembler from C -> MIPS, that'd be very fun to play with. But not necessary!)

Reply

#2
You can use A2I to translate from AT&T to Intel syntax:

[To see links please register here]

Reply

#3
With [Objdump](

[To see links please register here]

) you can disassemble with `-d -M intel`, and apparently `-m` can be used to specify the architecture.
Reply

#4
To answer your second question, if the code has been compiled into a fat binary with both 64-bit and 32-bit, you can use `otool -arch i386 -tv` to disassemble the 32-bit slice of the binary; `otool -arch x86_64 -tv` will give you the 64-bit portion (on SnowLeopard, this is also the default behavior if no `-arch` flag is passed).

Also note that while otool doesn't support the Intel syntax, gdb (`set disassembly-flavor intel`) and XCode (Preferences -> Debugging -> Disassembly Style) do.
Reply

#5
For GDB, in your .gdbinit file, add:

> set disassembly-flavor intel

then it will be the default syntax for gdb.
Reply

#6
(I know this is an old question, but I want to provide an updated answer for people who come here through search engines).

On recent versions of macOS (I'm running 10.14.5), an `objdump` command is available, which is based on LLVM and is *not* the one from the GNU project. It offers a (hidden) option to disassemble using Intel syntax. For example, `/bin/echo` can be disassembled as follows:

objdump -disassemble -x86-asm-syntax=intel /bin/echo
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through