This is a Ghidra extension that I wrote to better support macOS security research. I use it for my own purposes, but I thought I'd also put it out here in case anyone else finds it useful.
Currently the extension has two parts:
- A Loader extension that gives loaded Mach-O binaries more friendly names in the project files (and in the Code Editor). Without it, the contents of universal Mach-O binaries will appear in the project directory named only after the architecture and CPU information. This extension will prefix those names with the parent binary name. The program name itself (used to name things such as the Data Type archive in CodeBrowser, among other things), is also similarly changed. Note that this is automatic, and not configurable.
- An analysis pass that renames functions that only call
objc_msgSend
after the selector used (in addition to a user-supplied prefix). Many of the ARM programs inside a Mach-O universal binary include functions which only callobjc_msgSend
, essentially "stubbing out" these calls. To make navigating through the code in CodeBrowser easier, this extension includes an analyzer called "Rename objc_msgSend stubs" which will rename these functions after the selector used, prefixed with a configurable prefix (by default the prefix isobjc_msgSend_
). Note that this method uses a very strict fingerprint-matching function and may not catch all of the "stubs".
I wrote this extension to handle two of the things I find myself doing often in Ghidra when working on macOS binaries. This extension helps me work faster and focus more time on reverse engineering instead of renaming things.
Probably not. This repository is really just a dumping ground for my extension and any updates will only be included as I see fit for my uses.
Of course! Feel free to use this extension however you want. To install it:
- Download a ZIP (not the Source code ZIP, but the other one) from the Releases section
- Open Ghidra
- Go to File -> Install Extensions
- Click the green + (plus) icon
- Navigate to the ZIP file and select it
- Click OK
- Close and reopen Ghidra as prompted
Sure! Just note that this really requires the use of the Eclipse IDE. I'm not really going to provide much support on how to use Eclipse for Ghidra extension development, other than to point you to official resources.
Developing Ghidra extensions on Eclipse requires GhidraDev, and instructions on how to install GhidraDev into Eclipse are located within your installation of Ghidra (at lease on v11.2) at:
{Ghidra-Installation-Folder}/Extensions/Eclipse/GhidraDev/GhidraDev_README.html#ManualInstall
Ghidra only supports loading built modules from bin/main
in the project root. Unfortunately, it seems Eclipse defaults to bin/default
, which will cause this extension to not be loaded by Ghidra when using the Run Configurations provided GhidraDev. To fix this, simply:
- Right-Click the project in Eclipse to open the context menu.
- Hover over the "Build Path" item to open the sub-menu and select "Configure Build Path".
- If not already selected, select the Source tab and change the "Default output folder" to:
{project-name}/bin/main
.
I unfortunately have not found an easy way to distribute this with the project, so (for now) this step has to be done manually.