mcpField
R
reverse-engineering

reverse-engineering

github.com/r00tedbrain-backupSecurity294 installsUpdated 27w ago
Repository

About reverse-engineering

A reverse-engineering and debugging skill for security practitioners, covering static and dynamic analysis, vulnerability discovery, and binary exploitation. It routes tasks to focused references and includes utilities for IDA exports and Android DEX dumping.

Key features

  1. 01Task- and format-based reference guides
  2. 02Static and dynamic analysis workflows
  3. 03Vulnerability discovery methodology
  4. 04IDA export plugin
  5. 05Android DEX dump script

Use cases

  1. 01Triage an unfamiliar binary
  2. 02Analyze mobile apps or malware
  3. 03Debug crashes and investigate vulnerabilities
  4. 04Write analysis scripts for Ghidra or IDA

MCP support

Includes setup notes for connecting agents to upstream MCP servers such as ida-pro-mcp, GhidraMCP, and r2mcp, plus a live-query workflow.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/r00tedbrain-backup/skills --skill reverse-engineering

After installing, type/reverse-engineeringin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
android-re.md
anticheat-re.md
dynamic-debugging.md
exploit-dev.md
firmware-embedded.md
frida.md
ghidra-scripting.md
idapython.md
ios-re.md
macos-kernel-re.md
malware-analysis.md
managed-code-re.md
protocol-re.md
static-analysis.md
struct-recovery.md
symbol-recovery.md
unicorn-emulation.md
windows-re.md
tools/
dex_memory_dumper.js
ida_export_plugin.py
README.md
tools/mcp/
claude-config-snippets.json
cline-config-snippets.json
continue-config-snippets.json
cursor-config-snippets.json
ghidra-mcp.md
ida-pro-mcp.md
opencode-config-snippets.json
README.md
windsurf-config-snippets.json

Details

From the project README

Reverse Engineering & Debugging

Professional methodology for static analysis, dynamic analysis, debugging, and binary exploitation.

Quick Reference — Load the Right Reference File

TaskReference File
Static analysis, disassembly, Ghidra, radare2, objdump, patchingreferences/static-analysis.md
GDB (+ pwndbg/gef/peda), LLDB, strace/ltrace, crash analysisreferences/dynamic-debugging.md
Android APK, DEX, smali, ADB, Frida on Android, repackagingreferences/android-re.md
iOS IPA, Mach-O, class-dump, Frida ObjC/Swift, Keychainreferences/ios-re.md
macOS XPC, launchd, kext, SIP, Linux kernel modulesreferences/macos-kernel-re.md
Windows PE, WinDbg, x64dbg, .NET/dnSpy, kernel driversreferences/windows-re.md
Frida scripting, hooking Java/Native/ObjC, SSL unpin, gadgetreferences/frida.md
.NET IL, dnSpy, de4dot, Java/JVM, Kotlin, Unity/IL2CPP, Monoreferences/managed-code-re.md
Malware, obfuscation, packer analysis, IOC extraction, Volatilityreferences/malware-analysis.md
CTF pwn/rev, BOF, ROP, heap exploitation, pwntools, angr/Z3references/exploit-dev.md
Network protocol RE, Wireshark, mitmproxy, Protobuf, gRPC, Lua dissectors, Boofuzzreferences/protocol-re.md
Firmware, binwalk, QEMU emulation, JTAG/UART, U-Boot, IoTreferences/firmware-embedded.md
EAC, BattlEye, Vanguard, FACEIT, VAC, kernel AC analysisreferences/anticheat-re.md
Ghidra Python/Java scripts, headless, vulnerability finding, custom analyzersreferences/ghidra-scripting.md
IDAPython / IDALib scripts, Hex-Rays API, batch decompile, OLLVM helpersreferences/idapython.md
Unicorn engine emulation, function-level emulation, JNI stubbing, syscall simreferences/unicorn-emulation.md
Stripped symbol recovery, magic numbers, paired calls, xref analysisreferences/symbol-recovery.md
C/C++ structure recovery, vtables, std::string/vector/map, field type inferencereferences/struct-recovery.md

