Versions checked 6 November 2026: Ghidra 12.2 is the current release. Ghidra 12.1.4 is the previous line and is covered where it differs. One standing rule: only examine files from your own computer, or files you have a clear right to study. Static analysis in Ghidra is reading, not running — the binary never executes. Anything that does run belongs in a separate test environment, never on the host.

1. What Ghidra is — and what it is not
Ghidra (pronounced GEE-druh) is a software reverse engineering framework built by the United States National Security Agency (NSA) and released as free, open-source software in March 2019, under the Apache 2.0 licence. There is no paid edition, no subscription and no licence key.
You give Ghidra a compiled program — a daemon, a library, a kernel extension — for which you have no source code. Ghidra does three things to it: it disassembles the machine code into assembly language for the right processor (for modern Apple binaries, AARCH64, the 64-bit ARM instruction set); it decompiles that assembly into readable, C-like pseudocode, so you can follow the logic at reading speed instead of instruction by instruction; and it maps the connections — which function calls which, where a string is used, what data a function touches — so you can navigate a large binary instead of reading it front to back.
It is the free peer of IDA Pro and Binary Ninja. Those two have somewhat smoother macOS and ARM64 decompilers and are worth trying later if you end up living in disassembly daily, but nothing in the work below requires them. Ghidra is what most public macOS research is written against, which matters: when a writeup names a function or a workflow, it usually maps directly onto Ghidra.
What Ghidra is not: it is not a debugger and it does not run the binary. Loading a daemon into Ghidra never executes it. Running code — breakpoints, live tracing, crash reproduction — is lldb and Frida's job, in a test environment. That split is a safety feature as much as a workflow: you can read completely untrusted code in Ghidra on the host with nothing executing.
2. Where Ghidra fits in a hunting stack
Static analysis — Ghidra: what does this code do? Where is the handler? Where is the check missing? Get the binaries — ipsw: downloads a macOS build and extracts daemons, libraries and the dyld shared cache from it. Patch diffing — Ghidra + Diaphora, or BinDiff: what changed between two builds — i.e. what Apple just patched. Dynamic analysis — lldb, Frida: what does it do with this input, live? Where exactly does it crash? Talking to services — your own XPC clients: can a low-privilege process actually reach the code path you found? Quick first look — otool, nm, strings, dyld_info: architecture, linked libraries, embedded strings — before opening Ghidra at all.
A typical hunt uses them in that order. You pull a build with ipsw, take a quick look with strings and otool, do the deep read in Ghidra, confirm reachability with a small client, and only then move to lldb or Frida in the test environment for dynamic proof.
The 30-second pre-check before Ghidra:
file /usr/sbin/bluetoothdlipo -info /usr/sbin/bluetoothdotool -L /usr/sbin/bluetoothdnm -u /usr/sbin/bluetoothd | head -50strings -a /usr/sbin/bluetoothd | grep -i "message"
On a current macOS install many system binaries live in the dyld shared cache rather than as standalone files. If a path turns out to be a thin stub or missing, extract the real binary from the cache with ipsw, or copy it out of the matching IPSW download, and analyse that file instead.
3. Before you install: version and Java must match
Ghidra is written in Java, so it needs a Java Development Kit (JDK) — the full development kit, not just a Java runtime (JRE). The single most common Ghidra failure is a version mismatch: the program refuses to start, or dies with a class-file error, because the JDK is the wrong major version for that Ghidra release.
Ghidra 12.2 (current) needs JDK 25, 64-bit. Release file: ghidra_12.2_PUBLIC_20261016.zip, about 544 MB. Ghidra 12.1.x (including 12.1.4) needs JDK 21, 64-bit — most older tutorials assume this pairing. Rule: match the pair, and write the pair down in your project notes. If you upgrade Ghidra from 12.1 to 12.2, install JDK 25 first — 12.2 will not run on JDK 21, and 12.1 was not built for JDK 25. Two JDKs can sit side by side on the same Mac; section 4 shows how to point Ghidra at the right one.
System requirements (12.2): macOS 10.13 or later; runs natively on Apple Silicon with an ARM64 JDK — no Rosetta needed. 4 GB RAM minimum. In practice give Ghidra more: large daemons and the dyld cache are hungry. 8–16 GB available to Ghidra is comfortable. About 1 GB for Ghidra itself, plus real space for projects. Budget 20 GB if you diff multiple macOS builds; projects grow fast. Python 3 (3.9 to 3.14) — only needed for the Debugger and PyGhidra scripting, not for basic CodeBrowser and decompiler work.
Download Ghidra only from the official project: the Releases page of github.com/NationalSecurityAgency/ghidra, which is also where ghidra-sre.org points you. Download the JDK from Adoptium (Eclipse Temurin) or Amazon Corretto — the two free long-term-support providers Ghidra's own Getting Started document names. Avoid repackaged mirrors: a reverse engineering tool is the last program you want to run unverified.

