
Table of contents
24
By Salman Khan, OSCP+, Founder of XHack, SRT (Synack Red Team member)
Read this in 30 seconds: Most reverse engineering guides teach you to open a disassembler and start reading, and that is the slowest way to begin. This reverse engineering guide puts triage first, then reading, then a check of every claim against the real program, whether a person or an AI agent made the claim.
- Triage beats reading from the top, but only if you rank the functions first. On three small practice binaries a 250-line script put the function that mattered first in three of three cases, and on the real 3,765-function redis-server binary it cut the disassembly from about 3.6 million tokens to about 118,000 for a top-3 shortlist.
- The shortlist can miss. On one practice binary the function with the hidden debug token ranked fourth of five, so a top-3 packet would have skipped it, and I show that miss below.
- An AI reading is a claim, not a finding. On a 2026 benchmark the best decompiler and model pair reached 22.3% behavioural overlap but only 1.2% exact output match, so every claim needs a test.
- A written claim can be run. A 12-character hash claim matched the real binary on 18 of 18 test inputs, and the same claim with one step removed failed on 2.
- Free learning material exists, but it is dated. The best free book’s newest dated item is a 2021 translation and the Windows classic is from 2012, so this guide pairs them with 2026 tools.
Reverse engineering is a loop of ranking, reading and checking, and the part most beginners skip is the checking. In reverse engineering, speed comes from reading less, not from reading faster. An AI agent speeds up the reading, but it does not replace the check, and in my tests the ranking step saved the most time.
This reverse engineering guide covers one complete reverse engineering workflow in six steps, on practice programs I wrote and compiled for it, with the scripts and real output. It is for reverse engineering of software you own or are allowed to analyse. If you want the tool landscape instead, see AI reverse engineering, and for decompilers specifically, AI decompiler.

A good reverse engineering guide teaches a loop, not a tool. The loop is: decide what question you are answering, rank what to read, read it, write down a claim, test the claim, record the result. Tools for reverse engineering change every year, the loop does not.
Here is why most guides fail at it. The two beginner guides I could read in full while researching this one, a Margin Research essay from 2021 and an Intezer series updated in November 2026, give no standalone script, no step where you test what you think a function does, and no mention of working with an AI agent. A third result, a gated e-book page, showed me nothing to judge. That is a sample of three, so treat it as a pattern, not a census.
The six steps below fit one picture, and the second image shows them in order.