Bundled Tools (tools/)

The skill ships ready-to-use companion utilities (all original work, MIT-licensed):

ToolPurpose
tools/ida_export_plugin.pyIDA Pro plugin (Ctrl-Shift-E) — exports the IDB into a decompile/ directory of plain-text files an agent can read directly
tools/dex_memory_dumper.jsFrida agent — dumps DEX from a running Android process via memory scan + ClassLoader traversal
tools/mcp/Setup notes and config snippets for connecting agents to upstream MCP servers (ida-pro-mcp, GhidraMCP, r2mcp)

See tools/README.md for usage details. The tools/mcp/ directory documents the live-query workflow (alternative to file export) — both modes are supported by the methodology files above.


Universal First Steps

Before loading any reference file, establish context:

1. Identify the Target
file <binary>           # file type, arch, bits, stripped?
xxd <binary> | head -4  # magic bytes
strings -a <binary> | head -60
checksec --file=<binary>  # NX, PIE, RELRO, stack canary, ASLR

Binary format decision tree:

  • ELF → Linux native → references/static-analysis.md + references/dynamic-debugging.md
  • PE/PE32+ → Windows native → references/windows-re.md + references/static-analysis.md
  • PE with .NET metadata → references/managed-code-re.md (dnSpy first)
  • Mach-O → macOS/iOS → references/macos-kernel-re.md + references/ios-re.md
  • DEX/APK/AAB → Android → references/android-re.md
  • JAR/WAR/AAR → Java → references/managed-code-re.md
  • .sys driver → references/windows-re.md (kernel section) or references/anticheat-re.md
  • Assembly-CSharp.dll → Unity → references/managed-code-re.md (Unity section)
  • Unknown/firmware → references/firmware-embedded.md (binwalk + entropy)

Task-type decision tree (applies to any format):

  • Stripped binary, unknown functions → references/symbol-recovery.md
  • Unknown struct layouts in decompilation → references/struct-recovery.md
  • Need to run just one function in isolation → references/unicorn-emulation.md
  • Using IDA Pro for analysis → references/idapython.md
  • Using Ghidra for analysis → references/ghidra-scripting.md
2. Establish Scope

Ask the user (or infer from context):

  • Goal: understand logic / find vuln / bypass protection / patch / CTF flag / malware IOCs?
  • Platform: Linux / Windows / macOS / Android / iOS / embedded?
  • Tools available: Ghidra / IDA / radare2 / Binary Ninja / Hopper?
  • Dynamic possible?: Can we run it? VM? Emulator? Physical device?
3. Choose Analysis Mode
Static only  → No execution risk, slower understanding
Dynamic only → Fast but misses dead code
Static + Dynamic (recommended) → Static for map, dynamic for runtime truth

Core Toolchain Summary

Static
ToolBest For
GhidraFull decompilation, scripting, free
radare2 / cutterCLI powerhouse, scripting, embedded
Binary NinjaAPI-first, fast, commercial
IDA Pro / IDA FreeIndustry standard, best signatures
objdumpQuick disassembly, no install
readelf / nmELF symbol/section inspection
jadxAndroid DEX → Java, GUI
apktoolAPK unpack / repack / smali
Dynamic
ToolBest For
GDB + pwndbg/peda/gefLinux ELF debugging
LLDBmacOS/iOS/Swift debugging
FridaCross-platform hooking, no source
strace / ltraceSyscall / library call tracing
ValgrindMemory errors, Helgrind
WinDbgWindows kernel + user mode
x64dbgWindows GUI debugger
Network
ToolBest For
Wireshark / tsharkPacket capture + dissection
mitmproxy / Burp SuiteHTTP/S MITM
FridaIn-process SSL unpin
tcpdumpHeadless capture

