Очень простой плагин Ida Pro, который меняет цвет MyVar123 внутри окна псевдокода.
Проблема в том, что этот подход ограничен использованием констант ida_lines.SCOLOR_... для цвета и я хочу определить свой собственный цвет текста, например. #00FF00, как это сделать?
import idaapi, ida_kernwin, ida_lines
class ColorizeVariable(ida_kernwin.action_handler_t):
def __init__(self):
ida_kernwin.action_handler_t.__init__(self)
def activate(self, ctx):
if ida_kernwin.get_widget_type(ctx.widget) == ida_kernwin.BWN_PSEUDOCODE:
vu = idaapi.get_widget_vdui(ctx.widget)
pc = vu.cfunc.get_pseudocode()
find = "MyVar123"
vu.refresh_view(False)
for sl in pc:
sl.line = sl.line.replace(find, ida_lines.COLSTR(find, ida_lines.SCOLOR_ASMDIR))
return 0
def update(self, ctx):
return ida_kernwin.AST_ENABLE_ALWAYS
class ida_plugin_container(idaapi.plugin_t):
flags = idaapi.PLUGIN_UNL
comment = 'plugin comment'
help = 'help message'
wanted_name = "myPlugin"
wanted_hotkey = 'Shift-Q'
def init(self):
action_desc = idaapi.action_desc_t(
'myPlugin',
'Colorize Variable',
ColorizeVariable(),
'Ctrl+H',
'Colorize Variable in Pseudocode',
10)
idaapi.register_action(action_desc)
idaapi.attach_action_to_toolbar("SearchToolBar", 'myPlugin')
return idaapi.PLUGIN_OK
def run(self, arg):
pass
def term(self):
pass
def PLUGIN_ENTRY():
return ida_plugin_container()
Подробнее здесь: https://stackoverflow.com/questions/786 ... pseudocode
IDA Pro меняет цвет переменных в псевдокоде ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как выполнить сценарий Python IDA-декомпилера от IdapyThon Inside Ida Pro
Anonymous » » в форуме Python - 0 Ответы
- 19 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Как выполнить сценарий Python IDA-декомпилера от IdapyThon Inside Ida Pro
Anonymous » » в форуме Python - 0 Ответы
- 15 Просмотры
-
Последнее сообщение Anonymous
-