Skip to content

Basic CLI Tools

The B2R2 launcher provides small command-line tools for inspecting, disassembling, assembling, and exploring binaries. The examples below all run from the extracted cli/ directory from tutorial.zip.

The cli/ directory contains:

  • echo: a stripped x86-64 ELF binary
  • asm.s: an assembler example

Run commands from the cli/ directory so the paths match the commands below.

scan reads binary metadata without executing the target.

Terminal window
b2r2 scan echo
b2r2 scan --file-header --section-headers echo
b2r2 scan --symbols --plt echo

Use this to inspect:

  • file format, architecture, and entry point
  • stripped status, NX, and PIE
  • section layout
  • symbols and PLT entries

disasm prints a section-level disassembly and can also lift instructions to LowUIR.

Terminal window
b2r2 disasm --section .text echo
b2r2 disasm --section .plt echo
b2r2 disasm --lift --section .text echo

Use this to inspect:

  • section-level disassembly
  • PLT stubs as imported-call entry points
  • LowUIR output from --lift

asm assembles textual assembly into machine bytes.

Terminal window
b2r2 asm asm.s
b2r2 asm --base-addr 400000 asm.s

Interactive mode:

Terminal window
b2r2 asm

Example input:

inc ebx;;
ret;;
quit

Enter quit to exit the b2r2 asm REPL.

explore recovers functions and opens the Avalonia GUI by default.

Terminal window
# b2r2 explore does not take a binary file unless --no-gui is set.
# Use [File]-[Open Binary...] in the GUI menu bar to open a binary.
b2r2 explore
b2r2 explore --no-gui echo

Use --no-gui when you want terminal-only output or when a GUI environment is not available.

Show GUI example
BinExplore GUI showing recovered functions, a control-flow graph, and a hex view.
BinExplore GUI after opening the tutorial binary.

Use this to inspect:

  • function list
  • section list
  • disassembly and CFG workspace
  • hex overview and hex view
  • navigation toolbar and status bar

In --no-gui mode, enter quit to exit the b2r2 explore REPL.