4. Install on macOS, step by step
Route A — the official zip (recommended). This route pins an exact version, which is what you want when a writeup or a diff depends on it.
Step 1 — Install the JDK. Download Temurin JDK 25 for macOS AARCH64 from Adoptium and run its installer, or use Homebrew: brew install --cask temurin@25. Confirm it — you want 25.x, 64-bit: java -version and /usr/libexec/java_home -V
Step 2 — Download and verify Ghidra. From the Releases page, download ghidra_12.2_PUBLIC_20261016.zip (the release asset, not the "Source code" download). Verify it against the SHA-256 published on that release page: shasum -a 256 ~/Downloads/ghidra_12.2_PUBLIC_20261016.zip — the 12.2 published value is 2c2cd776db3c1f6a097ba418922378ac3649cadd5e844a6f5f088ae628a7be67. If the hashes do not match exactly, delete the file and download it again. Do not proceed on a close match.
Step 3 — Unzip it where it will live. Ghidra has no installer — the unzipped folder is the install. Do not unzip a new version over an old one; keep them side by side: mkdir -p ~/tools, unzip ~/Downloads/ghidra_12.2_PUBLIC_20261016.zip -d ~/tools, ls ~/tools/ghidra_12.2_PUBLIC/ghidraRun
Step 4 — Build the macOS decompiler natives (first install only). The official Ghidra zip ships native decompiler components for Windows and Linux x86-64 only — under Ghidra/Features/Decompiler/os/ you will find linux_x86_64 and win_x86_64 and no macOS folder. Without this step the Decompiler pane fails with "could not find decompiler executable". Build them from the install directory, with Xcode Command Line Tools installed and JAVA_HOME on JDK 25: cd ~/tools/ghidra_12.2_PUBLIC, export JAVA_HOME=$(/usr/libexec/java_home -v 25), support/gradle/gradlew buildNatives. That writes Ghidra/Features/Decompiler/build/os/mac_arm_64/decompile — note build/os/, not os/. Then clear the quarantine flag on the built binary and make it executable: xattr -d com.apple.quarantine Ghidra/Features/Decompiler/build/os/mac_arm_64/decompile, chmod +x Ghidra/Features/Decompiler/build/os/mac_arm_64/decompile. You only do this once per Ghidra install; a fresh unzip needs it again.
Step 5 — Clear the Gatekeeper quarantine (first launch only). macOS can quarantine Ghidra itself on first launch — the downloaded zip's own files, not pre-built native components, which the zip does not ship for macOS (see Step 4). The practical fix is to remove the quarantine attribute from the install folder, then launch: xattr -dr com.apple.quarantine ~/tools/ghidra_12.2_PUBLIC, cd ~/tools/ghidra_12.2_PUBLIC, ./ghidraRun
Step 6 — Point Ghidra at the right JDK, if needed. Ghidra uses JAVA_HOME if it is set, otherwise the Java on your PATH. With two JDKs installed, set it explicitly for the launch: export JAVA_HOME=$(/usr/libexec/java_home -v 25), ./ghidraRun. If Ghidra still picks the wrong Java, edit support/launch.properties inside the Ghidra folder and set JAVA_HOME_OVERRIDE to the JDK 25 home path. That override always wins.
Step 7 — First-launch housekeeping. On first run Ghidra creates its user settings folder, asks about a project, and may offer to build a search index. Accept the defaults. If you plan to use the Debugger later, let it find your Python 3 when asked; it is safe to skip and configure later.
Route B — Homebrew (quick, less pinned). brew install ghidra. Homebrew pulls in a matching OpenJDK for you and is fine for a quick look, but it upgrades on Homebrew's schedule, not yours — a mid-study upgrade can change menus and break extensions built for the previous version. For work tied to specific builds and writeups, Route A is the safer default.
Install check: Ghidra opens to the Project window. File > New Project works, and Help > About Ghidra shows the version you expected. If instead it exits silently or complains about Java, go straight to section 13 — it is the JDK pairing, almost every time. Check the Releases page every few months and before starting a new target. Projects are forward-compatible — 12.2 opens projects from earlier releases — but a project saved by a newer Ghidra may not reopen in an older one, so upgrade deliberately, not mid-diff.
5. Set up Ghidra for a lab
Keep the analysis machine and the execution environment separate. The main Ghidra install does the heavy analysis, patch diffs and note-taking — the binaries you load there are inert files, copied in, never run there. A separate test environment (a VM or guest) is the source of the exact binaries from a given build, and the only place anything executes: lldb sessions, Frida, proof-of-concept clients.
Habits that pay off immediately: one project per target per build — name it for both, e.g. bluetoothd-26.6.2. Diffing and writeups become trivial when the build is in the project name. Keep the original file untouched — work on a copy in your project folder and record its hash (shasum -a 256 bluetoothd). Your notes should always be traceable to one exact binary. Give Ghidra memory — for a large daemon, edit support/launch.properties and raise VMARGS=-Xmx (for example -Xmx8G) if analysis feels sluggish or the decompiler times out. In CodeBrowser, Edit > Tool Options > Decompiler — keep "Eliminate unreachable code" off while learning (you want to see everything), and set a generous analysis timeout for large functions.
6. Your first project: import and auto-analysis
File > New Project. Choose Non-Shared Project, pick a folder (for example ~/ghidra-projects), name it per the rule above. File > Import File and select the binary copy. Ghidra detects the format (Mach-O) and suggests a language. Check the language: for Apple Silicon binaries it must be an AARCH64 variant (for example AARCH64:LE:64:AppleSilicon). For an Intel target it is x86:LE:64:default. A wrong language produces nonsense disassembly — if the code looks like garbage, this is why.
Accept the import options (defaults are right for a first pass) and finish. Ghidra asks whether to analyse now — say yes. Let auto-analysis finish. Watch the progress indicator at the bottom right. For a daemon this takes minutes, not seconds. Do not judge results until it completes: strings, functions and cross-references are still appearing while it runs. Double-click the program in the project to open it in CodeBrowser, then File > Save. Your renames and comments from here on are the real product — save early and often.
7. Reading a binary: the CodeBrowser windows
CodeBrowser is Ghidra's main analysis window. Five panes do almost all the work. Open any missing one from Window in the menu bar. Listing — the disassembly, address by address, with your renames and comments inline: what does the processor actually execute here? Decompiler — C-like pseudocode for the function the cursor is in, updating as you click: what is this function doing, at reading speed? Symbol Tree — functions, labels, imports and classes, searchable: does a function for X exist, and where is it? Defined Strings (Window > Defined Strings) — every string found in the binary, with its address: what error messages, service names and format strings are in here? Function Call Graph — boxes and arrows: callers above, callees below the selected function: who calls this, and what does it call?
Navigation you will use constantly: G — go to an address or symbol. Double-click a function name in the Listing or Decompiler — jump to it. Right-click a name or address > References > Show References To Address (Ctrl+Shift+F on the item) — see who references this. Search > Program Text — slower than Defined Strings, but finds text inside instructions too. L — rename a function or variable. ; — add a comment on a line in the Listing.
Read the Decompiler, verify in the Listing. The decompiler is an interpretation, and it occasionally simplifies away a check or misjudges a type. When a function looks vulnerable, confirm the detail — the comparison, the length, the cast — in the Listing before you invest in a proof of concept.