You do not need to buy anything to start reverse engineering. Here is what I verified on the vendors’ own pages on 25 November 2026, because the free tiers have limits that decide what you can open.
| Tool | Cost | What it covers | Catch |
|---|---|---|---|
| Ghidra | Free, Apache-2.0 | Disassembler and decompiler, scripting, many architectures | Version 12.2 shipped on 22 October 2026, and AI help comes from add-ons |
| IDA Free | Free, non-commercial | x86 and x86-64 only, cloud decompiler for those | No IDAPython or SDK, so it cannot open arm64 files such as the ones in this guide |
| Binary Ninja Free | Free, non-commercial or evaluation | Disassembly, HLIL and Pseudo C for x86, x86-64, ARMv7 and AArch64 | No API or plugins |
| Binary Ninja Cloud | Free, in the browser | PE, Mach-O and ELF | You submit the binary to Vector 35 and there is no API |
| objdump, otool, strings | Free, built into macOS and Linux | Raw disassembly, headers, strings | No decompiler, no naming help |
The last row matters more than it looks. Everything in this guide runs on objdump, otool and strings, which every machine already has, so you can follow along without installing a disassembler. When you move to Ghidra or Binary Ninja for serious reverse engineering you use the same loop.
Sources: the Ghidra releases page for the version and date, Binary Ninja’s free page and Hex-Rays’ IDA Free page for the limits.
Write the question before you open the file, because it decides what counts as an answer. “What does this do?” is not a question. “Does this updater send anything before the user clicks Check?” is one.
Good reverse engineering is documented from the first minute, so write down three more things in a text file next to the sample: where the sample came from, what you are allowed to do with it, and what you will not do. Treat this as your scope file. It costs five minutes and it is what an AI agent needs to read before it touches anything.
In the United States, circumvention is the risk for reverse engineering, and a 2024 rule helps. The Copyright Office renewed the exemption for good-faith security research in its final rule of 28 October 2024, with no opposition filed, and it is limited to research that meets the rule’s conditions. Read the text of the final rule before you rely on it. The Copyright Office issued a proposed rule for its next cycle on 28 October 2026, with first-round comments due 7 December 2026, so its 2027 proceeding page is worth a look. The 2024 rule stays in force meanwhile.
In the European Union, reverse engineering by decompilation is allowed for interoperability and little else. Article 6 of Directive 2009/24/EC lets a licensee decompile only where the interoperability information was not readily available, only the parts needed, and not to make a similar program. The UK-archived copy of the article is readable. The official EUR-Lex page returned an empty page in my research, so I cite the archived copy.
None of this is legal advice. Contracts, licences and local law can add limits, so if the sample is not yours and not clearly yours to study, ask before you start. The practice programs here are mine.
Start reverse engineering by learning what the file is, not what it does. Three commands answer it: file for the format and architecture, otool -L for libraries, and strings for readable text.
file build/keycheck
# build/keycheck: Mach-O 64-bit executable arm64
I wrote three small C programs for this reverse engineering guide and compiled them with clang -O0 -fno-inline, then stripped the symbols, which is what a real target looks like. Each has a twin with symbols left in, so I can check the ranking against ground truth afterwards. They are benign.
| Practice binary | What it hides | Functions |
|---|---|---|
| keycheck | A licence-key check using a hash and a compare constant | 6 |
| stringvault | Three strings stored under a single-byte XOR key | 5 |
| updater | A hidden debug token and a network version check (built, never run against a network) | 5 |
I use -O0 -fno-inline on purpose. At -O1 the compiler folded everything into main, and one function leaves nothing to rank. That is a real limit of any function-ranking approach and I return to it in the limits section.
Triage means ranking functions by how likely they are to matter, so your first hour goes to the right ten percent. A person doing reverse engineering by hand does this with a feel for names and imports. A script can do it the same way every time, and an agent can use the output as its starting point.
I wrote re_triage.py, 250 lines of standard-library Python. It asks objdump for the disassembly and the function starts, splits the code into functions, and records five things per function: the imports it calls, the strings it loads, XOR instructions inside a loop, constants built from mov and movk pairs, and size. Then it scores each function with fixed weights. It never runs the target.
| Signal | Points | Why it matters |
|---|---|---|
| Network import (socket, connect, send, recv, getaddrinfo) | 3 each, up to two | Talking to the outside |
| Compare import (strcmp, memcmp) | 2 each, up to two | Checks and comparisons |
| Crypto import | 4 each, up to two | Keys and hashes |
| Process import (system, execve, popen, dlopen) | 4 each, up to two | Running other code |
| File import | 1 each, up to two | Reading and writing |
| XOR inside a loop | 4 | Classic string and data decoding |
| 32-bit constant built from mov and movk | 3 each, capped at 6 | Hash seeds, magic numbers |
| An interesting string (URL, path, token, key, debug) | 1 | Readable hints |
| Size | up to 2 | Bigger functions hide more |
The weights are my choice, set by hand and checked on these three programs, so they are a starting point and not a benchmark. The part that gets constants out of the disassembly is short, and it shows the idea well:
def build_constants(body):
"""Track mov/movk pairs into 32 bit constants per register (w registers)."""
regs, found = {}, set()
for i in body:
parts = [p.strip() for p in i["args"].split(",")]
if i["op"] in ("mov", "movz") and len(parts) >= 2 and parts[0].startswith("w"):
m = HEX_RE.search(parts[1])
if m:
regs[parts[0]] = int(m.group(1), 0)
if regs[parts[0]] > 0xFFFF:
found.add(regs[parts[0]])
elif i["op"] == "movk" and len(parts) >= 2 and parts[0] in regs:
m = HEX_RE.search(parts[1])
shift = int(re.search(r"lsl\s*#(\d+)", i["args"]).group(1)) if "lsl" in i["args"] else 0
if m:
regs[parts[0]] = (regs[parts[0]] & ~(0xFFFF << shift)) | (int(m.group(1), 0) << shift)
found.add(regs[parts[0]])
return sorted(c for c in found if c > 0xFFFF)
On keycheck the script ranked six functions. The hash function came first with a score of 7 and two constants, 0x811c9dc5 and 0xdcdfd936. The next function, ranked second, was the small step that mixes each character into the hash.
rank addr score size imports / notes
1 0x100000658 7 46 toupper consts 0x811c9dc5 0xdcdfd936
2 0x100000710 3 20 consts 0x01000193
3 0x100000460 2 48 (libc noise only) "licence accepted"
Ground truth from the unstripped twin says 0x658 is check_key and 0x710 is mix. On stringvault the decoder unvault ranked first, and on updater the network function fetch_version ranked first.
| Practice binary | The function that matters | Rank | Packet vs whole (est. tokens) |
|---|---|---|---|
| keycheck | check_key | 1 of 6 | 1,273 of 2,073 |
| stringvault | unvault | 1 of 5 | 918 of 1,310 |
| updater | fetch_version | 1 of 5 | 2,372 of 2,736 |
Three of three on programs I wrote and tuned against is a weak claim, and I am not asking you to trust it. The honest reading is that the ranking is not obviously broken, and the next section is where it is tested on code I did not write.
The reason to triage before using an agent is cost and attention, not capability. A model can read a lot, but a long context full of boilerplate dilutes the part that matters, and every token is billed.
I ran the same script on a real program: the redis-server binary from a Homebrew install (arm64, version 8.10.2, about 2.4 MB, open source, so analysing it is fine). I did not read it, I only measured the funnel.

