-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path__init__.py
28 lines (24 loc) · 1.64 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
from binaryninja import PluginCommand
from . src.settings import OpenAISettings
from . src.entry import check_function, rename_variable
# Register the settings group in Binary Ninja to store the API key and model.
OpenAISettings()
PluginCommand.register_for_high_level_il_function(r"OpenAI\What Does this Function Do (HLIL)?",
"Checks OpenAI to see what this HLIL function does." \
"Requires an internet connection and an API key "
"saved under the environment variable "
"OPENAI_API_KEY or modify the path in entry.py.",
check_function)
PluginCommand.register_for_function(r"OpenAI\What Does this Function Do (Pseudo-C)?",
"Checks OpenAI to see what this pseudo-C function does." \
"Requires an internet connection and an API key "
"saved under the environment variable "
"OPENAI_API_KEY or modify the path in entry.py.",
check_function)
PluginCommand.register_for_high_level_il_instruction(r"OpenAI\Rename Variable (HLIL)",
"If the current expression is a HLIL Initialization " \
"(HighLevelILVarInit), then query OpenAI to rename the " \
"variable to what it believes is correct. If the expression" \
"is not an HighLevelILVarInit, then do nothing. Requires " \
"an internet connection and an API key. ",
rename_variable)