GrammaTech / ddisasm

A fast and accurate disassembler
https://grammatech.github.io/ddisasm/
GNU Affero General Public License v3.0
646 stars 60 forks source link

Any support for AT&T? #45

Closed YOURLEGEND closed 2 years ago

YOURLEGEND commented 2 years ago

The assembly file generated by ddisasm are in Intel. Is there any options to generate AT&T assembly files which can be (re)assembled back by GCC?

eschulte commented 2 years ago

Yes ddisasm supports AT&T syntax output. DDisasm actually uses gtirb-pprinter to print assembly. You can first generate a GTIRB file and then generate an AT&T assembly file as follows.

ddisasm /bin/ls --ir /tmp/ls.gtirb
gtirb-pprinter /tmp/ls.gtirb -s att -a /tmp/ls.s