The numbers from that run:
Two cautions. First, the top function (score 23, 6,218 instructions) is one huge block, and a packet of the top three is not small in absolute terms, because the biggest functions also score highest. Second, I have no list of what matters in redis, so I cannot say the ranking is right, only that it is sensible. This build still has its symbols and the script never reads them, so I used them afterwards as a check: the top four are main, serverCron (the periodic housekeeping job), readSyncBulkPayload (replication) and rdbSaveRio (writing snapshots to disk), which are central routines in that program.
Give the agent the packet, a short scope note, and one question. This is the prompt shape I use, written out:
Scope: I own this binary. Static analysis only, do not run anything.
Question: Which of these functions can send data off the machine, and when?
Here are the top 3 functions by triage score, with disassembly and the strings
they load. For each function: say what it does in one sentence, list the
evidence (instruction addresses), and mark each statement CERTAIN or GUESS.
Do not rename anything until I ask.
The “CERTAIN or GUESS” instruction is not magic, but it makes the next step cheaper, because you know which sentences to test first. Ghidra MCP with Claude Code shows how to wire the same question to a live Ghidra project, and the IDA Pro AI guide covers what Hex-Rays shipped.
Programs hide strings, and decoding them is the first win in reverse engineering that feels like magic. The common cheap trick is a single-byte XOR over a table. The triage script already flagged unvault with a score of 4 and the note “XOR in loop”.
I wrote xor_probe.py for the check that comes next. It reads the constant section, tries all 255 single-byte keys, keeps the ones whose output is more than 95% printable, and ranks them by how close the letters are to English, using a chi-square distance. Lower is closer.
def english_distance(text):
"""Chi-square distance between the letter mix of text and English. Lower is more English."""
letters = [c for c in text.lower() if c in ENGLISH]
if len(letters) < 20:
return None
n = len(letters)
return sum(((100.0 * letters.count(c) / n) - f) ** 2 / f for c, f in ENGLISH.items())
My first version just kept any key that gave printable text. It picked the wrong key (0x59), because a key two bits away from the right one still produces lowercase letters. Statistics fixed it, and this is exactly the kind of failure an agent also makes when it is sure and wrong.

