ワンクリックで
ida-reverse-engineering
Workflows and patterns for using IDA MCP and idat (headless) to analyze Android native libraries and JNI interfaces.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Workflows and patterns for using IDA MCP and idat (headless) to analyze Android native libraries and JNI interfaces.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Fully automated reverse-engineering orchestrator. Given a target (Android APK/AAB/XAPK, web URL, or Windows PE), it drives the end-to-end workflow — fingerprinting → planning the analysis chain → static analysis → dynamic analysis → native deep-dive → result synthesis → reproduction & verification — and produces a structured report. This is the entry point of the auto_reverse project, responsible for deciding "which skill/tool to invoke and when, and what to do next once results come back." Trigger scenarios: automated reversing, "reverse this app/website," auto-reverse, fully automated analysis, "here's an APK, run it automatically," "I don't know where to start."
Generic dynamic instrumentation / trace engine for heavily-obfuscated anti-bot JavaScript. Takes ANY obfuscated JS, weaves Babel AST probes (function enter/exit, variable assignments, member reads), recursively re-instruments every runtime-generated string (eval / new Function / string setTimeout) so code that only exists after decryption is also traced, runs it bare in a Node harness on top of an env-supplement-proxy environment, and dumps an aggregated execution trace (hot functions, hot variables, dynamic code-gen layers, candidate sign outputs). Ships an L2 anti-detection prelude (clock freeze defeats timing anti-debug; DebuggerStatement stripping; eval/Function toString spoofing). This is the OBSERVATION layer that stacks on top of env-supplement-proxy / node-bridge-build (which make the JS RUN) — it shows HOW the algorithm computes, not just its output. Use when you must understand the internal computation of obfuscated sign/cookie JS, capture runtime-decrypted algorithm code, or produce an execution tr
Use capa (Mandiant) + FLOSS to perform capability triage and string deobfuscation on native libraries (.so / ELF) and executables—before diving into IDA/Ghidra decompilation, automatically identify what capabilities a binary has (crypto/network/anti-debug/anti-analysis/file operations) and recover obfuscated/encoded/stack-built strings (URLs, keys, C2). Trigger scenarios — capa, floss, analyze .so capabilities, identify crypto algorithms, native library capability overview, deobfuscate strings, triage before digging deep.
Decompile Android APK, XAPK, JAR, and AAR files using jadx or Fernflower/Vineflower. Reverse engineer Android apps, extract HTTP API endpoints (Retrofit, OkHttp, Volley), and trace call flows from UI to network layer. Use when the user wants to decompile, analyze, or reverse engineer Android packages, find API endpoints, or follow call flows. Trigger keywords: decompile APK, Android reverse engineering, extract API, analyze Android app, decompile Android, reverse engineering, trace call chain, extract interfaces
Android reverse-engineering onboarding and fundamentals. Covers device preparation and rooting (unlock bootloader, flash a clean ROM, Magisk root, real-device vs emulator trade-offs), full environment setup (JDK, adb/fastboot, Frida server/tools, Charles/mitmproxy CA certificates), APK internal structure and the forward packaging pipeline, the Android filesystem and partition layout, decompile-and-hook basics, and phone UI automation. Use this when bootstrapping an Android RE workstation, when the user is new to Android reverse engineering, or when they ask how to root a phone, set up Frida/adb/Charles, understand APK/DEX structure, learn the Android filesystem, or automate a device. Trigger keywords — android reverse engineering basics, set up Frida, install adb, root phone, unlock bootloader, flash ROM, Magisk, APK structure, DEX, AndroidManifest, Android filesystem, phone automation, uiautomator2, Charles certificate, JDK install, Android reverse engineering getting started, flashing ROM, root, environment
Fully automatic APK acquisition for Android reversing. Given a package name, it obtains the APK through the first route that works — pull from a connected adb device, use a local file, or download from APKPure's direct-link endpoint (XAPK with splits or single APK) — then optionally installs it back to a device and verifies the package name. This is Phase 0 (Intake) of the auto_reverse orchestrator: it answers "I don't have the APK yet, get it for me" without manual confirmation. Trigger terms: get the apk, download apk, acquire apk, pull apk, automatic apk acquisition, download apk, install apk, app not installed / not available locally.
| name | ida-reverse-engineering |
| description | Workflows and patterns for using IDA MCP and idat (headless) to analyze Android native libraries and JNI interfaces. |
This skill documents effective patterns for analyzing Android native libraries (.so files) using IDA Pro — both via MCP server (GUI) and idat headless mode (CLI).
Use when IDA GUI is open with the MCP plugin active (Edit → Plugins → MCP, or Ctrl+Option+M on macOS).
http://127.0.0.1:13337decompile(), list_funcs(), lookup_funcs(), callgraph(), callees(), find(), py_eval()Use idat for batch analysis without GUI, Accessibility permissions, or user interaction.
This is the preferred mode for automated/agent-driven analysis.
# Location (macOS, IDA Pro 9.3)
IDAT="/Applications/IDA Professional 9.3.app/Contents/MacOS/idat"
# Run analysis script (auto-analysis, then script, then exit)
"$IDAT" -A -S/path/to/script.py -L/path/to/output.log /path/to/binary.so
# If .i64 database already exists, it reuses it (no re-analysis needed)
Key flags:
-A: Auto-analysis mode (no user prompts)-S<script.py>: Run IDAPython script after loading-L<logfile>: Redirect all output (including script prints) to log file.i64 database; subsequent runs reuse itScript template:
import idaapi
import idautils
import idc
# Wait for auto-analysis to complete
idaapi.auto_wait()
# Optional: load Hex-Rays decompiler
if not idaapi.init_hexrays_plugin():
print("[!] Hex-Rays not available")
idc.qexit(1)
# --- Your analysis code here ---
# Decompile a function
cfunc = idaapi.decompile(0xADDRESS)
if cfunc:
print(str(cfunc))
# Find xrefs to an address
for xref in idautils.XrefsTo(0xADDRESS):
fname = idc.get_func_name(xref.frm)
print(f" xref from {hex(xref.frm)} in {fname}")
# Search strings
for s in idautils.Strings():
if "keyword" in str(s):
print(f" String '{str(s)}' at {hex(s.ea)}")
# Always exit cleanly
idc.qexit(0)
py_eval(code="import idaapi; print(idaapi.get_input_file_path())")print(idaapi.get_input_file_path())Java_# Find RegisterNatives registration tables
for s in idautils.Strings():
sv = str(s)
if sv in ["(I[Ljava/lang/Object;)[Ljava/lang/Object;", "(I[Ljava/lang/Object;)Ljava/lang/Object;"]:
print(f"JNI sig '{sv}' at {hex(s.ea)}")
for xref in idautils.XrefsTo(s.ea):
# The xref location often contains: {method_name_ptr, signature_ptr, native_func_ptr}
print(f" ref from {hex(xref.frm)}")
# Read the native function pointer nearby
idaapi.decompile(addr) → returns pseudocodeidautils.XrefsTo(addr) / idautils.XrefsFrom(addr)idautils.FuncItems() + XrefsFrom with fl_CN/fl_CF types# Find all functions referencing a global variable
for xref in idautils.XrefsTo(0x1C10A0):
fname = idc.get_func_name(xref.frm)
print(f" ref from {hex(xref.frm)} in {fname}")
idautils.Strings() with keyword filteridautils.CodeRefsTo() or manual disasm scanningidautils.Functions() to iterate all functionsMany protected native libraries use:
BR X8 indirect jumpsxor_decrypt_string() patternsLDAXR/STLXR patterns on global state variables# Detect CFF dispatcher patterns - functions with indirect branches
for ea in idautils.Functions():
func = idaapi.get_func(ea)
if not func:
continue
for item in idautils.FuncItems(ea):
mnem = idc.print_insn_mnem(item)
if mnem == "BR":
print(f" Indirect branch in {idc.get_func_name(ea)} at {hex(item)}")
For multi-threaded native code (common in security SDKs):
# Find all pthread_create call sites
for ea in idautils.Functions():
name = idc.get_func_name(ea)
if name == "pthread_create":
for xref in idautils.XrefsTo(ea):
caller = idc.get_func_name(xref.frm)
print(f" pthread_create called from {hex(xref.frm)} in {caller}")
import idaapi, idautils, idc
idaapi.auto_wait()
idaapi.init_hexrays_plugin()
# 1. JNI exports
print("=== JNI Exports ===")
for ea in idautils.Functions():
name = idc.get_func_name(ea)
if "JNI_OnLoad" in name or name.startswith("Java_"):
print(f" {name} at {hex(ea)}")
# 2. Interesting strings
print("\n=== Key Strings ===")
keywords = ["basic_string", "pthread", "encrypt", "sign", "token", "null"]
for s in idautils.Strings():
sv = str(s)
if any(k in sv.lower() for k in keywords):
print(f" '{sv}' at {hex(s.ea)}")
# 3. pthread usage
print("\n=== pthread_create Sites ===")
for ea in idautils.Functions():
if idc.get_func_name(ea) == "pthread_create":
for xref in idautils.XrefsTo(ea):
print(f" from {hex(xref.frm)} in {idc.get_func_name(xref.frm) or '?'}")
# 4. Decompile specific targets
targets = [0x12345] # Add your addresses
for addr in targets:
print(f"\n=== Decompile {hex(addr)} ===")
try:
cfunc = idaapi.decompile(addr)
if cfunc:
print(str(cfunc))
except:
print("[!] Failed")
idc.qexit(0)
idat run creates it; subsequent runs load instantlyidat run takes ~30-60s to load; batch related queries together