forked from grayhatacademy/ghidra_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFluorescence.py
28 lines (21 loc) · 819 Bytes
/
Fluorescence.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#Highlight or un-highlight function calls.
#@author fuzzywalls
#@category TNS
#@menupath TNS.Un/Highlight Function Calls
from java.awt import Color
from ghidra.program.model.symbol import RefType
answer = askChoice('Highlight?',
'Highlight or un-highlight function calls?',
['highlight', 'un-highlight'],
'highlight')
# Dull yellow color.
highlight_color = Color(250, 250, 125)
code_manager = currentProgram.getCodeManager()
image_base = currentProgram.getImageBase()
instructions = code_manager.getInstructions(image_base, True)
for ins in instructions:
if ins.getFlowType().isCall():
if answer == 'highlight':
setBackgroundColor(ins.getAddress(), highlight_color)
else:
clearBackgroundColor(ins.getAddress())