NationalSecurityAgency / ghidra

Ghidra is a software reverse engineering (SRE) framework
https://www.nsa.gov/ghidra
Apache License 2.0
51.49k stars 5.86k forks source link

Does Ghidra have built in support for changing color for different instruction sets? #2331

Open ptr0x-real opened 4 years ago

ptr0x-real commented 4 years ago

Imagine I want to have conditional jumps displayed with one color, unconditional jumps with another and floating point instructions with a different one.

Is there an already built in feature that allows me to configure the display in a similar way?

If it isn't already supported can it be implemented via plugin using the SDK?

emteere commented 4 years ago

I don't colorizing the mnemonic in the way you describe is a feature. The default mnemonic field will color the mnemonic with a different color (default red) if you have overriden the flow of the instruction, for example changed a JMP to a call flow.

However you could extend the MnemonicFieldFactory with say MnemonicColorizedFieldFactory. First you'll need to create a new GhidraModule project in eclipse with the Eclipse GhidraDev plugin. Once you create the new field factory the current Mnemonic field can be replaced with your ColorizedMnemonic Field.

If you haven't created a plugin previously, I'd take a look at the GhidraDev_README.html in the release, or here: https://github.com/NationalSecurityAgency/ghidra/blob/master/GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/GhidraDev_README.html