Skip to content

Commit

Permalink
Add Environment Variables documentation to the book (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
satk0 authored Dec 4, 2024
1 parent 1a9b7b7 commit 2aef43b
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 22 deletions.
3 changes: 2 additions & 1 deletion _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ book:
- src/configuration/colors.md
- src/configuration/evars.md
- src/configuration/initial_scripts.md
- src/configuration/build_variables.md
- src/configuration/compile_time_variables.md
- src/configuration/run_time_variables.md

- part: "Basic Commands"
chapters:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Build Variables
## Compile-Time Variables

When rizin is built from sources, some build variables will be hardcoded within the rizin libraries.
When rizin is built from sources, some compile-time variables will be hardcoded within the rizin libraries.

These build variables can be accessed by executing the command `rizin -H` on a terminal.
These compile-time variables can be accessed by executing the command `rizin -H` on a terminal.

```bash
$ rizin -H
Expand All @@ -24,7 +24,7 @@ RZ_USER_PLUGINS=/home/username/.local/lib/rizin/plugins
RZ_IS_PORTABLE=0
```

You can also view a specific build variable by executing `-H variable`.
You can also view a specific compile-time variable by executing `-H variable`.

For example:
```bash
Expand Down
46 changes: 46 additions & 0 deletions src/configuration/run_time_variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## Run-Time Variables

Run-time variables (also known as environment variables) can be used to change the default behavior when running rizin or tools.

The description of these run-time variables can be accessed by executing the command `rizin -hh` on a terminal.

```bash
$ rizin -hh
...
Plugins:
binrc /home/username/.local/share/rizin/rc.d/bin-<format> (elf, elf64, mach0, ..)
RZ_USER_PLUGINS /home/username/.local/lib/rizin/plugins
RZ_LIB_PLUGINS /home/username/.local/lib/rizin/plugins
RZ_EXTRA_PLUGINS
Environment:
ANSICON ansicon's W & H of the buffer and w & h of the window in the form of: "WxH (wxh)"
DEBUGINFOD_URLS e bin.dbginfo.debuginfod_urls - use alternative debuginfod server
COLUMNS terminal columns to use
RZ_ABORTLEVEL target log level/severity when to abort (0:DEBUG, 1:VERBOSE, 2:INFO, 3:WARN, 4:ERROR, 5:FATAL)
RZ_CURL whether to use curl (for SSL support)
RZ_DEBUG if defined, show error messages and crash signal
RZ_DEBUG_ASSERT set a breakpoint when hitting an assert
RZ_DEBUG_TOOL debug tool to use when showing error messages and crash signal
RZ_DYLDCACHE_FILTER dyld cache filter (MacOS dynamic libraries location(s) at runtime)
RZ_HTTP_AUTHFILE HTTP Authentification user file
RZ_LOGCOLORS should the log output use colors
RZ_LOGFILE logging output filename/path
RZ_LOGLEVEL target log level/severity (0:DEBUG, 1:VERBOSE, 2:INFO, 3:WARN, 4:ERROR, 5:FATAL)
RZ_LOGSHOWSOURCES should the log output contain src info (filename:lineno)
RZ_PIPE_IN rzpipe cmd input (file descriptor)
RZ_PIPE_OUT rzpipe cmd output (file descriptor)
RZ_MAGICPATH /home/username/.local/share/rizin/magic
RZ_NOPLUGINS do not load rizin shared plugins
RZ_RCFILE /home/username/.rizinrc (user preferences, batch script)
RZ_DATAHOME /home/username/.local/share/rizin
RZ_VERSION contains the current version of rizin
SFLIBPATH SFLib syscall library path
Paths:
RZ_PREFIX /home/username/.local
RZ_EXTRA_PREFIX
RZ_INCDIR /home/username/.local/include/librz
RZ_LIBDIR /home/username/.local/lib
RZ_SIGDB /home/username/.local/share/rizin/sigdb
RZ_EXTRA_SIGDB
RZ_LIBEXT so
```
11 changes: 6 additions & 5 deletions src/tools/rz-asm/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
instruction opcode.

```
$ rz-asm -h
Usage: rz-asm [-ACdDehLBvw] [-a arch] [-b bits] [-o addr] [-s syntax]
[-f file] [-F fil:ter] [-i skip] [-l len] 'code'|hex|-
-a [arch] Set architecture to assemble/disassemble (see -L)
Expand Down Expand Up @@ -37,10 +36,12 @@ Usage: rz-asm [-ACdDehLBvw] [-a arch] [-b bits] [-o addr] [-s syntax]
If '-l' value is greater than output length, output is padded with nops
If the last argument is '-' reads from stdin
Environment:
RZ_NOPLUGINS do not load shared plugins (speedup loading)
RZ_ASM_ARCH same as rz-asm -a
RZ_ASM_BITS same as rz-asm -b
RZ_DEBUG if defined, show error messages and crash signal
RZ_ARCH e asm.arch # architecture to assemble/disassemble (same as rz-asm -a)
RZ_ASM_ARCH # architecture to assemble/disassemble (same as rz-asm -a)
RZ_ASM_BITS # cpu register size (8, 16, 32, 64) (same as rz-asm -b)
RZ_BITS e asm.bits # cpu register size (8, 16, 32, 64) (same as rz-asm -b)
RZ_DEBUG # if defined, show error messages and crash signal
RZ_NOPLUGINS # do not load shared plugins (speedup loading)
```

Plugins for supported target architectures can be listed with the `-L` option. Knowing a plugin name,
Expand Down
25 changes: 13 additions & 12 deletions src/tools/rz-bin/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,17 @@ Usage: rz-bin [-AcdeEghHiIjlLMqrRsSUvVxzZ] [-@ at] [-a arch] [-b bits] [-B addr]
-zzz Dump raw strings to stdout (for huge files)
-Z Guess size of binary program
Environment:
RZ_NOPLUGINS: # do not load shared plugins (speedup loading)
RZ_BIN_LANG: e bin.lang # assume lang for demangling
RZ_BIN_DEMANGLE=0:e bin.demangle # do not demangle symbols
RZ_BIN_MAXSTRBUF: e str.search.buffer_size # specify maximum buffer size
RZ_BIN_STRFILTER: e bin.str.filter # rizin -qc 'e bin.str.filter=??' -
RZ_BIN_STRPURGE: e bin.str.purge # try to purge false positives
RZ_BIN_DEBASE64: e bin.debase64 # try to debase64 all strings
RZ_BIN_PDBSERVER: e pdb.server # use alternative PDB server
RZ_BIN_SYMSTORE: e pdb.symstore # path to downstream symbol store
RZ_BIN_PREFIX: e bin.prefix # prefix symbols/sections/relocs with a specific string
RZ_BIN_DEBUGINFOD_URLS: e bin.dbginfo.debuginfod_urls # use alternative debuginfod server
RZ_CONFIG:
RZ_BIN_CODESIGN_VERBOSE: # make code signatures verbose
RZ_BIN_DEBASE64: e bin.debase64 # try to debase64 all strings
RZ_BIN_DEBUGINFOD_URLS: e bin.dbginfo.debuginfod_urls # use alternative debuginfod server
RZ_BIN_DEMANGLE=0: e bin.demangle # do not demangle symbols
RZ_BIN_LANG: e bin.lang # assume lang for demangling
RZ_BIN_MAXSTRBUF: e str.search.buffer_size # specify maximum buffer size
RZ_BIN_PDBSERVER: e pdb.server # use alternative PDB server
RZ_BIN_PREFIX: e bin.prefix # prefix symbols/sections/relocs with a specific string
RZ_BIN_STRFILTER: e bin.str.filter # rizin -qc 'e bin.str.filter=??' -
RZ_BIN_STRPURGE: e bin.str.purge # try to purge false positives
RZ_BIN_SYMSTORE: e pdb.symstore # path to downstream PDB symbol store
RZ_CONFIG: # config file
RZ_NOPLUGINS: # do not load plugins
```

0 comments on commit 2aef43b

Please sign in to comment.