8. The core workflow: from a string to a handler
Large Apple daemons have thousands of functions. Nobody reads them linearly. The working method is to enter from something you can recognise — a string, a service name, an imported function — and follow the connections inward. This loop is most of macOS static analysis:
Pick an anchor. An error string, an XPC service name, a Mach service name, or a suspicious import such as memcpy, strcpy or xpc_dictionary_get_data. Find its cross-references. In Defined Strings, select the string, right-click > References. Ghidra lists every function that uses it. Those functions are your candidate handlers. Read the candidate in the Decompiler. Follow what happens to the incoming data: is it checked, copied, used as a length, passed on? Rename as you understand. The moment a function's job is clear, rename it (L). Rename its key variables too. Comment the reasoning, not just the fact: "length comes straight from the XPC dict, no upper bound checked before the copy on the next line" is a note you can build a report on. Climb one level. Open the Function Call Graph or the references to your function to see who calls it, and whether an unprivileged client can reach that path — an entitlement check, or the lack of one, usually sits at this level. Record the finding outside Ghidra too — function address, build, and the one-line claim — in your research notes, so the knowledge survives a closed project.
Keyboard-first summary: G go to address / symbol. L rename the selected function, label or variable. ; comment on the selected Listing line. Ctrl+Shift+E show a graph / references view for the selection. [ and ] navigate to previous / next function (Listing focus). Esc return focus after a search or jump. Bookmark liberally — a study session that ends with ten honest bookmarks and three renamed functions beats one that ends with a vague feeling of having "looked at" a daemon.
9. Worked example: a daemon and its XPC handler
The goal: start from a known log string in a macOS daemon and arrive at the daemon's XPC connection handler — the function that decides what an incoming client message means.
Step 1 — Load the exact build. Copy the daemon (or its extraction from the dyld cache) out of the test environment, hash it, and import it into a project named for that build, per sections 5 and 6. Confirm the language is AARCH64 and let auto-analysis finish completely.
Step 2 — Open Defined Strings and search. Window > Defined Strings, then filter for an error string the daemon logs when a message arrives without the field it expects — for example a "no message type" style error. Error strings are ideal anchors because the code that logs them is, by definition, the code that handles the message.
Step 3 — Follow the cross-reference. Select the string, show its references, and jump to the referencing function. That function is now your prime suspect for the message dispatcher. Rename it provisionally so you can find it again.
Step 4 — Read outward in the Decompiler. Look for the pattern around the log call: where the message type is read (typically an xpc_dictionary_get_* call), what happens on each branch, and which sub-handlers each type value dispatches to. Follow one dispatch target at a time and rename each as its job becomes clear.
Step 5 — Climb to the connection handler. Show references to your dispatcher, or open the Function Call Graph and move up. The caller that registers with the XPC or Mach service and accepts new connections is the daemon's front door. The key question there: is there an entitlement or audit-token check between "connection accepted" and "message dispatched"? Note exactly where it is — or that it is not.
Step 6 — Cross-check with a client. The dynamic counterpart is a small XPC client of your own: if a client running unprivileged can deliver a message that reaches the dispatcher you just read, the static finding is reachable. If it cannot, the blocker you hit in the client tells you where the real check lives — go find that function next.
Scope reminder: all of this is reading. Do not run an exploit, and do not test against anything but your own machines. If the string is not found: the text may be built at runtime, split across a format string, or live in a linked library rather than the main binary. Search Defined Strings for a distinctive fragment, check the imports for the logging call and follow references to that instead, or load the relevant library into the project as a second program and repeat the search there.
10. What to hunt for in a macOS daemon
Once you can reach a handler, these are the patterns that turn into bounty reports. Work through them per handler rather than per binary.
Unchecked length from the client: a length read from an XPC dictionary or packet is used in a copy or allocation with no upper-bound comparison first. Integer overflow in size maths: length multiplied or added (count × element size) in a narrow integer before an allocation, with the copy using the un-wrapped value. Dangerous copies: calls to memcpy, strcpy, strcat or sprintf where the destination size is fixed and the source is client-controlled — find them fast via Symbol Tree > Imports and their references. Type confusion on XPC input: a value fetched as one XPC type (say, a string) is used as another (data, array) without the type actually being verified. Missing or misplaced entitlement check: the handler performs the privileged action first and checks the client's entitlement afterwards — or checks a connection-level flag a client can influence. Signed / unsigned mix-ups: a signed length compared against a bound, then cast to unsigned for the copy — negative values pass the check and become huge sizes. Use after free / double handling: an object released on an error path that a later branch still dereferences — follow error exits in the Decompiler carefully. Trusting a client-supplied path: a root daemon opens, writes or loads a path taken straight from the message, with no validation — a classic privilege-escalation shape (launchd jobs and root helpers are the usual suspects).
For each candidate, the report-worthy questions are always the same three: can an unprivileged process reach it? Does the input stay attacker-controlled all the way to the dangerous operation? What is the concrete effect — crash, memory corruption, or privileged action? A crash alone proves a fault in the right function; a faulting address that moves with your input is what suggests control. Ghidra answers the first two questions; the test environment answers the third.

