Skip to content

Commit

Permalink
Add support for macOS (x86_64) (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cnly authored Apr 19, 2023
1 parent 8142d7a commit d1182c0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Ghidrathon supports the following operating systems:

* Linux
* Windows
* macOS (x86_64)

## Requirements

Expand Down
3 changes: 3 additions & 0 deletions os/mac_x86_64/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The "os/mac_x86_64" directory is intended to hold macOS native binaries
which this module is dependent upon. This directory may be eliminated for a specific
module if native binaries are not provided for the corresponding platform.
14 changes: 8 additions & 6 deletions util/configure_jep_native_binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
JEP_PY_FOLDER_NAME = "jep"
JEP_OS_LIB_NAME_WINDOWS = "jep.dll"
JEP_OS_LIB_NAME_LINUX = "libjep.so"
JEP_OS_LIB_NAME_DARWIN = "jep.cpython-%d%d-darwin.so" % sys.version_info[:2]

GHIDRA_JAVA_LIB_PATH = "lib"
GHIDRA_OS_LIB_PATH_WINDOWS = "os/win_x86_64"
GHIDRA_OS_LIB_PATH_LINUX = "os/linux_x86_64"
GHIDRA_OS_LIB_PATH_WINDOWS = "os/win_x86_64/jep.dll"
GHIDRA_OS_LIB_PATH_LINUX = "os/linux_x86_64/libjep.so"
GHIDRA_OS_LIB_PATH_DARWIN = "os/mac_x86_64/libjep.so"


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -54,11 +56,11 @@ def main(args):
logger.setLevel(logging.DEBUG)

if sys.platform in ("darwin",):
# we haven't tested MacOS enough to know for sure if we fully support it
logger.error("MacOS is not supported!")
return -1
logger.debug("Detected macOS")

if sys.platform in ("win32", "cygwin"):
os_lib_name = JEP_OS_LIB_NAME_DARWIN
os_lib_path = Path(GHIDRA_OS_LIB_PATH_DARWIN)
elif sys.platform in ("win32", "cygwin"):
logger.debug("Detected Windows OS")

os_lib_name = JEP_OS_LIB_NAME_WINDOWS
Expand Down

0 comments on commit d1182c0

Please sign in to comment.