Ghidra: How to run ghidra disassembler from commandline?

Created on 10 Jan 2020  路  3Comments  路  Source: NationalSecurityAgency/ghidra

Hi,

I am wondering whether it is possible to run ghidra disassembler from linux command line? I need to disassemble many files and wondering whether it is possible to use ghidra disassembler for the project.

Thanks,

Rong

Headless Question

All 3 comments

I have a similar requirement and will have a look at what "Chunfang Li" did here:

https://github.com/NationalSecurityAgency/ghidra/issues/1334

I have 900 different binaries so I am using IDA as it can be all done in the command line, finds the asm more thoroughly, can be scripted and left to run overnight (they take quite a while to analyse so sitting at at GUI is not applicable). Ghidra would be my preference going forward.

Use the analyzeHeadless option found in the support directory. I have used it to do analysis on 100's of binaries at once using a script to pull out the information I need and it worked great. My case was using it to pull out information from shared library files.

You can view the .html file in the support folder, but an example command would look like
analyzeHeadless ghidra/Projects Project/folder -scriptPath /user/scripts -preScript yourscript.java -process -recursive

Like @james-tate said, support/analyzeHeadless is what you are looking for. And like @DarrylC03 said, #1334 is a great reference, especially if you need to output the disassembly to text files.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chibicitiberiu picture chibicitiberiu  路  3Comments

loudinthecloud picture loudinthecloud  路  3Comments

Barakat picture Barakat  路  3Comments

astrelsky picture astrelsky  路  3Comments

marcushall42 picture marcushall42  路  3Comments