Summary
I used REA with Claude Code to inspect Windows Calculator and an unnamed mobile app. On the calculator, the agent read the percent handler's instructions, labelled the operator branch, and rebuilt the rule in a small calculator. The rebuild gave 220 for 200 + 10% and 20 for 200 * 10%. I also used it on an unnamed mobile app to trace how one flow was built. The runs worked, but the useful part was the evidence trail, not the answer. This is what I set up, what I asked, and what I would check before trusting a result.
Introduction
A coding agent can read source code. A running app often has no source to read. The code is compiled, bundled, or shipped in a format the agent cannot open with a text editor.
Reverse engineering closes that gap. You inspect the program itself, follow its code, and build a model of how a feature works. The work is slow, and the output is usually a note that only the person who did it can follow.
I wanted to see whether an agent could do that work with the right tools. REA is built for that. The site describes it as reverse engineering with your coding agent. The agent asks for a feature, and REA returns the code and runtime evidence behind it.
I tried it on a feature with a clear answer: the percent button in Windows Calculator. Then I pointed it at a mobile app to see whether the same workflow held outside a desktop binary.
Why I tried it
The appeal is not "inspect an app." That is too broad to test. The appeal is a small question with a rule behind it.
Calculator is a good target. It ships as a native Windows app, the behavior is familiar, and the percent button is one of those features people use without knowing the rule. On a phone calculator, 200 + 10% often gives 220. On some calculators it gives 200.1. The difference is not a bug. It is a design choice inside the handler.
That gives the agent a testable question. Why does 200 + 10% give 220? Which branch runs? What are the operands? Can the rule be rebuilt and checked?
I also wanted to see the evidence format. An agent that says "the percent button takes ten percent of the first number" is not useful on its own. I wanted the instructions, the branch, and a rebuild I could test.
What I set up
REA installs from npm:
npx rea-agents@latest setup
I used the agent-facing version of that, which asks the coding agent to show the setup plan for approval, run it, and verify the install. The site supports Claude Code, Codex, Gemini CLI, and other agents.
The setup matters because the agent needs tools it can call. REA is not one function. It is a set of inspection tools:
- Read functions, strings, references, and call relationships in native executables and libraries.
- Follow code inside a JavaScript desktop app or an Electron bundle.
- Capture selected browser or process activity and compare runs.
- Launch an installed app and select the library that implements a feature.
The agent still does the reasoning. REA returns the evidence. The agent decides which branch applies, what the operands are, and how to rebuild the rule.
For an Android APK, REA needs JADX and JDK 17 or newer. If you want the phone itself inspected rather than the package, it uses adb. If you want resources such as layouts, strings, and the manifest, it uses Apktool. I installed the JADX and JDK pair and pointed the agent at an APK file.
What I asked
I kept the prompt narrow. I named the target, the feature, and the artifact I wanted.
Use REA to inspect Windows Calculator. Why does 200 + 10% give 220?
Show the branch and the operands, then rebuild the rule in a small calculator.
That prompt does three things. It gives the agent a target, a question, and a verification step. It also sets a boundary. I did not ask for a full clone of Calculator or a security audit. I asked for one rule and a small rebuild.
The next time I run this, I will add the app version to the prompt. A recovered rule belongs to one build. Without the version, the finding is harder to check later.
What actually happened
The agent found the percent handler and returned the selected instructions. The code compares the current operator against command ids. Two jumps lead to the same place, so the agent had to identify which operators those ids mean.
The ids are 0x5b for divide, 0x5c for multiply, and 0x76 for percent. The constant 0x64 is 100.
The readable summary is short:
if (operation == multiply || operation == divide) {
percent = current / 100;
} else {
percent = current * previous / 100;
}
That is the rule. With +, the button takes a percentage of the first number. So 10% of 200 is 20, and 200 + 20 is 220. With *, the button turns 10% into 0.1, and 200 * 0.1 is 20.
The rebuild matched. A small calculator with the same branch gave 220 for 200 + 10% and 20 for 200 * 10%. That check is the part that made the answer useful. Without it, I would have had a plausible story.
The evidence was not only the agent's explanation. The site links the operator ids to Microsoft's public source and the percent implementation to the calculator repository. The agent's claim could be checked against a source that is not the agent.
The run worked. The part I did not expect was how much the instruction view helped. Seeing the branch and the constant made the rule easier to judge than reading a paragraph about percentages.
The second example
I looked at the dinosaur speed example next, because it tests a different kind of evidence.
The game starts at speed 6 and adds 0.001 on each update while speed is below 13, as long as there has been no collision. The selected code is a small conditional:
if (this.currentSpeed < this.config.MAX_SPEED) {
this.currentSpeed += this.config.ACCELERATION;
}
The site reports a controlled check. With obstacles and automatic scheduling disabled, speed was 10.0 after 4,000 updates and 13.0 after 10,000 updates, rounded to one decimal.
Two details are worth copying. The site records the source and a digest, so the agent is not asked to trust a summary. And the check is controlled. A measurement from a live game with random obstacles would be harder to interpret.
The rebuilt mini-game keeps the speed rule and adds a slider. The drawing, jumping, and collision code are a teaching implementation, not a recovery of the original game. That distinction matters. Recovering one rule is not recovering the whole program.
REA also builds reinforcement learning environments from a recorded web app session. The agent records the browser's requests and the app's responses, and REA builds a local environment where another agent can practice tasks. That is a different job from explaining a feature, and it needs a complete recording, a reset between runs, and a check that the operation happened.
The mobile app
I used REA on a mobile app to see how it works. I will leave the app unnamed. My question was about one flow: which parts of the app assemble the screen, and where does the data come from. I was not looking for a bypass, a key, or another user's data.
I installed JDK 17 and JADX, gave the agent the APK, and asked it to trace the flow. REA returned the decompiled classes on the path, the manifest entry points, and the resources tied to the screen. The agent used that evidence to explain how the screen was put together and how the data reached it.
The mobile run needed more care than the desktop one. Released APKs are often obfuscated, split across several files, and partly implemented in native libraries. The agent can follow Java and Kotlin that survived decompilation. It cannot recover a name that was stripped, and it cannot read a native library the same way it reads JADX output.
So I treated the first answer as a map, not a result. I checked each claim against the decompiled files and the resource ids. The explanation held for the flow I asked about. I did not get a full reconstruction, and I did not ask for one.
Two rules made the run comfortable. I worked on a copy of the APK, and I stayed local. The app, the decompiled output, and my notes never left the machine.
What I would watch next
The agent's explanation is a hypothesis. It can be wrong about a branch, miss a caller, or confuse a helper with the function that matters. The evidence has to be checked.
The finding belongs to a version. An app update, a new browser build, or a different APK can change the code. Record the version and the digest with the result.
Observation can change behavior. A debugger, an injected script, or a controlled test setup can alter timing. A speed measurement from an instrumented run is not automatically the same as a normal run.
The output can be incomplete. Recovering the percent rule does not recover the whole calculator. Recovering the acceleration rule does not recover the dinosaur game. State which feature you explained and which parts are a teaching rebuild.
The mobile layer adds its own limits. Obfuscation removes names, split APKs hide code in several packages, and native libraries keep their logic out of the Java view. A clean explanation of one flow is not proof that you have seen all of it.
The legal boundary is real. Use REA on software you are allowed to inspect: your own programs, apps whose licenses permit analysis, open-source targets, and training material. Do not use it to bypass access controls, extract another person's data, or attack a service you do not own.
Best practices and common pitfalls
Best practices
Ask about one feature with a testable question. Name the app, the version, and the behavior you want explained.
Require evidence with the claim. Ask for the instruction path, the constants, the call chain, and a run that checks the rebuilt rule.
Pin the version. Save the app version, the file digest, and the date with the finding.
Use a controlled check. Disable random inputs and scheduling when you measure a rule, then compare the original and the rebuild on the same inputs.
Keep the rebuild small. A tiny program that reproduces the rule is easier to verify than a large clone.
For an APK, work on a copy and keep the decompiled output local. Ask for classes, manifest entries, and resource ids, not just a summary.
Check the license and the target before you start.
Common pitfalls
Do not accept a fluent explanation as proof. A model can describe a plausible rule that the code does not implement.
Do not confuse a teaching rebuild with a recovered program. The drawing and collision code in the dinosaur example are new code, not recovered code.
Do not measure a live app with random inputs and call the result a rule. Control the run or state the uncertainty.
Do not reuse a finding across versions without checking the code again.
Do not assume a decompiled mobile app shows every name. Obfuscation and native libraries will leave gaps.
Do not use the tool on a remote service or another person's app without permission.
Key takeaways and conclusion
Key takeaways
- REA worked for a narrow feature question, and the instruction view made the rule easy to judge.
- The rebuild is what turns a plausible explanation into a checked result.
- A finding belongs to one app version; save the version and the digest.
- A recovered rule and a teaching rebuild are separate artifacts. Say which is which.
- The mobile run worked as a map of one flow, with obfuscation and native code setting the limits.
Conclusion
I went in expecting a demo and got a workflow I would use again. The useful part was not the agent's prose. It was the evidence: the selected instructions, the operator ids, the constant, and a small rebuild that gave the same answers.
The mobile app confirmed the pattern. The agent was useful when it returned files, entry points, and resource ids I could check. It was not useful as an oracle.
That pattern applies without REA. Give the agent a source of truth, ask for the evidence, and make the claim reproducible. A reverse engineering result is only as good as the check behind it.
References
- REA site, workflow, and examples. https://rea.tools
- REA setup guide. https://rea.tools/get-started/
- REA Android APK analysis guide. https://github.com/morluto/rea/blob/main/docs/android-analysis.md
Top comments (0)