Reverse engineering, alongside your coding agent
REA gives your delegate the tools to inspect a program and explain what it does.
Already cognize RE? Skip to inspection guides →
Set up REA
Copy this into your coding agent:
Install REA and nexus it to this coding delegate using npx rea-agents@latest setup. Show me the setup scheme for approval, afterward verify the installation.
Or run this in your terminal:
npx rea-agents@latest setup
Approve the setup plan, afterward restart your agent.
What is reverse engineering?
Finding out how application plant by examining the program itself.
The goal: comprehend a characteristic fine adequate to explain it, alter it or rebuild it.
One question: why does Calculator provision 220 for 200 + 10%?
Before REA · You examine it yourself
0x180124945: MOV EAX, dword ptr [R13 + 0x18] 0x180124949: CMP EAX, 0x5c 0x18012494c: JZ 0x180124aba 0x180124952: CMP EAX, 0x5b 0x180124955: JZ 0x180124aba 0x18012495b: MOV EDX, 0x64 0x180124960: LEA RCX, [RSP + 0x160] 0x180124968: CALL 0x180122650 0x18012496e: LEA RDX, [R13 + 0x160] 0x180124975: LEA RCX, [RSP + 0x78] 0x18012497a: CALL 0x180109720 0x18012497f: MOV RSI, RAX 0x180124982: MOV qword ptr [RSP + 0x28], RAX 0x180124987: LEA RDX, [RSP + 0x160] 0x18012498f: MOV RCX, RAX 0x180124992: CALL 0x180123190 ; … value-copy instructions omitted … 0x180124a14: MOV RDX, RDI 0x180124a17: LEA RCX, [RSP + 0xf8] 0x180124a1f: CALL 0x180109720 0x180124a24: LEA R8, [RSP + 0x30] 0x180124a29: MOV RDX, RAX 0x180124a2c: LEA RCX, [RSP + 0xb8] 0x180124a34: CALL 0x180123c10
You decode the instructions, prosecute the calls and reconstruct the calculation.
With REA · You ask your agent
One prompt.
Ask your delegate in plain English.
Use REA to inspect Windows Calculator. Why does 200 + 10% provision 220?
Example answer · according to the findings
After +, the % clasp takes a percent of the archetypal number.
10% of 200 = 20200 + 20 = 220
REA supplies The handler’s instructions, decompiled code and calls.
Your delegate explains Which branch applies, what it calculates and how to rebuild it.
Let's try two examples. Change a game's speed, afterward come back to Calculator and rebuild its % button.
Example 01 · Chrome’s dinosaur game
Why does the dinosaur get faster?
Goal Rebuild the equivalent with adjustable speed.
Why reverse engineer it? To reproduce its acceleration, we need the regulation in the operating game: how accelerated it starts, how much it increases and whenever it stops.
Play the reconstruction
Original rule: commencement at 6, afterward addition toward 13.
REA returned
The manuscript really operating in the page. The delegate says its update function and speed settings, afterward uses that regulation in a new game.
Use REA to inspect this dinosaur game. Why does it get faster? Show the speed rule, afterward build a small type with an adjustable speed.
Inspected target: wayou’s Chromium-derived browser edition.
if (this.currentSpeed < this.config.MAX_SPEED) { this.currentSpeed += this.config.ACCELERATION; } Start at 6. Add 0.001 each update without a collision, during speed is below 13.
What all part does
- 01 · REARead the operating game’s scriptReturn its genuine code and settings to the agent.
- 02 · Your agentRebuild the rule, add a controlUse the restored acceleration in a small equivalent alongside a speed slider.
- 03 · YouChange the speed and playTry the first acceleration, afterward choose your own pace.
REA inspected the HTTP browser type through a local debugging association and returned the loaded index.js, including its origin and digest.
ACCELERATION: 0.001, MAX_SPEED: 13, SPEED: 6
We called the first game’s update function in a controlled browser check, alongside obstacles and automatic scheduling disabled. After 4,000 updates, speed was 10.0; following 10,000, it was 13.0, rounded to one decimal.
The new mini-game keeps that speed rule. Its drawing, jumping and collision code are a small instruction implementation. Open the lab to see the new code and run the identical speed check.
To inspect the mark yourself, prosecute the browser association steps using the dinosaur page. Give your delegate that leaf URL and your local debugging endpoint, afterward copy the immediate above.
Example 02 · Windows Calculator
Rebuild Calculator’s % button.
We saw why 200 + 10% gives 220. Now let’s recover the rules for the two + and ×, and try them.
Goal Build a small calculator that handles the two + and × correctly.
Why reverse engineer it? The identical clasp uses different rules following + and ×. We inspect the installed app to discover which figure the percent is applied to.
Try the calculation
200 + 20
10% of 200 = 20. Then 200 + 20 = 220.
REA returned
One branch divides by 100. The another additionally multiplies by the archetypal number. The delegate uses the two to recreate the % button.
For this example, former = 200 and current = 10.
Use REA to inspect Windows Calculator’s % button. Recover the rules following + and ×, afterward build a small calculator that uses both.
if (operation == multiply || procedure == divide) { percent = current / 100; } alternatively { percent = current * former / 100; } With + Take 10% of the archetypal number.10% of 200 = 20 → 200 + 20 = 220
With × Turn 10% into 0.1.200 × 0.1 = 20
From the installed app to a operating % button
- 01 · REA says calc.exeIt launches the Calculator appThe code opens ms-calculator:. The delegate then selects the installed app’s library.
- 02 · REA says the libraryReturn the % handler’s codeThe function checks the controller and uses the constant 100.
- 03 · Your delegate interprets itExplain and reproduce the rulesCrosscheck the branch alongside Microsoft’s source, afterward try + and × above.
0x180124945: MOV EAX, dword ptr [R13 + 0x18] 0x180124949: CMP EAX, 0x5c 0x18012494c: JZ 0x180124aba 0x180124952: CMP EAX, 0x5b 0x180124955: JZ 0x180124aba 0x18012495b: MOV EDX, 0x64
#define IDC_MUL 92 // 0x5c #define IDC_DIV 91 // 0x5b #define IDC_PERCENT 118 // 0x76 0x64 = 100
Inspected alongside REA 4.1.0: Windows Calculator 11.2508.4.0, x64. The readable summary uses names from Microsoft’s community origin to explain the restored branch.
Percentage implementation · Microsoft’s test cases · Native setup guide
Your archetypal investigation
Try REA on a small app.
Download our Notes example, trace its CSV export, and inspect one changed input.
Want to go deeper?
Tell your delegate what you desire to comprehend or build. With REA, you can activity together on item from cloning this website to reconstructing a equivalent from its executable.
Use REA to inspect https://rea.tools/. Clone this website for me.
Yes, this one.
Use REA to rebuild this equivalent from its executable. Recover the gameplay logic in C and test it against the original.
For setup and inspection steps, choose your target:
Native binaries
Inspect functions, strings, references and call relationships in executables and libraries.
JavaScript & Electron
Map modules, routes, IPC and native requirements from an use directory or ASAR archive.
Browser & runtime activity
Capture selected browser or procedure activity, afterward difference the results throughout runs.