forked from igogo-x86/HexRaysPyTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HexRaysPyTools.py
50 lines (40 loc) · 1.49 KB
/
HexRaysPyTools.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import logging
import idaapi
import HexRaysPyTools.core.cache as cache
import HexRaysPyTools.core.const as const
import HexRaysPyTools.settings as settings
from HexRaysPyTools.callbacks import hx_callback_manager, action_manager
from HexRaysPyTools.core.struct_xrefs import XrefStorage
from HexRaysPyTools.core.temporary_structure import TemporaryStructureModel
class MyPlugin(idaapi.plugin_t):
flags = 0
comment = "Plugin for automatic classes reconstruction"
help = "See https://github.com/igogo-x86/HexRaysPyTools/blob/master/readme.md"
wanted_name = "HexRaysPyTools"
wanted_hotkey = ""
@staticmethod
def init():
if not idaapi.init_hexrays_plugin():
logging.error("Failed to initialize Hex-Rays SDK")
return idaapi.PLUGIN_SKIP
action_manager.initialize()
hx_callback_manager.initialize()
cache.temporary_structure = TemporaryStructureModel()
const.init()
XrefStorage().open()
return idaapi.PLUGIN_KEEP
@staticmethod
def run(*args):
pass
@staticmethod
def term():
action_manager.finalize()
hx_callback_manager.finalize()
XrefStorage().close()
idaapi.term_hexrays_plugin()
def PLUGIN_ENTRY():
settings.load_settings()
logging.basicConfig(format='[%(levelname)s] %(message)s\t(%(module)s:%(funcName)s)')
logging.root.setLevel(settings.DEBUG_MESSAGE_LEVEL)
idaapi.notify_when(idaapi.NW_OPENIDB, cache.initialize_cache)
return MyPlugin()