Skip to content

Commit b15403c

Browse files
committed
Finding and extracting blobs using unblob API
1 parent 09b1b51 commit b15403c

File tree

3 files changed

+509
-21
lines changed

3 files changed

+509
-21
lines changed

__init__.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
"""Binary Ninja plugin for identifying and extracting files from container formats using Unblob
22
"""
33

4-
from binaryninja import core_ui_enabled
4+
import platform
5+
from os import environ
6+
from binaryninja import core_ui_enabled, log_warn
57
from binaryninjaui import Sidebar
68

79
from .sidebar import BlobExtractorSidebarType
810

11+
12+
def _set_path_environ() -> None:
13+
# This is a hack because unblob doesn't set shell=True when calling subprocess.run
14+
if platform.system() == "Darwin" and "/opt/homebrew/bin" not in environ["PATH"]:
15+
log_warn("adding /opt/homebrew/bin to PATH")
16+
environ["PATH"] += ":/opt/homebrew/bin"
17+
18+
19+
_set_path_environ()
20+
921
if core_ui_enabled() is True:
1022
Sidebar.addSidebarWidgetType(BlobExtractorSidebarType())

0 commit comments

Comments
 (0)