Skip to content

Commit

Permalink
poc
Browse files Browse the repository at this point in the history
  • Loading branch information
mborgerson committed Dec 17, 2024
1 parent 1056a26 commit 83e2100
Show file tree
Hide file tree
Showing 8 changed files with 431 additions and 7 deletions.
2 changes: 2 additions & 0 deletions angrmanagement/ui/icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"docs": "mdi6.book-open-page-variant",
"file": "mdi.file",
"file-open": "mdi.folder-open",
"file-save": "mdi.floppy",
"functions-view": "mdi.function",
"hex-view": "mdi.hexadecimal",
"jobs-view": "fa5s.hammer",
Expand All @@ -30,6 +31,7 @@
"strings-view": "msc.symbol-string",
"traces-view": "mdi.go-kart-track",
"types-view": "msc.symbol-class",
"explorer-view": "msc.globe",
}


Expand Down
1 change: 1 addition & 0 deletions angrmanagement/ui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ def _register_commands(self) -> None:
("View: Disassembly (Graph)", self.workspace.show_graph_disassembly_view),
("View: Disassembly (Linear)", self.workspace.show_linear_disassembly_view),
("View: Functions", self.workspace.show_functions_view),
("View: Explorer", self.workspace.show_explorer_view),
("View: Hex", self.workspace.show_hex_view),
("View: Interaction", self.workspace.show_interaction_view),
("View: Log", self.workspace.show_log_view),
Expand Down
30 changes: 25 additions & 5 deletions angrmanagement/ui/menus/file_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class RecentMenuEntry(MenuEntry):

def __init__(self, path) -> None:
self.path = path
super().__init__(path, self.action_target)
super().__init__(path, self.action_target, icon=icon("file"))

def action_target(self) -> None:
GlobalInfo.main_window.load_file(self.path)
Expand All @@ -42,8 +42,18 @@ def __init__(self, main_window: MainWindow) -> None:
self._project = main_window.workspace.main_instance.project

self._save_entries = [
MenuEntry("&Save angr database...", main_window.save_database, shortcut=QKeySequence("Ctrl+S")),
MenuEntry("S&ave angr database as...", main_window.save_database_as, shortcut=QKeySequence("Ctrl+Shift+S")),
MenuEntry(
"&Save angr database...",
main_window.save_database,
shortcut=QKeySequence("Ctrl+S"),
icon=icon("file-save"),
),
MenuEntry(
"S&ave angr database as...",
main_window.save_database_as,
shortcut=QKeySequence("Ctrl+Shift+S"),
icon=icon("file-save"),
),
MenuEntry("Save patched binary as...", main_window.save_patched_binary_as),
]
self._edit_save()
Expand All @@ -52,7 +62,12 @@ def __init__(self, main_window: MainWindow) -> None:
self.recent_menu = Menu("Load recent")
self.entries.extend(
[
MenuEntry("L&oad a new binary...", main_window.open_file_button, shortcut=QKeySequence("Ctrl+O")),
MenuEntry(
"L&oad a new binary...",
main_window.open_file_button,
shortcut=QKeySequence("Ctrl+O"),
icon=icon("file-open"),
),
*(
[]
if archr is None
Expand All @@ -71,7 +86,12 @@ def __init__(self, main_window: MainWindow) -> None:
),
self.recent_menu,
MenuSeparator(),
MenuEntry("&Load angr database...", main_window.load_database, shortcut=QKeySequence("Ctrl+L")),
MenuEntry(
"&Load angr database...",
main_window.load_database,
shortcut=QKeySequence("Ctrl+L"),
icon=icon("file-open"),
),
*self._save_entries,
MenuSeparator(),
MenuEntry("Load a new &trace...", main_window.load_trace),
Expand Down
1 change: 1 addition & 0 deletions angrmanagement/ui/menus/view_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def __init__(self, main_window: MainWindow) -> None:
MenuEntry("&Patches", main_window.workspace.show_patches_view, icon=icon("patches-view")),
MenuEntry("&Types", main_window.workspace.show_types_view, icon=icon("types-view")),
MenuEntry("&Functions", main_window.workspace.show_functions_view, icon=icon("functions-view")),
MenuEntry("&Explorer", main_window.workspace.show_explorer_view, icon=icon("explorer-view")),
MenuEntry("&Traces", main_window.workspace.show_traces_view, icon=icon("traces-view")),
MenuEntry("&Trace Map", main_window.workspace.show_trace_map_view),
MenuSeparator(),
Expand Down
5 changes: 3 additions & 2 deletions angrmanagement/ui/toolbars/file_toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from PySide6.QtGui import QIcon

from angrmanagement.config import IMG_LOCATION
from angrmanagement.ui.icons import icon

from .toolbar import Toolbar, ToolbarAction

Expand All @@ -24,7 +25,7 @@ def __init__(self, main_window: MainWindow) -> None:

self.actions = [
ToolbarAction(
QIcon(os.path.join(IMG_LOCATION, "toolbar-file-open.ico")),
icon("file-open"),
"Open File",
"Open a new file for analysis",
main_window.open_file_button,
Expand All @@ -36,7 +37,7 @@ def __init__(self, main_window: MainWindow) -> None:
main_window.open_docker_button,
),
ToolbarAction(
QIcon(os.path.join(IMG_LOCATION, "toolbar-file-save.png")),
icon("file-save"),
"Save",
"Save angr database",
main_window.save_database,
Expand Down
2 changes: 2 additions & 0 deletions angrmanagement/ui/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .data_dep_view import DataDepView
from .dep_view import DependencyView
from .disassembly_view import DisassemblyView
from .explorer_view import ExplorerView
from .functions_view import FunctionsView
from .hex_view import HexView
from .interaction_view import InteractionView
Expand All @@ -32,6 +33,7 @@
"DataDepView",
"DependencyView",
"DisassemblyView",
"ExplorerView",
"FunctionsView",
"HexView",
"InteractionView",
Expand Down
Loading

0 comments on commit 83e2100

Please sign in to comment.