#!/bin/bash
# Phase 9 — Binary Analysis & Reverse Engineering
source "$(dirname "$0")/lib.sh"

phase_header "PHASE 9 — Binary Analysis & Reverse Engineering"

section "Debuggers"
chk "gdb"               gdb
chk_dir "pwndbg"        /opt/pwndbg
chk_file "GEF"          /root/.gef-2026.01.py

section "Disassemblers / Decompilers"
chk "radare2"           radare2
chk "r2"                r2
chk "ghidra"            ghidra
chk "objdump"           objdump
chk "jadx"              jadx

section "Binary Analysis"
chk "binwalk"           binwalk
chk "strings"           strings
chk "file"              file
chk "xxd"               xxd
chk "hexedit"           hexedit
chk "nm"                nm
chk "readelf"           readelf
chk "ltrace"            ltrace
chk "strace"            strace
chk "patchelf"          patchelf

section "Exploit Development"
chk_py "pwntools"       pwn
chk "ROPgadget"         ROPgadget
chk_py "ropper"         ropper
chk "nasm"              nasm

section "Python Libraries"
chk_py "capstone"       capstone
chk_py "keystone"       keystone
chk_py "unicorn"        unicorn
chk_py "angr"           angr

section "Obfuscation / Strings"
chk_py "floss"          floss

section "Fuzzing"
chk "afl-fuzz"          afl-fuzz
chk "radamsa"           radamsa
chk_py "boofuzz"        boofuzz

section "YARA"
chk "yara"              yara
chk_py "yara"           yara
chk_dir "YARA-Rules"    /opt/yara-rules

section "Malware Analysis"
chk_py "volatility3"    volatility3.framework
chk_py "volatility3-dir" volatility3.framework
chk "foremost"          foremost
chk "bulk_extractor"    bulk_extractor

section "Forensics"
chk "exiftool"          exiftool
chk "binwalk"           binwalk
chk "sleuthkit"         fls

phase_summary
