Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nstarke/a6d2b938917957cd04a5bcfdeeef58b2 to your computer and use it in GitHub Desktop.
Save nstarke/a6d2b938917957cd04a5bcfdeeef58b2 to your computer and use it in GitHub Desktop.
Ghidra Address Iteration Bruteforce Disasemble
import ghidra.app.script.GhidraScript
# I noticed that on some microcontrollers the ghidra analyzer doesn't auto analyze the entire binary.
# This Ghidra Script will iterate over every address in a binary and attempt to disassemble it.
counter = 0
nextAddress = currentProgram.getMinAddress()
while nextAddress:
if disassemble(nextAddress):
counter = counter + 1
nextAddress = nextAddress.next()
print ("Total Addresses Analyzed: " + str(counter) + " | Language ID: " + currentProgram.getLanguageID().toString() + " | ")
@ryanmkurtz
Copy link

Have you tried the Aggressive Instruction Finder analyzer?

@nstarke
Copy link
Author

nstarke commented Sep 23, 2019

Yes, that doesn't always work either in the specific cases I am looking at.

@ryanmkurtz
Copy link

Ah ok. If you think it should (not sure what your specific cases are), feel free to submit an issue to us and we can take a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment