-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodel_browser.py
36 lines (28 loc) · 1.42 KB
/
model_browser.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
import os, sys
from binaryninja import *
from binaryninjaui import Sidebar, SidebarWidget, SidebarWidgetType
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QLabel, QVBoxLayout, QScrollArea, QWidget
from PySide6.QtGui import QImage
from binaryninjaui import UIActionHandler, UIAction, UIActionContext, UIContext
PLUGINDIR_PATH = os.path.abspath(os.path.dirname(__file__))
class AlgoProphetSidebarWidget(SidebarWidget):
def __init__(self, name: str, frame, data):
SidebarWidget.__init__(self, name)
self.datatype = QLabel("")
self.data = data
self.actionHandler = UIActionHandler()
self.actionHandler.setupActionHandler(self)
self.prev_func_offset = None
self.binary_view = None
AlgoProphet_layout = QVBoxLayout()
class AlgoProphetSidebarWidgetType(SidebarWidgetType):
def __init__(self):
icon = QImage(os.path.join(PLUGINDIR_PATH, "icon.png"))
SidebarWidgetType.__init__(self, icon, "AlgoProphet")
def createWidget(self, frame, data):
# This callback is called when a widget needs to be created for a given context. Different
# widgets are created for each unique BinaryView. They are created on demand when the sidebar
# widget is visible and the BinaryView becomes active.
return AlgoProphetSidebarWidget("AlgoProphet", frame, data)
#Sidebar.addSidebarWidgetType(AlgoProphetSidebarWidgetType())