LLM-Assisted Reverse Engineering: A Practical Workflow
Learn how to use LLMs, Ghidra and repeatable experiments to reverse engineer software and firmware faster, while keeping findings traceable and safe.

A Practical Workflow for LLM-Assisted Reverse Engineering
Reverse engineering can mean understanding an old desktop application, mapping a device protocol, inspecting firmware, or figuring out why a driver no longer works. The hard part is rarely the "open the disassembler" step. It's turning a messy, incomplete trail of clues into an explanation you can actually trust - without burning days on dead ends.
Large language models can help. They can summarize functions, draft small analysis scripts, and keep investigation notes from turning into chaos. But they don't remove the need for engineering judgment. An agent can confidently chase the wrong hypothesis, misread a calling convention, or treat a plausible guess as if it were proven.
The real improvement isn't "AI reverse engineers the binary by itself." It's that a capable engineer can delegate parts of the work while still steering the investigation - keeping control of the evidence and the decisions. This guide walks through a workflow you can use: pick tools that fit the job, build a record you can rely on, test hypotheses instead of guessing, and know when to switch from static analysis to runtime observation. It also covers implementation choices and the legal boundaries that matter when you work with software and devices.
What tools do you need for LLM-assisted reverse engineering?
The "right" setup isn't the one with the most tools. It's the one that lets you inspect the target, give an agent access to the evidence in a way you can reproduce, and verify what happens when its first explanation turns out to be wrong. In practice, many projects use a disassembler or decompiler, an LLM assistant, a way to run the target, and a place to store solid notes.
Use an agent as an interface, not as an oracle
An LLM can help summarize a function, compare call paths, or draft a script. If the agent connects to tools, it can also run commands and inspect actual analysis results. That's where integration helps: for example, a Ghidra bridge can give the agent structured access to functions, references, and decompiler output, instead of forcing it to infer everything from pasted fragments.
The catch is control. The more access you give the agent, the more you need to restrict what it can execute or change. Start with read-only analysis when you can. Keep a copy of the original target. Require approval before an agent modifies files, runs unknown code, or talks to a connected device.
Different models and harnesses vary in cost, speed, context length, and tool support. The workflow described in the source uses DeepSeek tools for much of the work, with other coding agents used occasionally. Treat that as an example, not a ranking. What works well for one firmware image may be frustrating on a stripped desktop binary - or when the instruction set feels unfamiliar.
Match analysis tools to the job
Ghidra is a strong general-purpose choice. It's free, supports many architectures, and gives you both disassembly and decompilation. If your investigation touches lots of functions, its project database and analysis features can be a real time-saver. A bridge that exposes those features to an agent can reduce repetitive navigation - but you still need to verify what the tool reports.
Command-line tools like radare2 can be faster to use and easier to plug into scripts or agent-driven workflows. Other tools may fit particular platforms or specialized analysis tasks better. And remember: no decompiler reconstructs the original source exactly. Names, types, and control flow are often inferred. Treat generated pseudocode like a useful view of behavior, not recovered source code.
Confirm the target before asking for explanations
Figure out the file format, architecture, operating system, compiler clues, and likely build type before you trust any conclusions. If you guess the architecture wrong, it can ripple through everything that follows.
For firmware, identify image regions and likely components before treating the whole file as one program. For a web application, inspect the relevant scripts, server components, and network behavior instead of forcing the problem into a "binary analysis" mold.
A practical starter kit is pretty modest: an LLM agent with bounded tool access, Ghidra (or another suitable disassembler/decompiler), a command-line analysis tool, a runtime environment, and a notes directory. Add specialized tooling only when the target or the question demands it.
How do you structure an AI-assisted reverse-engineering workflow?
A good workflow leaves a trail from your question to the evidence you used. Without that trail, an agent may redo the same work after a context reset, miss an earlier observation, or confidently fall back into a disproven idea. Persistent notes aren't bureaucratic busywork - they're part of how the investigation survives contact with reality.
1. Define the question and the scope
Start with what you're actually trying to get. Are you trying to understand a file format, identify a protocol, debug a compatibility issue, or figure out how a component behaves? "Explain this firmware" is too broad to guide good work. "Identify how the device validates a command before writing a configuration value" gives you a boundary.
Record what you're authorized to inspect and what's out of scope for changes. For a device, note the model and firmware version. For a program, save the original file and record its source and hash. These details make results easier to reproduce and help you avoid analyzing the wrong build by accident.
2. Establish the basic structure
Before the agent dives into individual functions, ask it to inventory the target. A useful first pass includes the file type, architecture, entry points, imported functions, strings, major regions, and likely external dependencies. Then ask for a short map of the main control flow and the functions that seem relevant to your question.
Keep this stage descriptive. If the agent claims a function handles authentication or decodes packets, ask what evidence supports that. A string reference or a familiar function name is a lead - not proof. Check it against callers, data flow, and behavior when you can.
3. Keep a compact, durable investigation record
Have the agent write findings to Markdown files in the project directory. Separate observations from interpretations. For example:
- Observation: function A reads bytes 0-3 of the input buffer and compares them with a constant.
- Interpretation: those bytes may be a protocol header.
- Open question: whether the comparison rejects malformed packets or selects a message type.
Also record what tools you used, relevant function addresses or names, commands you ran, unresolved questions, and how findings connect. This becomes a working map when the agent hits its context limit or when someone else needs to take over. It also gives the agent a place to check instead of trying to rebuild your investigation from a long chat history.
4. Move from overview to a testable question
Once you have a structural map, narrow the work to one behavior at a time. Trace a relevant function through its callers and data dependencies. Ask the agent to update the notes when a conclusion changes, instead of quietly replacing an earlier explanation.
The core loop is simple: form a hypothesis, design a test that distinguishes it from alternatives, record the result, and update your explanation. For example, if you suspect a value is a device command identifier, compare several known inputs and check whether the same value reaches the relevant handler. A hypothesis table can make that explicit:
| Hypothesis | Evidence needed | Test | Result |
|---|---|---|---|
| A field selects the command handler | Different field values reach different branches | Send or replay controlled inputs and log the branch | Confirmed, rejected or unresolved |
This beats telling an agent to "keep looking" until it produces a satisfying story.
What should you do when static analysis gets stuck?
Static analysis is a model of what the program might do. It's often enough to map structure, but some behavior depends on runtime state, input data, hardware, or operating-system interactions. When the agent keeps following the same references and returning the same guess, don't ask for a longer response - switch the evidence source.
Use debugging to observe execution
If you can run the target safely, set breakpoints around the relevant function or branch and inspect what arrives there. Debugging can answer questions that a decompiler struggles with: which path runs for a particular input, what a buffer contains at runtime, or whether a function is called at all.
Keep tests narrow and repeatable. Hold the input constant, record the breakpoint location, and capture only the values that matter. On hardware, use a controlled test environment and avoid experiments that could damage the device or alter data you can't restore.
Add logging or a probe when you need more visibility
Logging can reveal behavior that static analysis won't show. Depending on the target, that might mean enabling an existing diagnostic mode, instrumenting a test build, or creating a small probe that records a handful of key events. The method should match the system's constraints; injecting code isn't automatically the safest or best option.
Collect only the data you need to answer the question. Logs that capture everything are harder to interpret and can leak sensitive information. Keep probes easy to remove, document how they were built, and confirm they don't change the behavior you're measuring in a meaningful way.
Change the analysis angle deliberately
When one path stalls, pick a specific alternative and try it. If cross-references aren't producing useful leads, search strings and track where they're used. If the decompiled control flow is unclear, inspect the assembly around the branch. If the question is about a device protocol, compare captured inputs and outputs instead of leaning only on function names.
Also, read the conversation and the tool traces for patterns. Agents can get stuck on a plausible but weak interpretation. Watch for repeated assumptions, labels that never got supported, or tests that never actually separate competing explanations. Then give a constrained next step: inspect a particular caller, compare two inputs, or test a named hypothesis. "Try another approach" is vague; "here's the evidence that would change my mind" is actionable.
Use outside access only when it answers a real question
Some targets are easiest to reproduce with access through a real interface. A desktop application might need the GUI. Firmware might require an emulator or a controllable test device. This can connect internal code paths to observable outcomes, but it also increases setup effort and operational risk.
Use isolated environments for untrusted software, and don't give the agent broad access to personal accounts, networks, or devices. The goal isn't to automate everything. It's to collect one small piece of evidence that static analysis can't provide.
How do you turn analysis into a reliable tool or modification?
Reverse engineering often ends not with a report, but with something that works: a protocol client, a compatibility fix, a file converter, or a diagnostic utility. Keep implementation separate from discovery. A plausible interpretation doesn't become a stable specification until you've checked it against real inputs and edge cases.
Prototype the smallest useful experiment
Python is practical for quick probes, parsers, and analysis helpers. Lightweight environment tooling can make short scripts easier to reproduce and share. Use a prototype to test the smallest claim that matters: parse a sample file, send one documented command to a test device, or compare expected vs. observed output.
Keep sample data and expected results alongside the script. If the prototype only works on one captured example, say that plainly. That limitation is useful information, not an excuse to pretend the result is complete.
Choose production tools based on constraints
When you want a more durable utility, pick a language that fits the deployment target, maintenance expectations, and your team's experience. Rust can be a good fit when you want explicit types, stronger compiler feedback, and predictable deployment across supported targets. That feedback is also helpful when an AI agent is generating or revising code.
Rust has trade-offs too: compile times, learning curve, and ecosystem fit can matter more than the safety story - especially for a tiny one-off script. Python may still be the better choice for an internal tool or analysis workflow. The point isn't to "make everything Rust." It's to match the tool's feedback loop and operational profile to the job.
Validate behavior and preserve the boundary
Test against multiple inputs, not only the single example that led to your discovery. Check malformed data, version differences, and failure behavior. For a protocol client, confirm it handles disconnects and timeouts. For a file parser, compare output against known-good samples. Record what remains unknown so future maintenance doesn't treat assumptions as guarantees.
There's also a legal and ethical boundary. Work on software and devices you own, or that you're authorized to assess, or that you can lawfully analyze in your jurisdiction. Rules can vary based on where you live and what you're doing. Don't use this workflow to bypass access controls, defeat licensing, or enable unauthorized access. If the intended work involves a commercial product or a sensitive system, get qualified legal and security guidance before proceeding.
Key takeaways
- Use an LLM to accelerate analysis, not to replace verification.
- Identify the target and define a narrow question before deep analysis.
- Preserve observations, hypotheses, tests, and results in durable notes.
- When static analysis stalls, change the evidence source: debug, log, probe, or test a specific alternative.
- Keep implementation separate from discovery, validate against multiple cases, and work within clear authorization.
Conclusion
LLMs make reverse engineering faster when they're used as part of a controlled investigation - not as an "answer machine." Start with a clear question, build a structural map, keep evidence in durable notes, and make each next step test a specific hypothesis. When static analysis stops helping, change the method and collect runtime evidence. That approach produces work you can check, reproduce, and safely build on.