11. Patch diffing: let Apple show you the bug
When Apple fixes a vulnerability, the patched build tells you where the bug was: it is in the function that changed. Diffing the vulnerable and fixed builds of the same daemon is how most macOS bugs are found.
Get both builds with ipsw — the last vulnerable build and the first fixed build named in the advisory. Verify CVE IDs against Apple's advisory text before naming them in your notes. Analyse both in Ghidra, in separate projects named for their builds, with identical auto-analysis options, and let both finish. Use Ghidra's built-in Version Tracking (in the Project window: Tools or the Version Tracking icon) for a first pass — it matches functions between the two programs and highlights the ones whose bytes changed. For a deeper diff, use Diaphora, the well-known Ghidra/IDA differ: export each program's analysis from Ghidra, load both exports in Diaphora, and sort by similarity. Identical functions sink; near-identical ones — same function, small change — are your patched functions. That small change is usually an added bounds check, a new type verification, or a reordered entitlement check.
Read the changed function both ways: fixed version first (what does the new check do?), then the vulnerable version (what input slips past without it?). That input is your reproduction target — in the test environment only. Discipline: a diff produces dozens of changed functions, most of them compiler noise and refactoring. Rank by attack surface — functions reachable from an XPC or Mach handler, a parser, or a file format — before reading any of them in depth.
12. Headless mode, scripts and extensions
Everything the GUI does can be scripted, which pays off when you repeat the same analysis across builds.
~/tools/ghidra_12.2_PUBLIC/support/analyzeHeadless ~/ghidra-projects <project> -import ./<binary> -postScript Decompile -scriptPath ~/ghidra-scripts
Script Manager (Window > Script Manager, in CodeBrowser) lists hundreds of built-in scripts — string extraction, call-graph dumps, one-shot decompilation — and runs your own, in Java or Python (PyGhidra). Extensions: File > Install Extensions, then restart Ghidra. Only install extensions built for your exact Ghidra version — an extension for 12.1 may fail or misbehave on 12.2, and the Java pairing rule applies to them too.
A practical first script: dump all decompiled functions that reference a chosen import (for example every caller of a dangerous copy function) to a text file. It turns the section 10 checklist into a repeatable sweep for each new target.
13. Troubleshooting
Ghidra exits at launch or reports an unsupported class file version: JDK mismatch. Check java -version: 12.2 needs JDK 25, 12.1 needs JDK 21. Set JAVA_HOME (section 4, step 6) or JAVA_HOME_OVERRIDE in launch.properties. "No Java runtime found": only a JRE is installed, or Java is not on the PATH. Install the full JDK from Adoptium or Corretto. macOS says components are damaged or blocked, or native decompiler fails to start: Gatekeeper quarantine on first launch. Re-run the xattr -dr com.apple.quarantine command from section 4 on the install folder. Disassembly looks like random data: wrong language selected at import — AARCH64 target loaded as x86 or vice versa. Delete the program from the project and re-import with the correct language. Decompiler pane is empty or errors: auto-analysis has not finished, or the cursor is not inside a recognised function. Wait for analysis, click into a function in the Listing, and use Analysis > Auto Analyze if needed. Analysis is very slow or runs out of memory: raise the -Xmx value in launch.properties and close other large projects. The dyld shared cache in particular should be analysed in slices, not whole. An extension will not load after an upgrade: it was built for the previous Ghidra (or Java) version. Remove it via File > Install Extensions and install the build matching your current version. Project will not open after upgrading Ghidra: normal one-way step — newer Ghidra upgrades the project format. Keep a copy of the project folder before opening it in a new version if you might go back.
14. Cheat sheet and next steps
Start from text — Defined Strings > select > References > jump. Start from an API — Symbol Tree > Imports > select > References. Understand a function — Decompiler first, Listing to verify the critical detail. Find the front door — references upward from the handler to the connection setup. Keep your place — rename (L), comment (;), bookmark, every session. Compare two builds — Version Tracking first, Diaphora for the deep diff.
Next three moves, in order: (1) confirm the Ghidra and JDK pairing matches section 3 — if your existing install is 12.1.x on JDK 21, it is fine as-is; upgrade deliberately, not accidentally. (2) Re-run the section 9 walk end to end on a daemon from your test build and save the renamed project — that is the base a patch diff will sit on. (3) Pull the fixed build for a CVE you are studying with ipsw and do your first Version Tracking pass.
Sources: NSA Ghidra project, github.com/NationalSecurityAgency/ghidra — Releases page, Getting Started and What's New documents for 12.2 (JDK 25 requirement, SHA-256 cited in section 4) and the 12.1 installation guide (JDK 21), checked 6 November 2026; ghidra-sre.org.