key 0x5b english distance 88.0 http://updates.invalid/v1/latestThanks for using PracticeApp
key 0x5d english distance 292.5 nrrv<))svbgrcu(ohpgjob)p7)jgrcurRnghmu&`it&suoha&VtgeroecGvv
key 0x5f english distance 353.9 lppt>++qt`epaw*mjrehm`+r5+hepawpPlejow$bkv$qwmjc$TvegpmgaEtt
best key: 0x5b
program printed 3 decoded strings, all found in the decoded section: True
The last line is the point. The tool runs the practice program, collects the three strings it prints, and checks that every one appears in the decoded section. The key is now a claim the real program agrees with, not a guess that merely looks plausible.
An AI reading is a claim, and a claim is only worth the test you can run on it. This is where a reverse engineering guide earns its keep, and where reverse engineering with AI is most often done badly, because decompilers and models both produce fluent text that is wrong.
The evidence is stark. A 2026 preprint, CODEFUSE-DeBench (arXiv 2605.29490, not yet peer reviewed), tested five decompilers and three repair models on 640 binaries. The best pair reached 22.3% program-level behavioural overlap but only 1.2% exact output match, nearly 50 points below how often the code merely recompiled. Switching decompiler under a fixed model changed functionality about 20 times more than switching model changed it (1.6 times). The authors report that type-system collapse accounts for about 19% of repair errors.
A better result exists for repairing decompiler output. FidelityGPT (NDSS 2026) reports 89% detection accuracy and 83% precision on 620 function pairs, and a corrected fix rate of 64% against 37% for the DeGPT baseline it compared against. The headline is the same: even the best system fixes about two in three, not nine in ten.
Take the claim for check_key that an analyst or an agent would write: the key must be 14 characters with dashes at positions 4 and 9, the other 12 characters are upper-cased and folded into a hash with a multiply and a rotate left by 5, and the key is accepted when the hash equals the compare constant. That is a sentence. verify_claim.py turns it into a function that predicts accept or reject, then runs the real binary on 18 inputs and compares.
$ python3 verify_claim.py build/keycheck
claim as written 18 inputs, 0 mismatches
wrong claim (no rotate) 18 inputs, 2 mismatches first miss: PRAC-7K2M-QX94
The claim as written matched all 18. The same claim with the rotate step removed, a plausible mistake, failed on 2, and the first miss was the one key the program actually accepts. That is the whole technique, called differential testing. The inputs are mine and include the author’s own key, so this proves the claim for these inputs only, and I am not showing how to build a key for software you do not own.

The matrix above is the working rule. Match each kind of claim to the cheapest check that can prove it wrong:
xor_probe.py does.Ranking is a filter with false negatives, and this reverse engineering workflow has one to show you. On updater, the function debug_enabled compares an argument against the hardcoded token dbg-4f2a9c, and that is the finding a reviewer would care about. It ranked fourth of five with a score of 2, so a top-3 packet leaves it out.
rank addr score size imports / notes
1 0x1000006ac 8 90 close,connect,recv,send,socket,strlen
2 0x1000004f8 4 71 strcmp "debug mode on" "--check"
3 0x100000814 4 42 memcpy_chk,freeaddrinfo,getaddrinfo,memset
4 0x100000614 2 22 strcmp
A person would catch it, because main ranks second and it calls the function at 0x614 right before printing “debug mode on”. A good agent would too, if it is told to follow calls one hop out from the shortlist. My script does not do that yet, which is a gap I am naming and not hiding.
The other limits, plainly:
/usr/bin/zip, which is universal, and the output was nonsense (odd, unaligned function addresses that point to the x86 slice), until I added a check. Linux ELF and Windows PE need another parser.-O1 the same samples inlined into main. Stripped release builds of real software often look like that, and the ranking then points at one huge block.You can learn reverse engineering without paying, and the free material is older than the tools, so pair them. Here is what I opened on 25 November 2026, with its age, because dates matter in this field.
| Resource | Cost | Level | Age and catch |
|---|---|---|---|
| Reverse Engineering for Beginners by Dennis Yurichev | Free, CC BY-SA 4.0 | Beginner, assembly-first | The newest dated item on the page is a 2021 translation, and exercises moved to challenges.re |
| crackmes.one | Free, registration to submit | All levels | 4,879 crackmes and 6,903 writeups listed, downloads are password-protected |
| Practical Malware Analysis | $69.99 print, $54.99 ebook | Beginner to intermediate | 2012, 800 pages, Windows x86 with IDA Pro, OllyDbg and WinDbg |
| Azeria Labs ARM assembly | Free | Beginner | 2017, 32-bit ARMv6, so read for concepts, not for Apple Silicon |
My suggested order: read the first chapters of the Yurichev book for assembly, practise on crackmes you download from a list that others have solved and written up, then write your own small program like mine and compare your reading with the source. That last step is the fastest teacher, because you know the right answer.
If you are on Apple Silicon, notice that the classic Windows x86 material does not map directly onto the arm64 binaries you can build on your own machine. The loop is the same, the instructions differ, and an agent is good at translating between them, which is a good place to let one help.
The expensive mistakes in reverse engineering are all about trust. They look like speed until you check them.
decrypt_config is a guess, from you or a model.So yeah, here is where I tell you what XHack brings, with the bias of someone who built it.
XHack combines three things most providers sell separately: expert human penetration testing, an autonomous AI agent and a continuous security operations platform. For reverse engineering, the agent is the part you use day to day, and I want to be exact about what it does.
It reads and explains, and you stay the reviewer. XHack’s agent works from the disassembly, decompiler output and files you give it, identifies key functions, explains behaviour, extracts indicators such as addresses and file paths, and drafts YARA rules for malware work. It does not replace Ghidra, Binary Ninja or IDA. Keep one beside it, and connect a Ghidra MCP server through the agent’s MCP connections if you want it to drive the project directly.
Mobile is a one-click setup. Drag in an APK or IPA and the agent inspects manifests, entitlements and secrets, and one-click setup installs jadx, platform-tools and Frida for you.
You choose where the model runs. The agent can use a local model through Ollama or llama.cpp, so a sample never leaves your machine. Permission modes (Plan, Manual, Allow Edits, Auto) decide who approves each command, and destructive commands are blocked in every mode.
Privacy is a design choice. XHack does not store your user data and is privacy-focused by design. Pentest chats and session data stay on your own computer, and you can delete them any time. That matches the privacy of a fully local setup without giving up an agent that can use tools.
An honest limit: the agent explains what it reads, and it can be wrong, which is why Step 6 exists. If you want a tool that hands you finished answers with no checking, we are not the right fit.
Individual plans start at $20 a month (Starter $20, Professional $49, Elite $150), with a 7-day free trial. Point it at one of your own binaries and judge the explanation against the source. If you want our testers to do the work, managed engagements start at $2,500 at a fixed price. Book a free consultation, even if the answer turns out not to be us. Brutal honesty is kind of our thing.
The best reverse engineering guide for beginners combines a free assembly book with hands-on practice and a check step. Dennis Yurichev’s free book teaches assembly, crackmes.one provides targets with writeups, and writing your own small program gives you the answer key. This guide adds triage and verification, which most beginner material skips, and it uses 2026 tools such as Ghidra 12.2.
Start with the question, then identify the file, then rank the functions. Run file and strings, list the imports, and rank functions by what they call and what constants they build. Read the top few, write a claim about each, and test the claim by running the program or reimplementing the logic. That sequence is the reverse engineering guide in one sentence.
AI can do the reading in reverse engineering, but not the verifying. On the CODEFUSE-DeBench preprint the best decompiler and model pair matched exact output only 1.2% of the time. An agent is fast at explaining and renaming. A person, or a test, has to confirm that the explanation is true of the real binary.
It depends on the sample, the licence and the country, so this is not legal advice. In the US a 2024 Copyright Office rule renewed the exemption for good-faith security research, with conditions. In the EU, Article 6 of Directive 2009/24/EC allows decompilation for interoperability only. Analyse software you own or have written permission to study.
For reverse engineering, learn Ghidra first, because it is free with no non-commercial restriction and it handles arm64. IDA Free is limited to x86 and x86-64, and Binary Ninja Free has no API or plugins. All three share the same loop, so the skill transfers. Use objdump to follow this guide before you install anything.
Yes, XHack’s agent supports reverse engineering work: it explains disassembly and decompiler output, extracts indicators, drafts YARA rules and handles APK and IPA analysis. It works alongside Ghidra, IDA or Binary Ninja instead of replacing them, and it can run on a local model. Chats and session data stay on your computer.
A reverse engineering guide worth following ends with a test, not a summary. Rank the functions so you read the right ten percent first, use an agent for the reading, and run every claim against the real program before it goes in a report. My script is a starting point with a known miss, and I would rather you see the miss than a clean chart.
Next, pick one practice binary for your first reverse engineering session, write the question, run the triage, and check one claim. If you want an agent to carry the reading, try XHack’s agent on a binary you own, and keep Step 6 in your own hands.
Categories
Related articles