Methodology Frameworks

Static Analysis Workflow
1. file + strings + checksec           → quick triage
2. Entropy analysis                    → packed/encrypted?
3. Import table / symbol table         → understand capabilities
4. Load in decompiler                  → rename, retype, annotate
5. Identify key functions              → main(), crypto, network, anti-debug
6. Trace data flow                     → user input → sink
7. Document findings                   → comment inline
Dynamic Analysis Workflow
1. Set up isolated environment         → VM / container / device
2. Run with strace/ltrace first        → understand syscall footprint
3. Attach debugger                     → set breakpoints at key functions
4. Observe runtime behavior            → memory, registers, branches taken
5. Correlate with static              → validate decompiler output
6. Patch / hook as needed             → bypass checks, log values
Vulnerability Discovery Workflow
1. Attack surface mapping             → inputs: file, network, env vars, args
2. Dangerous function search          → strcpy, gets, sprintf, memcpy, system
3. Integer overflow candidates        → size calculations, loops
4. Format string candidates           → printf(user_input)
5. UAF / double-free candidates       → heap allocation patterns
6. Trigger + confirm                  → crash → controlled → exploitable

Anti-Analysis Bypass — Quick Reference

Anti-Debug Detection
# Check if binary detects debugger
strings <bin> | grep -iE "ptrace|debugger|isDebuggerPresent|TracerPid"

# Linux: ptrace self-detection
# Bypass: preload hook or patch the ptrace call
Common Protections
ProtectionDetectionBypass
ptrace anti-debugstrace shows ptrace(TRACEME)Patch JNZ→JMP or LD_PRELOAD fake ptrace
Timing checksrdtsc / clock_gettime in loopPatch comparison or NOP
Checksum/integrityHash of own .text sectionPatch after decryption, before check
Packer (UPX etc.)High entropy + small importsupx -d / dump from memory after unpack
Obfuscated stringsNo readable stringsRun + extract from memory / Frida hook
SSL pinning (mobile)Network fail in appFrida ssl-unpin / see references/frida.md

Output Standards

When reporting RE findings, always structure output as:

## Binary: <name>
- **Format**: ELF64 / PE32+ / DEX / Mach-O
- **Arch**: x86_64 / ARM64 / ARMv7 / MIPS
- **Stripped**: Yes/No | **PIE**: Yes/No | **NX**: Yes/No

## Key Findings
1. <function name @ offset> — <what it does>
2. ...

## Vulnerability / Behavior
- <description with evidence>
- Offset: 0x<addr>
- Triggerable via: <input vector>

## Recommended Next Steps
- [ ] <action>

Naming Conventions for Decompiler Work

Follow these standards when annotating in Ghidra / IDA / r2:

Functions:  verb_noun_context      → decrypt_config_xor, check_license_hwid
Variables:  type_purpose           → buf_user_input, sz_packet, ptr_heap_chunk
Structs:    ST_<name>              → ST_PacketHeader, ST_LicenseData
Labels:     loc_<purpose>         → loc_anti_debug_fail, loc_success

Scripting Quick Starters

See references/frida.md for full Frida patterns.

GDB Python one-liner (log function args)
# In GDB: source this file
import gdb
class LogArgs(gdb.Breakpoint):
    def stop(self):
        frame = gdb.selected_frame()
        print(f"[*] {frame.name()} rdi={gdb.parse_and_eval('$rdi')} rsi={gdb.parse_and_eval('$rsi')}")
        return False  # don't stop, just log
LogArgs("target_function")
radare2 batch analysis
r2 -A -q -c "afl~suspicious; pdf @ sym.check_license" <binary>
Ghidra headless analysis
$GHIDRA_HOME/support/analyzeHeadless /tmp/proj MyProject \
  -import <binary> -postScript PrintAST.java -scriptPath ~/ghidra_scripts

Comments

Markdown supported