BAP (Binary Analysis Platform) Cheatsheet
# Install WSL and Ubuntu
wsl --install
# Inside WSL:
sudo apt update
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:avsm/ppa
sudo apt update
sudo apt install -y opam
opam init
opam switch create 4.14.0
eval $( opam env)
opam install bap
# Ubuntu/Debian
sudo apt update
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:avsm/ppa
sudo apt update
sudo apt install -y opam
opam init
opam switch create 4.14.0
eval $( opam env)
opam install bap
# Fedora/RHEL
sudo dnf install -y opam
opam init
opam switch create 4.14.0
eval $( opam env)
opam install bap
# Using Homebrew
brew install opam
opam init
opam switch create 4.14.0
eval $( opam env)
opam install bap
Command
Usage
Purpose
bap info
bap info binary
Display binary information
bap objdump
bap objdump binary
Disassemble binary
bap byteweight
bap byteweight binary
Function start analysis
bap checksec
bap checksec binary
Security features check
bap dependencies
bap dependencies binary
Show dependencies
Command
Usage
Purpose
bap analyze
bap analyze binary
Full analysis
bap run
bap run analysis.ml
Run analysis script
bap disassemble
bap disassemble binary
Disassemble code
bap optimize
bap optimize binary
Optimize IR
bap reconstruct
bap reconstruct binary
Reconstruct CFG
Command
Usage
Purpose
bap bir
bap bir binary
Generate BIR
bap bir-opt
bap bir-opt input.bir
Optimize BIR
bap bir-sketch
bap bir-sketch binary
Generate BIR graph
bap bir-dump
bap bir-dump binary
Dump BIR
bap bir-sema
bap bir-sema binary
Semantic analysis
Command
Usage
Purpose
bap list
bap list plugins
List plugins
bap load
bap load plugin
Load plugin
bap update
bap update plugins
Update plugins
bap remove
bap remove plugin
Remove plugin
bap show
bap show plugin
Show plugin info
Command
Usage
Purpose
bap export
bap export binary
Export analysis
bap dump-symbols
bap dump-symbols binary
Export symbols
bap dump-bir
bap dump-bir binary
Export BIR
bap to-ida
bap to-ida binary
Export to IDA
bap to-ghidra
bap to-ghidra binary
Export to Ghidra
Command
Usage
Purpose
bap debug
bap debug binary
Debug mode
bap trace
bap trace binary
Trace execution
bap memory
bap memory binary
Memory analysis
bap verify
bap verify binary
Verify analysis
bap log
bap log analysis
Log