id = "radare2" name = "radare2" homepage = "https://radare.org/" description = "A reverse-engineering framework and command-line toolset." # The Homebrew formula's test invokes the installed command as `r2`: # https://raw.githubusercontent.com/Homebrew/homebrew-core/HEAD/Formula/r/radare2.rb executables = ["r2"] [dotfiles] # https://github.com/radareorg/radare2/blob/master/doc/intro.md — radare2 # reads the user's ~/.radare2rc; https://book.rada.re/config/files.html also # documents the XDG form $XDG_CONFIG_HOME/radare2/rc. paths = [ "~/.radare2rc", "[configHome]/radare2/rc", ] secret = [] side_effect = false [commands] format = 1 label = "Open a file in radare2" description = "Open a binary or file in radare2, optionally analysing it, running commands first, or quitting right after. Debugger, project and plugin-listing options are left out." quality = "ai-draft" parser = { end_of_options = "--", interleave = "permute", long_equals = false, short_attached = false, short_bundles = false } [[commands.source]] id = "man" kind = "manual" url = "https://manpages.debian.org/unstable/radare2/radare2.1.en.html" revision = "6.1.8+ds-1" evidence = ''' -A run 'aaa' command before prompt or patch to analyze all referenced code. -a arch force asm.arch (x86, ppc, arm, mips, bf, java, ...) -b bits force asm.bits (16, 32, 64) -B baddr Specify the base address to be used when loading a new binary. -c cmd Execute the given command before giving prompt -e k=v Set configuration eval variable key=value. For example -e scr.color=false. -i file Run script, lang program or radare2 plugin file. After the file is loaded -n Do not perform any analysis (r_bin). Just load the raw file -q Quiet mode (no prompt) and quit after running the commands specified with -i or -c -s addr Start seeking at this address -w Open in write mode -d Start in debugger mode ''' [[commands.field]] id = "file" label = "File" type = "path" path = { kind = "file", role = "input" } position = 0 sources = ["man"] [[commands.field]] id = "analyze" label = "Analyze all code (aaa)" type = "boolean" option = ["-A"] sources = ["man"] [[commands.field]] id = "arch" label = "Architecture" description = "Forces asm.arch." type = "string" option = ["-a"] suggestions = [{ value = "x86", label = "x86" }, { value = "arm", label = "ARM" }, { value = "mips", label = "MIPS" }, { value = "ppc", label = "PowerPC" }] sources = ["man"] [[commands.field]] id = "bits" label = "Bits" type = "enum" option = ["-b"] choices = [{ value = "16", label = "16" }, { value = "32", label = "32" }, { value = "64", label = "64" }] sources = ["man"] [[commands.field]] id = "baddr" label = "Base address" type = "string" option = ["-B"] sources = ["man"] [[commands.field]] id = "run_cmd" label = "Command to run first" type = "string" option = ["-c"] multiple = true sources = ["man"] [[commands.field]] id = "eval" label = "Config variable (key=value)" type = "string" option = ["-e"] multiple = true sources = ["man"] [[commands.field]] id = "script" label = "Script to run after load" type = "path" path = { kind = "file", role = "input" } option = ["-i"] sources = ["man"] [[commands.field]] id = "seek" label = "Start address" type = "string" option = ["-s"] sources = ["man"] [[commands.field]] id = "no_analysis" label = "Load raw file without analysis" type = "boolean" option = ["-n"] sources = ["man"] [[commands.field]] id = "quiet" label = "Quiet, quit after commands" type = "boolean" option = ["-q"] sources = ["man"] [[commands.field]] id = "write" label = "Open in write mode" description = "Edits made in the session are written to the file." type = "boolean" option = ["-w"] effect = "overwrite" sources = ["man"] [[commands.task]] id = "analyze" label = "Open and analyze" fields = ["file", "analyze"] required = ["file"] set = { analyze = [true] } [[commands.task]] id = "batch" label = "Run a command and quit" fields = ["file", "run_cmd", "quiet"] required = ["file", "run_cmd"] set = { quiet = [true] } [[commands.group]] id = "basic" label = "Basic" fields = ["file", "analyze", "run_cmd", "quiet", "write"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["arch", "bits", "baddr", "eval", "script", "seek", "no_analysis"]