Reverse engineer a stripped binary with REA, step by step A developer used REA's MCP tools in Claude Code, backed by Ghidra 12.1.4, to reverse engineer a self-built stripped x86-64 Linux ELF binary, recovering the license key DEMO-2CC99E78, the hash and XOR key, and an XOR-obfuscated update URL from the binary alone; the real program accepted the recovered key and the decoded URL matched what the program prints. The run began by decompiling the entry point to identify main at FUN_001010a0, then read 96 bytes at 0x103d80 to map a 24-byte-per-entry command dispatcher table linking check, version and unlock to their handlers. The analysis was completed without consulting the source, which the author published alongside the walkthrough as of 23 November 2026. Reverse engineer a stripped binary with REA, step by step A real run on my own stripped binary: REA with Ghidra finds main, the license check, the hash and XOR key, then I test the key. Mistakes and source included. I built a small stripped Linux program with a license check, a hashed key and an XOR-obfuscated update URL, then used REA with its Ghidra backend to recover all three from the binary alone. The recovered key DEMO-2CC99E78 was accepted by the real program, and the decoded URL matched what the program prints. As of 23 November 2026. I ran this with REA's MCP tools in Claude Code, backed by Ghidra 12.1.4, on an x86-64 Linux ELF. Everything below was output I saw, trimmed for length. I did not look at the source until the analysis was finished. If you have not set REA up yet, start with Getting started with REA https://reversedwithai.com/learn/getting-started-with-rea and the REA tool page https://reversedwithai.com/tools/rea . What was the target? what-was-the-target I wrote a small C program for this and compiled it stripped with optimisation: gcc -O2 -s -o target target.c file target target: ELF 64-bit LSB pie executable, x86-64, dynamically linked, stripped It has four commands check , unlock , info , version , a key check and an encrypted string. The full source is at the end of this guide so you can rebuild it. I moved it into a separate folder before opening anything in REA. It is my own code, so there was nothing to clear before analysing it. The run followed three stages, shown below with the addresses I used. How did I get a first look? how-did-i-get-a-first-look I opened the file and asked for an overview. php open binary path=.../rea-run/target - {"format":"elf","kind":"executable","architecture":"x86 64"} binary overview - "procedure count":45, "string count":60 .text 0x1010a0-0x101502 1122 bytes Forty-five procedures sounds like a lot, but most are PLT thunks and startup code. .text is only 1,122 bytes. Then I listed procedures and strings. The imports told me the shape of the program before I read any code: strchr , snprintf and strcmp together suggest a key being split, formatted and compared. The strings had license: valid , license: invalid , unlock: premium features enabled , update server: %s and the command names check , version and unlock . One odd string stood out, at 0x1020e2 : . uu/ ;.? t?";7 6?t34,;63 u,k That is not a message anyone writes. I marked it as encrypted data to come back to. How do I find main in a stripped binary? how-do-i-find-main-in-a-stripped-binary Decompile the entry point. The only useful thing it does is call libc start main , and the first argument is main. php procedure pseudo code procedure=entry - libc start main FUN 001010a0, param 2, &stack0x00000008, 0, 0, param 1, auStack 8 ; So FUN 001010a0 is main. Its pseudocode loops four times, calling strcmp against a table that starts at 0x103d80 , and ends with an indirect call. Ghidra added this warning: WARNING: Could not recover jumptable at 0x00101184. Too many branches WARNING: Treating indirect jump as call That is not a jump table. It is a table of function pointers, a command dispatcher. I read the table with read bytes instead of trusting the decompiler's pointer arithmetic: php read bytes address=0x103d80 length=96 - 9c2010000000000050141000000000000100000000000000 a22010000000000090141000000000000000000000000000 a72010000000000e0121000000000000000000000000000 af2010000000000010141000000000000100000000000000 Each entry is 24 bytes: a pointer to the command name, a pointer to the handler and an integer flag. Reading the little-endian values gave me check to 0x101450 with flag 1, a name at 0x1020a2 to 0x101490 with flag 0, version to 0x1012e0 with flag 0 and unlock to 0x101410 with flag 1. The flag matches the %s needs an argument string, so I named it "needs an argument". Where is the license check? where-is-the-license-check Both 0x101450 and 0x101410 print a verdict after calling FUN 00101300 . procedure callers confirmed that only those two call it: php procedure callers procedure=0x101300 - "0x101410","0x101450" FUN 00101300 is the key check. Its decompiled body, trimmed: pcVar3 = strchr param 1, 0x2d ; // '-' if pcVar3 == 0 || 0xd < pcVar3 - param 1 - 3 return false; ... copy the part before the dash ... uVar5 = 0x811c9dc5; do { uVar1 = p++; uVar5 = uVar1 ^ uVar5 0x20003260 | uVar1 ^ uVar5 0x1000193 0x1b; } while p = 0 ; snprintf local 48, 0x10, "%08X", uVar5 ^ 0xa5a5a5a5 ; return strcmp pcVar3 + 1, local 48 == 0; In plain terms, the key is NAME-XXXXXXXX . The program hashes the name and compares the result, printed as eight uppercase hex digits, with the text after the dash. The length test allows 3 to 16 characters before the dash. How did I recover the hash? how-did-i-recover-the-hash 0x811c9dc5 is the FNV-1 32-bit offset basis, and 0x1000193 is the FNV prime, so my first thought was FNV. But the line has two different multipliers joined by | , which looked wrong. I checked the arithmetic: 0x1000193 << 5 & 0xffffffff = 0x20003260 0x811c9dc5 ^ 0xa5a5a5a5 = 0x24b93860 The first value is the second multiplier shifted left by 5, and 0x1b is a shift right by 27. Together they are a 32-bit rotate left by 5 of x 0x1000193 . The decompiler had distributed the rotate across the multiplication. The second value is the empty-name constant 0x24b93860 that the decompiler printed in an if branch. That confirms the final XOR with 0xa5a5a5a5 . So the hash is: start at the FNV offset basis, then for each byte XOR it in, multiply by the FNV prime and rotate left 5, and finish with an XOR against 0xa5a5a5a5 . I wrote that down literally in Python, using the decompiler's expression rather than my own simplification, so a mistake in my reading would show up in the test: python M = 0xFFFFFFFF def h name : v = 0x811c9dc5 for c in name.encode : x = c ^ v & M v = x 0x20003260 & M | x 0x1000193 & M 0x1b return v ^ 0xa5a5a5a5 How did I recover the XOR key? how-did-i-recover-the-xor-key The function at 0x101490 prints update server: %s . Its loop starts with a constant and a XOR: bVar2 = 0x32; do { pbVar3 = bVar2 ^ 0x5a; bVar2 = &DAT 001020e1 lVar4 ; ... } while bVar2 = 0 ; The key is 0x5a . The blob starts one byte before DAT 001020e1 , at 0x1020e0 , with the first byte 0x32 held in a register. The strings list had put it at 0x1020e2 , which is two bytes late, so I read the bytes myself: php read bytes address=0x1020e0 length=36 - 322e2e2a296075752f2a3e3b2e3f29743f223b372a363f7433342c3b36333e752c6b00 XOR with 0x5a gives https://updates.example.invalid/v1 . How did I rename things? how-did-i-rename-things I named what I had proven, in one call, so the next decompile would read better: set addresses names names={ "0x1010a0":"main", "0x101300":"check key", "0x101410":"cmd unlock", "0x101450":"cmd check", "0x101490":"cmd info", "0x1012e0":"cmd version", "0x103d80":"command table", "0x1020e0":"enc url"} - all eight: true REA renames only live in the session. They are discarded on close, so write down anything you want to keep. Did the recovered key work? did-the-recovered-key-work I generated a key for the name DEMO with the Python above and ran the real binary: bash $ python3 solve.py DEMO https://updates.example.invalid/v1 DEMO-2CC99E78 $ ./target check DEMO-2CC99E78 license: valid $ ./target unlock DEMO-2CC99E78 unlock: premium features enabled $ ./target check DEMO-00000000 license: invalid I also tried more names. ALICE-E9DDA17F was valid. AB-33BBE073 had the correct hash but was rejected, and so was an 18-character name with a correct hash, which fits the 3 to 16 length rule I read in the decompiler. Then I closed the session with close binary . Where did the AI go wrong? where-did-the-ai-go-wrong These are the real mistakes and misleading outputs, including some of mine. - An empty "success". I called batch decompile without loading its schema first. It returned {"items": ,"total":0,"succeeded":0,"failed":0} , which looks fine and decompiled nothing. I noticed because I had no code to read. Check counts, not just status. - A rejected call. My first set addresses names call omitted the names field and failed schema validation. The error said what was wrong and I fixed it on the second call. - The strings list was misaligned. The encrypted blob was reported at 0x1020e2 , not 0x1020e0 . The decompiler's 0x32 literal and DAT 001020e1 gave it away. Decoding from the listed address would have produced garbage. - A missing string. The command name at 0x1020a2 was not in the string list. I only saw it as a pointer in the table. Ghidra's string list covers defined strings only, and REA says so in its limitations. - Arguments disappeared. The decompiler showed FUN 00101300 with no arguments, and printf "update server: %s\n" with no buffer. The values were in registers that the compiler passed straight through. The decompiled code alone suggests a check that takes no input. - The hash looked like two operations. The | between two multipliers was a rotate. I checked it numerically before using it. - The renaming spilled. After I named 0x103d80 , the decompiler showed the handler field as &PTR cmd check 00103d88 . The name cmd check appeared on a slot that holds all four handlers. The table has not been retyped, so the label misleads. What did the decompiler lose compared with the source? what-did-the-decompiler-lose-compared-with-the-source After the run I read the source. The logic was right in every case. What the decompiler lost: - The rotl32 and mix hash helpers were inlined into check key , so my renames cover fewer functions than the source has. - decode url was inlined into cmd info , with the first byte peeled out of the loop. - The command t struct was gone. It showed as a pointer array indexed by lVar3 3 and an int array indexed by lVar3 6 , which are the same 24-byte stride written two ways. - XOR KEY became the literal 0x5a , and rotl32 ..., 5 became shift constants. - Return types became undefined8 or bool , and handlers lost their const char arg parameter. - The empty-name branch with the constant 0x24b93860 is dead code in the source, because the length check rejects names under 3 characters. The decompiler still printed it. - The memcpy was a byte loop with n & 0x3f . The & 0x3f is a compiler artefact and is harmless because the length is already at most 16. Check it yourself check-it-yourself 1. Set up REA with a Ghidra backend by following Getting started with REA https://reversedwithai.com/learn/getting-started-with-rea . 2. Save the source below as target.c and compile it with gcc -O2 -s -o target target.c . A different compiler version will give different addresses, so substitute your own. 3. Move target.c out of the folder where you work. Do not give it to the agent. 4. Ask your agent to open the binary with REA, find main from entry , find the function with strchr and snprintf , recover the hash and the XOR key, and produce a valid key. Tell it to show the address and decompiled code for each claim. 5. Test any key it gives you with ./target check KEY . Do not accept the agent's word that it works. 6. Compare with the source and list what was lost. include