REVERSEMEDIUMHackTheBox CyberApocalypse '24

Unpacking Obfuscated Android ELF Native Libraries with Frida and Unicorn

Dumping dynamically decrypted OLLVM functions from .so memory using Frida hook on JNI_OnLoad and resolving control flow flattening with symbolic execution.

bin_wizard
@bin_wizardAuthor // Research Op
7 min read2.9k views

Unpacking Obfuscated Android ELF Native Libraries with Frida and Unicorn

Approach

The target binary utilized OLLVM control flow flattening. We hooked mprotect and dumped the decrypted pages.

JAVASCRIPT
Interceptor.attach(Module.findExportByName(null, "mprotect"), {
    onEnter: function(args) {
        console.log("[*] mprotect called: " + args[0] + " len: " + args[1]);
    }
});
FLAG SOLUTION // SPOILER
WHUB{0llvm_cff_fl4tt3n1ng_unp4ck3d}
bin_wizard
@bin_wizard

Reverse engineer & firmware unpacker. Ghidra scripting and binary deobfuscation enthusiast.

View Researcher Profile