-
Notifications
You must be signed in to change notification settings - Fork 24
/
__init__.py
67 lines (62 loc) · 1.9 KB
/
__init__.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import traceback
import os
from binaryninjaui import Sidebar
from binaryninja import PluginCommand
from .utility.expr_wrap_util import split_bv_in_list
from .utility.bninja_util import get_address_after_merge
from .utility.string_util import (
int_to_str,
str_to_int,
as_bytes,
get_byte,
str_to_bv_list,
str_to_bv,
constraint_alphanumeric_string,
constraint_ascii_string
)
from .models import function_models as seninja_models
from .expr import BVV, BVS, BV, And, Or, ITE
from . import settings
from .apis import (
get_current_state,
register_hook,
register_logger,
get_stdin_bv,
get_stdout_bv,
reload_settings
)
from .globals import Globals
from .ui.ui_manager import UIManager
from .ui.seninja_widget import SENinjaWidgetType
Globals.uimanager = UIManager()
Sidebar.addSidebarWidgetType(SENinjaWidgetType())
PluginCommand.register(
"SENinja\\Setup argv...",
"Setup argv for the current function",
lambda bv: Globals.uimanager.launch_argv_dialog()
)
PluginCommand.register_for_address(
"SENinja\\Select state",
"Select the state at the current address",
lambda bv, addr: Globals.uimanager.async_change_current_state(addr)
)
PluginCommand.register_for_address(
"SENinja\\Set ip",
"Set the instruction pointer of the current state to the selected address",
lambda bv, addr: Globals.uimanager.async_change_active_state_ip(addr)
)
PluginCommand.register_for_address(
"SENinja\\Merge states",
"Merge all the states at the current address",
lambda bv, addr: Globals.uimanager.async_merge_states(addr)
)
PluginCommand.register_for_address(
"SENinja\\Mark as address to reach",
"Set the destination address",
lambda bv, addr: Globals.uimanager.set_run_target(addr)
)
PluginCommand.register_for_address(
"SENinja\\Mark as address to avoid",
"Set the avoid address",
lambda bv, addr: Globals.uimanager.set_run_avoid(addr)
)