R2(1)

πŸ’– radare2(1) β€” advanced command-line hexadecimal editor, disassembler and debugger πŸ’–

okay so this is the radare2(1) manual page, bestie β€” manual name folded in near the top like a little name tag 🫢.

🌸 NAME 🌸

radare2 β€” advanced command-line hexadecimal editor, disassembler and debugger. That's the whole mood, no cap. πŸ’…

✨ SYNOPSIS ✨

radare2 [-a arch] [-b bits] [-B baddr] [-c cmd] [-e k=v] [-i file]
        [-I prefile] [-k kernel] [-m addr] [-p project] [-P patch]
        [-r rarun2] [-R rr2rule] [-s addr] [-012AdDEjwntLquvVxX]
        -|--|=|file

🌈 DESCRIPTION 🌈

okay so radare2 is an advanced command-line hex editor, disassembler, and debugger β€” the whole package. It's giving interactive reverse engineering, scripting, and automation capabilities for binary analysis and vulnerability research. iconic fr fr.

The alias r2 may be used as a shorthand for radare2. Slay. ✨

The options are:

  • -- β€” Open radare2 on an empty file
  • - β€” Equivalent of r2 malloc://512
  • -0 β€” Print \x00 after initialization and after every command executed
  • -1 β€” Redirect stderr to stdout
  • -2 β€” Close stderr before starting RCore
  • -a arch β€” force asm.arch (x86, ppc, arm, mips, bf, java, ...)
  • -A β€” run aaa command before prompt or patch to analyze all referenced code. Use -AA to run aaaa
  • -b bits β€” force asm.bits (16, 32, 64)
  • -B baddr β€” Specify the base address to be used when loading a new binary. See e?bin.baddr
  • -c cmd β€” Execute the given command before giving prompt
  • -d β€” Start in debugger mode
  • -D dbg.backend β€” Enable debug mode. Set cfg.debug=true
  • -e k=v β€” Set configuration eval variable key=value. For example -e scr.color=false. When -e is passed after -j, it will set the script source to run instead of setting eval vars.
  • -E β€” Edit the user startup script using the cfg.editor (EDITOR env) of choice
  • -f β€” Blocksize = file size
  • -j β€” Run QJS script if an argument is passed or enter the qjs shell if no file is specified. You can evaluate expressions when passing the -e flag after the -j.
  • -i file β€” Run script, lang program or radare2 plugin file. After the file is loaded
  • -I file β€” Run script, lang program or radare2 plugin file. Before the file is loaded
  • -k kernel β€” Select kernel (asm.os) for syscall resolution
  • -L β€” List loaded IO plugins.
  • -LL β€” List loaded core plugins.
  • -m addr β€” map file at given address
  • -M β€” Disable demangling
  • -n β€” Do not perform any analysis (r_bin). Just load the raw file
  • -nn β€” Only load the rbin structures (elf, mach0, ...)
  • -N β€” Do not load user settings/projects from ~/.radare2rc, ~/.config/radare2/rc and the scripts inside ~/.config/radare2/rc.d/ directory.
  • -NN β€” Same as -N but also disables the automatic loading of plugins on startup time
  • -q β€” Quiet mode (no prompt) and quit after running the commands specified with -i or -c
  • -qq β€” Quit before showing the prompt. Right after all the -e -c and -i arguments are evaluated.
  • -Q β€” Same as q, but exiting without freeing RCore, this produces leaks at exit time, but saves some precious ms to run the testsuite in fast mode.
  • -p prj β€” Set project file
  • -P file β€” Apply rapatch file and quit (see doc/rapatch.md for more details)
  • -r rarun2 β€” Specify dbg.profile rarun2 profile to use when spawning a program for debugging
  • -R rarun2-directive β€” Specify custom rarun2 directives without having to create a rarun2 profile
  • -s addr β€” Start seeking at this address
  • -S β€” Enable sandboxed mode (same as -e cfg.sandbox=true)
  • -t β€” Get binary information and analyze binary in a background thread
  • -T β€” Avoid computing the file hashes
  • -u β€” Set bin.filter=false to load rbin info without filtering names
  • -v β€” Show version information and exit (Use -qv to get just the version number)
  • -V β€” Show radare2 library versions (prints JSON format if -j is used)
  • -w β€” Open in write mode
  • -h β€” Show help message
  • -H [variable] β€” Show files and environment help, or print the selected variable
  • -x β€” Open the file map without executable permissions
  • -X β€” Same as -e bin.usextr=false, do not use extract plugins, useful for dyldcache

🐚 SHELL 🐚

Type ? for help. That's it, that's the vibe. πŸ’–

πŸ‘€ VISUAL πŸ‘€

To enter visual mode use the V command. Then press ? for help. main character energy, honestly. ✨

🫢 DEBUGGER 🫢

In r2 the debugger commands are implemented under the d command. Type d? for help.

Useful debugger additions include:

  • dts+ β€” Start recording reversible debugger session state.
  • dtsc [label] β€” Create a checkpoint from the current live state. Checkpoints carry a stable id and may branch from the current checkpoint.
  • dtsr id β€” Restore a checkpoint by id and continue from that branch.
  • dtsd id β€” Delete a non-current leaf checkpoint.
  • dtst dir / dtsf dir β€” Save and load the current debug session, including checkpoint ids and parent links.
  • dtsw id fd hex / dtswc id [fd / dtswj] β€” Queue replay bytes on a checkpoint file descriptor, clear queued bytes, and inspect replay state in JSON form.

🌈 ENVIRONMENT 🌈

  • R2_ARGS β€” run radare2 with defined arguments in environment and ignore cli ones
  • R2_IGNVER β€” load plugins ignoring the specified version. (be careful)
  • R2_DEBUG β€” if defined, show error messages and crash signal
  • R2_DEBUG_ASSERT=1 β€” set a breakpoint when hitting an assert
  • R2_MAGICPATH β€” /Users/pancake/.local/share/radare2/share/radare2/4.5.0-git/magic
  • R2_NOPLUGINS β€” do not load r2 shared plugins
  • R2_PLUGINS_ORDER β€” plugin load order: i=internal, e=env, h=home, s=system, c=config; default=icehs; ? prints help
  • R2_RCFILE β€” ~/.radare2rc (user preferences, batch script)
  • R2_RDATAHOME β€” /usr/local FILE path to the current working file.

πŸ”— SEE ALSO πŸ”—

r2r(1), rahash2(1), rafind2(1), rabin2(1), radiff2(1), rasm2(1), rax2(1), ravc2(1), ragg2(1), rarun2(1)

πŸ‘‘ AUTHORS πŸ‘‘

pancake <pancake@nopcode.org> β€” the icon. πŸ’…


source/version: RADARE2(1) β€’ dated: May 20, 2025 β€’ mwah πŸ’‹

πŸ“¦ where this page comes from