SKILL.md--- name: binary-re-tool-setup description: Use when reverse engineering tools are missing, not working, or need configuration. Installation guides for radare2 (r2), Ghidra, GDB, QEMU, Frida, binutils, and cross-compilation toolchains. Keywords - "install radare2", "setup ghidra", "r2 not found", "qemu missing", "tool not installed", "configure gdb", "cross-compiler" --- # Tool Setup ## Purpose Ensure required reverse engineering tools are available and properly configured for cross-architecture analysis. ## When to Use - Before first analysis session - When tool commands fail - Setting up new analysis environment - Updating to newer tool versions ## Required Tools | Tool | Purpose | Priority | |------|---------|----------| | radare2 | Static analysis, disassembly | **Required** | | rabin2 | Fast binary triage | **Required** (part of r2) | | qemu-user | Cross-arch emulation | **Required** | | gdb-multiarch | Cross-arch debugging | **Required** | | Ghidra | Decompilation | Recommended | | GEF | GDB enhancements | Recommended | | Frida | Dynamic instrumentation | Optional | | Unicorn | Snippet emulation | Optional | | Angr | Symbolic execution | Optional | ## Installation by Platform ### Ubuntu/Debian ```bash # Core tools sudo apt update sudo apt install -y \ radare2 \ qemu-user \ qemu-user-static \ gdb-multiarch \ binutils-multiarch \ jq # Required for JSON parsing in skill commands # ARM sysroots (for QEMU) sudo apt install -y \ libc6-armhf-cross \ libc6-arm64-cross \ libc6-dev-armhf-cross \ libc6-dev-arm64-cross # Additional utilities sudo apt install -y \ file \ binutils \ elfutils \ patchelf ``` ### Windows (WSL2) Windows users should use WSL2 with Ubuntu for full compatibility: ```powershell # PowerShell (Administrator) - Install WSL2 with Ubuntu wsl --install -d Ubuntu # Restart computer when prompted, then open Ubuntu terminal ``` Inside WSL2 Ubuntu: ```bash # Install all required tools sudo apt update && sudo apt install -y \ radare2 \ qemu-user \ qemu-user-static \ gdb-multiarch \ binutils-multiarch \ jq \ file \ patchelf # Fix file permissions for Windows-mounted drives sudo tee -a /etc/wsl.conf > /dev/null << 'EOF' [automount] options = "metadata,umask=22,fmask=11" EOF # Restart WSL to apply changes # (In PowerShell: wsl --shutdown) ``` **WSL2 Tips:** - Copy binaries into `~` rather than using `/mnt/c/...` paths (fewer permission issues) - Use `wsl --shutdown` in PowerShell to restart WSL after config changes - Docker Desktop integrates with WSL2 for container-based analysis ### macOS (Homebrew) ```bash # Core tools brew install radare2 jq # NOTE: Homebrew QEMU may lack qemu-user targets # Verify: qemu-arm --version || echo "qemu-user missing" # If missing, use Docker for cross-arch execution (see below) # GDB requires special handling on macOS brew install gdb # Note: Code signing required for debugging # ARM cross tools (optional, for s