Unearthing Secrets in Memory — A Full Write-Up of “Now You See Me” (Shakti CTF 2025)
Reverse-engineering a native library is one of the most common (and most fun) ways to hide a flag in a CTF.
In the Now You See Me challenge, the author takes that idea literally: “Some secrets don’t like the spotlight. They prefer memory.” Flag Format: ShaktiCTF{…}
Some challenges leave breadcrumbs in log-cats or UI strings. This one hides every clue inside native memory and still tries to mislead us with decoys. Let’s walk through the whole chain — from APK carving, to secret-DEX extraction, to the final XOR that prints the flag. Challenge File.
What’s in the ZIP?
unzip nowyouseeme.zip -d chall && cd chall && ls
Stage 1 — Decompile the APK
“Exploding” the package
apktool d nowyouseeme.apk -o now_you_see_me
d stands for decoding.
-o now_you_see_me writes the result into an easy-to-spot folder.
Directory overview (trimmed):
now_you_see_me/
├─ AndroidManifest.xml ← readable XML
├─ assets/ ← extra files bundled by devs
├─ smali*/ ← Dalvik byte-code in text form
└─ lib/<abi>/ ← four tiny native libs (.so ≈ 5 kB each)
What is smali? Android apps compile Java/Kotlin into Dalvik byte-code. apktool prints that word-for-word using the smali assembly language, so you can read methods without any GUI.
Stage 2 — Recovering the real key from a hidden DEX
The obvious place to look for a secret key is the code. Let’s grep:
grep -R "getKey" now_you_see_me/smali* | head
Inside DataBridge.smali (or the Kotlin sources, if they survived) You’ll spot:
Reversing Android apps is as much about strategy as it is about skill. These lessons, like starting with apktool, staying alert to payloads hidden in assets, and treating every XOR as a puzzle with a simple solution, can save you hours of dead ends. Always dig beyond surface-level clues, question what looks too obvious, and don’t underestimate small native libraries. With practice and a sharp eye, these principles become second nature, and that’s when real progress begins.