Best for
- Symbolic execution for key validation: Recover algorithm via SMT solving
- Binary diffing for patch analysis: Identify CVE patches + 1-day exploitation
- Firmware RE for routers / IoT: Extract filesystem + analyze embedded services
brucesongs/kali-claw/skills/reverse-engineering-advanced/SKILL.md
Advanced reverse engineering covering symbolic execution (angr, KLEE, manticore), decompiler confusion (Hex-Rays, Ghidra deobfuscation), binary diffing (BinDiff, Diaphora, Kam1n0), firmware RE workflow (binwalk, FACT, EMBA), and obfuscated code analysis (LLVM obfuscation, OLLVM, Tigress). Distinct from foundational `binary-reverse` — focuses on advanced program analysis, automated RE techniques, and firmware / obfuscation workflows. Use when analyzing obfuscated or packed binaries, automating RE
Decision brief
Advanced reverse engineering covering symbolic execution (angr, KLEE, manticore), decompiler confusion (Hex-Rays, Ghidra deobfuscation), binary diffing (BinDiff, Diaphora, Kam1n0), firmware RE workflow (binwalk, FACT, EMBA), and obfuscated code analysis (LLVM obfuscation, OLLVM, Tigress). Distinct from foundational `binary-reverse` — focuses on advanced pro…
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/brucesongs/kali-claw --skill "skills/reverse-engineering-advanced"Inspect the Agent Skill "reverse-engineering-advanced" from https://github.com/brucesongs/kali-claw/blob/a3205f5484ca8fec9fd809f3c16fe41fbc6ac87e/skills/reverse-engineering-advanced/SKILL.md at commit a3205f5484ca8fec9fd809f3c16fe41fbc6ac87e. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
bash file binary sha256sum binary strings binary | head -20
Review the “Phase 2 — Binary diffing” section in the pinned source before continuing.
Review the “Phase 3 — Firmware analysis” section in the pinned source before continuing.
proj = angr.Project('./binary', autoloadlibs=False) state = proj.factory.entrystate()
Review the “Phase 5 — OLLVM deobfuscation” section in the pinned source before continuing.
Permission review
The documentation asks the agent to run terminal commands or scripts.
python3 -c "The documentation includes network, browsing, or remote request actions.
git clone https://github.com/fkie-cad/FACT_coreThe documentation asks the agent to run terminal commands or scripts.
git clone https://github.com/fkie-cad/FACT_coreThe documentation includes network, browsing, or remote request actions.
git clone https://github.com/e-m-b-a/embaEvidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 67 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Advanced reverse engineering is the discipline of analyzing obfuscated, packed, or firmware binaries using automated program analysis: symbolic execution (angr, KLEE, manticore) for path exploration, decompiler confusion techniques (Hex-Rays deobfuscation, Ghidra script automation), binary diffing (BinDiff, Diaphora, Kam1n0) for variant analysis, firmware RE workflow (binwalk, FACT, EMBA) for embedded device analysis, and obfuscated code analysis (LLVM obfuscation, OLLVM, Tigress). This domain covers modern program-analysis techniques that scale beyond manual reverse engineering, with industry-standard tooling workflows. Distinct from foundational binary-reverse (which covers basic radare2 / Ghidra introduction) — this skill focuses on advanced program analysis, automated RE pipelines, and firmware / obfuscation workflows.
This skill covers advanced reverse engineering:
Out of scope: foundational RE (see binary-reverse), malware analysis workflow (see malware-analysis-advanced), exploit development (see exploit-development).
| Tool | Purpose |
|---|---|
angr | Python symbolic execution framework |
KLEE | LLVM-based symbolic execution |
manticore | Symbolic execution (Trail of Bits) |
Ghidra | NSA open-source RE tool |
IDA Pro | Industry-standard disassembler + decompiler |
Binary Ninja | Modern disassembler with rich API |
radare2 | Open-source disassembler |
binwalk | Firmware analysis tool |
BinDiff | Binary diffing (Google/Zynamics) |
Diaphora | Free BinDiff alternative (IDA plugin) |
Kam1n0 | Binary similarity (assembly) |
FACT | Firmware Analysis Compare Tool |
EMBA | Embedded firmware analyzer |
ollvm-tools | OLLVM deobfuscation tools |
deflat | Control Flow Flattening deobfuscation |
snowman-decompiler | Open-source decompiler |
retdec | Avast open-source decompiler |
imhex | Modern hex editor |
pe-tree | Visual PE analysis |
ida-deobfuscator | IDA plugin for deobfuscation |
file binary
sha256sum binary
strings binary | head -20
# Architecture
file binary
# Imported functions
nm -D binary 2>/dev/null | head
readelf -d binary 2>/dev/null | head
# Section entropy (packed indicator)
python3 -c "
import sys
with open('binary', 'rb') as f:
data = f.read()
import math
entropy = -sum((data.count(b)/len(data)) * math.log2(data.count(b)/len(data)) for b in set(data))
print(f'Entropy: {entropy:.2f}')
"
# BinDiff (Google)
bindiff --binary1=v1.exe --binary2=v2.exe --output_dir=diffs/
# Diaphora (IDA plugin)
# 1. Open v1.exe in IDA → Export with Diaphora
# 2. Open v2.exe in IDA → Diff with Diaphora
# Patch diff (CVE analysis)
# 1. Get pre-patch binary
# 2. Get post-patch binary
# 3. BinDiff / Diaphora to identify changed functions
# 4. Analyze changed function for CVE
# Binwalk - scan for signatures
binwalk firmware.bin
# Extract filesystem
binwalk -e firmware.bin
# FACT (Firmware Analysis Compare Tool)
git clone https://github.com/fkie-cad/FACT_core
cd FACT_core
./install
# EMBA (firmware analyzer)
git clone https://github.com/e-m-b-a/emba
cd emba
./emba -l /logs -f firmware.bin
import angr
proj = angr.Project('./binary', auto_load_libs=False)
state = proj.factory.entry_state()
# Find address that prints "Good boy"
good_addr = 0x400a00
# Avoid address that prints "Bad boy"
bad_addr = 0x400a50
sm = proj.factory.simulation_manager(state)
sm.explore(find=good_addr, avoid=bad_addr)
if sm.found:
found_state = sm.found[0]
print(f"Solution: {found_state.posix.dumps(0)}")
# Control Flow Flattening (CFF) - deflat
# Requires identification of dispatcher + state variable
python3 deflat.py --binary flattened.exe --dispatcher 0x401000 --state-var eax
# Bogus Control Flow (BCF) - identify opaque predicates
# Use semantic analysis to identify always-true/always-false branches
# Instruction Substitution (SUB) - use MVP / miasm for simplification
# IDA Python: identify anti-decompiler patterns
import idautils, idc
for func_ea in idautils.Functions():
name = idc.get_func_name(func_ea)
# Look for anti-decompiler patterns:
# - Stack manipulation tricks
# - Self-modifying code
# - Anti-disassembly patterns (JE+0 / JNE-1)
# - Overlapping instructions
pass
import angr
from z3 import *
# Sym execute key check
proj = angr.Project('./binary', auto_load_libs=False)
# Set up initial state with symbolic input
state = proj.factory.entry_state(
stdin=angr.SimFileStream(name='stdin', content=angr.BVS('input', 32*8), size=32)
)
# Find / avoid
sm = proj.factory.simulation_manager(state)
sm.explore(find=0x400a00, avoid=0x400a50)
# Recover solution
print(sm.found[0].posix.dumps(0))
# Kam1n0 - assembly-level similarity
kam1n0 cluster -i samples/ -o clusters.json
# BinDiff - cross-binary
bindiff --binary1=sample1 --binary2=sample2 --output_dir=diff
# Diaphora - many-to-many diff
# Export all samples → database
# Diff against each other → cluster
# CI/CD for binary analysis
import angr, ghidra
def analyze_binary(binary_path):
# 1. Static triage
file_info = file_binary(binary_path)
# 2. Symbolic execution
proj = angr.Project(binary_path)
sm = proj.factory.simulation_manager(proj.factory.entry_state())
sm.explore(find=0x400a00)
if sm.found:
solution = sm.found[0].posix.dumps(0)
return {'status': 'solved', 'solution': solution}
# 3. Ghidra decompilation
result = ghidra.decompile(binary_path)
return {'status': 'analyzed', 'result': result}
Produce RE report:
file binary
sha256sum binary
strings binary | head
python3 -c "
import pefile
pe = pefile.PE('binary.exe')
for s in pe.sections:
print(s.Name.decode().rstrip(chr(0)), s.get_entropy())
"
import angr
proj = angr.Project('./crackme', auto_load_libs=False)
state = proj.factory.entry_state()
# Find / avoid
sm = proj.factory.simulation_manager(state)
sm.explore(find=lambda s: b'Good boy' in s.posix.dumps(1),
avoid=lambda s: b'Bad boy' in s.posix.dumps(1))
if sm.found:
found = sm.found[0]
print(f"Password: {found.posix.dumps(0)}")
bindiff --binary1=original --binary2=patched --output_dir=diffs
# Analyze results
cd diffs
ls
# original_patched.Diff → open in BinDiff UI
binwalk firmware.bin
binwalk -e firmware.bin
ls _firmware.bin.extracted/
# Find filesystem (squashfs, jffs2, etc.)
# Identify dispatcher function
# Look for big switch statement on state variable
# Use deflat.py (https://github.com/cd70s062f/deflat)
python3 deflat.py --binary flattened.exe --dispatcher 0x401000
import z3
# Encode key check
s = z3.Solver()
# Input: 16-byte key
key = [z3.BitVec(f'key_{i}', 8) for i in range(16)]
# Constraints
for i in range(16):
s.add(key[i] >= 0x20)
s.add(key[i] <= 0x7e)
# Key check (derived from disassembly)
s.add(key[0] + key[1] == 0x90)
s.add(key[2] * key[3] == 0x41A8)
# ...
if s.check() == z3.sat:
m = s.model()
print(bytes(m[k].as_long() for k in key))
analyzeHeadless /tmp ghidra_proj -import binary
# Then open GUI
ghidraRun
# Full pipeline: file → static → symbolic → decompile → report
def full_analysis(binary_path):
# Static triage
info = triage(binary_path)
# Symbolic execution (if applicable)
if info['has_constraint_check']:
result = symbolic_solve(binary_path)
# Decompile
decompiled = decompile(binary_path)
# Generate report
return generate_report(info, result, decompiled)
Defenders must assume:
Key defensive controls:
| Tool | Best for | Limitations |
|---|---|---|
| angr | CTF, crackmes, key recovery | Path explosion on complex binaries |
| KLEE | Linux / LLVM binaries | Limited Windows support |
| manticore | Smart contracts, lightweight binaries | Slower than angr |
| Tool | Algorithm | Cost |
|---|---|---|
| BinDiff | Graph isomorphism | Commercial (Zynamics) |
| Diaphora | Multiple algorithms | Free (IDA plugin) |
| Kam1n0 | Assembly clustering | Free (academic) |
| patchkit | Function similarity | Free |
| Tool | Purpose |
|---|---|
| binwalk | Initial scan + extraction |
| FACT | Full firmware analysis |
| EMBA | Automated vulnerability scan |
| firmware-mod-kit | Filesystem repack |
| firmware-sltp | Tool suite |
| Type | Description | Detection |
|---|---|---|
| CFF (Control Flow Flattening) | Big switch dispatcher | Visual CFG |
| BCF (Bogus Control Flow) | Fake branches | Opaque predicates |
| SUB (Instruction Substitution) | Replace operations | Pattern matching |
| CMP (Constant Masking) | Hide constants | Constant analysis |
# angr
pip install angr
# Ghidra
wget https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_11.0_build/ghidra_11.0_PUBLIC_20231222.zip
unzip ghidra_11.0_PUBLIC_20231222.zip
# BinDiff
# Download from https://www.zynamics.com/bindiff.html
# Diaphora (IDA plugin)
git clone https://github.com/joxeankoret/diaphora
# binwalk
pip install binwalk
# FACT
git clone https://github.com/fkie-cad/FACT_core
cd FACT_core && ./install
# EMBA
git clone https://github.com/e-m-b-a/emba
cd emba && ./installer.sh
gdb, radare2, ghidra, ida, frida-server running on production./tmp/.ghidra, ~/.radare2_history, ~/.gdb_history containing sensitive commands.strcpy, system, popen flagged via checksec.index=linux sourcetype=auditd type=EXECVE | search a0 IN ("/usr/bin/gdb","/usr/bin/r2")gdb.exe, ida.exe, x64dbg.exe on production endpoints.ptrace(PTRACE_TRACEME); prevents gdb.rdtsc instructions; debugger introduces delay.0xCC byte (breakpoint instruction)./proc/self/status.cpuid instruction reveals hypervisor bit./proc/vz (OpenVZ), /proc/xen (Xen), /sys/class/dmi/id/product_name.Frequently asked questions
Advanced reverse engineering covering symbolic execution (angr, KLEE, manticore), decompiler confusion (Hex-Rays, Ghidra deobfuscation), binary diffing (BinDiff, Diaphora, Kam1n0), firmware RE workflow (binwalk, FACT, EMBA), and obfuscated code analysis (LLVM obfuscation, OLLVM, Tigress). Distinct from foundational `binary-reverse` — focuses on advanced pro…
The source record exposes this install command: npx skills add https://github.com/brucesongs/kali-claw --skill "skills/reverse-engineering-advanced". Inspect the command and pinned source before running it.
Static rules flagged exec-script, network in the source; the page lists the matching lines and excerpts.
Alternatives
K-Dense-AI/scientific-agent-skills
Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.
K-Dense-AI/scientific-agent-skills
Use NeuroKit2 to build or audit reproducible research workflows for physiological time-series preprocessing, event/interval analysis, multimodal alignment, variability, and complexity. Trigger when code imports neurokit2 or needs its current APIs, schemas, and method-aware validation—not for diagnosis or device validation.
trailofbits/skills
Mutation-driven test vector generation. Finds implementations of a cryptographic algorithm or protocol, runs mutation testing to identify escaped mutants, then generates new test vectors that deliberately exercise the uncovered code paths. Compares before/after mutation kill rates to prove vector effectiveness. Use when generating cryptographic test vectors, measuring Wycheproof coverage gaps, finding escaped mutants via mutation testing, creating cross-implementation test suites, or improving t
travisjneuman/.claude
This skill should be used when writing test cases, fixing bugs, analyzing code for potential issues, or improving test coverage for JavaScript/TypeScript applications. Use this for unit tests, integration tests, end-to-end tests, debugging runtime errors, logic bugs, performance issues, security vulnerabilities, and systematic code analysis.