Skip to content

Commit

Permalink
Add environment variables documentation to manpages and -hh (#4560)
Browse files Browse the repository at this point in the history
  • Loading branch information
satk0 authored Jul 10, 2024
1 parent cbd086a commit e3d27c9
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 42 deletions.
38 changes: 38 additions & 0 deletions binrz/man/rizin.1
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,44 @@ Same as -e bin.usextr=false, do not use extract plugins, useful for dyldcache
.It Fl z, zz
do not load strings or load them even in raw
.El
.Sh ENVIRONMENT
.Pp
ANSICON: ansicon's W & H of the buffer and w & h of the window in the form of: "WxH (wxh)"
.Pp
DEBUGINFOD_URLS: e bin.dbginfo.debuginfod_urls - use alternative debuginfod server
.Pp
COLUMNS: terminal columns to use
.Pp
RZ_ABORTLEVEL: target log level/severity when to abort (0:DEBUG, 1:VERBOSE, 2:INFO, 3:WARN, 4:ERROR, 5:FATAL)
.Pp
RZ_CURL: whether to use curl (for SSL support)
.Pp
RZ_DEBUG_ASSERT: set a breakpoint when hitting an assert
.Pp
RZ_DEBUG_TOOL debug tool to use when showing error messages and crash signal
.Pp
RZ_DYLDCACHE_FILTER: dyld cache filter (MacOS dynamic libraries location(s) at runtime)
.Pp
RZ_HTTP_AUTHFILE: HTTP Authentification user file
.Pp
RZ_LOGCOLORS: should the log output use colors (TODO)
.Pp
RZ_LOGFILE: logging output filename/path
.Pp
RZ_LOGLEVEL: target log level/severity (0:DEBUG, 1:VERBOSE, 2:INFO, 3:WARN, 4:ERROR, 5:FATAL)
.Pp
RZ_LOGSHOWSOURCES: should the log output contain src info (filename:lineno)
.Pp
RZ_PIPE_IN: rzpipe cmd input (file descriptor)
.Pp
RZ_PIPE_OUT: rzpipe cmd output (file descriptor)
.Pp
RZ_PREFIX: default prefix rizin was compiled for
.Pp
RZ_RCFILE: user config file
.Pp
SFLIBPATH: SFLib syscall library path

.Sh EXAMPLE
.Pp
Start rizin in analysis mode (-A) on the /bin/ls executable:
Expand Down
15 changes: 15 additions & 0 deletions binrz/man/rz-asm.1
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,21 @@ Mark the start of the text section
.It Ic .thumb
Set the Thumb mode (as opposed to ARM) for ARM architecture
.El
.Sh ENVIRONMENT
.Pp
RZ_ARCH: e asm.arch - architecture to assemble/disassemble (same as rz-asm -a)
.Pp
RZ_ASM_ARCH: architecture to assemble/disassemble (same as rz-asm -a)
.Pp
RZ_ASM_BITS: cpu register size (8, 16, 32, 64) (same as rz-asm -b)
.Pp
RZ_BITS: e asm.bits - cpu register size (8, 16, 32, 64) (same as rz-asm -b)
.Pp
RZ_DEBUG: if defined, show error messages and crash signal\n"
.Pp
RZ_NOPLUGINS: do not load shared plugins (speedup loading)\n"


.Sh EXAMPLES
.Pp
Assemble opcode:
Expand Down
26 changes: 14 additions & 12 deletions binrz/man/rz-bin.1
Original file line number Diff line number Diff line change
Expand Up @@ -144,29 +144,31 @@ Guess size of binary program
.El
.Sh ENVIRONMENT
.Pp
RZ_NOPLUGINS: do not load shared plugins (speedup loading)
RZ_BIN_CODESIGN_VERBOSE: make code signatures verbose
.Pp
RZ_BIN_LANG: e bin.lang - assume lang for demangling
RZ_BIN_DEBASE64: e bin.debase64 - try to debase64 all strings
.Pp
RZ_BIN_DEMANGLE: e bin.demangle - do not demangle symbols
RZ_BIN_DEBUGINFOD_URLS: e bin.dbginfo.debuginfod_urls - use alternative debuginfod server
.Pp
RZ_BIN_MAXSTRBUF: e bin.maxstrbuf - specify maximum buffer size
RZ_BIN_DEMANGLE: e bin.demangle - do not demangle symbols
.Pp
RZ_BIN_STRFILTER: e bin.str.filter - rizin -qc 'e bin.str.filter=??' -
RZ_BIN_LANG: e bin.lang - assume lang for demangling
.Pp
RZ_BIN_STRPURGE: e bin.str.purge - try to purge false positives
RZ_BIN_MAXSTRBUF: e bin.maxstrbuf - specify maximum buffer size
.Pp
RZ_BIN_DEBASE64: e bin.debase64 - try to debase64 all strings
RZ_BIN_PDBSERVER: e pdb.server - use alternative PDB server
.Pp
RZ_BIN_DEBUGINFOD_URLS: e bin.dbginfo.debuginfod_urls # use alternative debuginfod server
RZ_BIN_PREFIX: e bin.prefix - prefix symbols/sections/relocs with a specific string
.Pp
RZ_BIN_PDBSERVER: e pdb.server - use alternative PDB server
RZ_BIN_STRFILTER: e bin.str.filter - rizin -qc 'e bin.str.filter=??' -
.Pp
RZ_BIN_SYMSTORE: e pdb.symstore - path to downstream symbol store
RZ_BIN_STRPURGE: e bin.str.purge - try to purge false positives
.Pp
RZ_BIN_PREFIX: e bin.prefix - prefix symbols/sections/relocs with a specific string
RZ_BIN_SYMSTORE: e pdb.symstore - path to downstream symbol store
.Pp
RZ_CONFIG: sdb config file
RZ_CONFIG: sdb config file
.Pp
RZ_NOPLUGINS: do not load shared plugins (speedup loading)

.Sh EXAMPLES
.Pp
Expand Down
4 changes: 4 additions & 0 deletions binrz/man/rz-test.1
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ Number of expected failed tests
.Pp
Supported test types: @JSON @unit @fuzz @cmds
.El
.Sh ENVIRONMENT
.Pp
EDITOR: editor to use (eg: "vim")

.Sh USAGE
.Pp
Use the -n flag to dont run any test. Just load them.
Expand Down
35 changes: 25 additions & 10 deletions librz/main/rizin.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,33 @@ static int main_help(int line) {
" user %s %s (and %s)\n"
" file ${filename}.rz\n"
"Plugins:\n"
" binrc %s (elf, elf64, mach0, ..)\n"
" RZ_USER_PLUGINS %s\n"
" RZ_LIB_PLUGINS %s\n"
" binrc %s (elf, elf64, mach0, ..)\n"
" RZ_USER_PLUGINS %s\n"
" RZ_LIB_PLUGINS %s\n"
" RZ_EXTRA_PLUGINS %s\n"
"Environment:\n"
" RZ_DEBUG if defined, show error messages and crash signal\n"
" RZ_DEBUG_ASSERT=1 set a breakpoint when hitting an assert\n"
" RZ_MAGICPATH %s\n"
" RZ_NOPLUGINS do not load rizin shared plugins\n"
" RZ_RCFILE %s (user preferences, batch script)\n"
" RZ_DATAHOME %s\n"
" RZ_VERSION contains the current version of rizin\n"
" ANSICON ansicon's W & H of the buffer and w & h of the window in the form of: \"WxH (wxh)\"\n"
" DEBUGINFOD_URLS e bin.dbginfo.debuginfod_urls - use alternative debuginfod server\n"
" COLUMNS terminal columns to use\n"
" RZ_ABORTLEVEL target log level/severity when to abort (0:DEBUG, 1:VERBOSE, 2:INFO, 3:WARN, 4:ERROR, 5:FATAL)\n"
" RZ_CURL whether to use curl (for SSL support)\n"
" RZ_DEBUG if defined, show error messages and crash signal\n"
" RZ_DEBUG_ASSERT set a breakpoint when hitting an assert\n"
" RZ_DEBUG_TOOL debug tool to use when showing error messages and crash signal\n"
" RZ_DYLDCACHE_FILTER dyld cache filter (MacOS dynamic libraries location(s) at runtime)\n"
" RZ_HTTP_AUTHFILE HTTP Authentification user file\n"
" RZ_LOGCOLORS should the log output use colors\n"
" RZ_LOGFILE logging output filename/path\n"
" RZ_LOGLEVEL target log level/severity (0:DEBUG, 1:VERBOSE, 2:INFO, 3:WARN, 4:ERROR, 5:FATAL)\n"
" RZ_LOGSHOWSOURCES should the log output contain src info (filename:lineno)\n"
" RZ_PIPE_IN rzpipe cmd input (file descriptor)\n"
" RZ_PIPE_OUT rzpipe cmd output (file descriptor)\n"
" RZ_MAGICPATH %s\n"
" RZ_NOPLUGINS do not load rizin shared plugins\n"
" RZ_RCFILE %s (user preferences, batch script)\n"
" RZ_DATAHOME %s\n"
" RZ_VERSION contains the current version of rizin\n"
" SFLIBPATH SFLib syscall library path\n"
"Paths:\n"
" RZ_PREFIX %s\n"
" RZ_EXTRA_PREFIX %s\n"
Expand Down
18 changes: 10 additions & 8 deletions librz/main/rz-asm.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,12 @@ static int rasm_show_help(int v) {
printf(" If '-l' value is greater than output length, output is padded with nops\n"
" If the last argument is '-' reads from stdin\n"
"Environment:\n"
" RZ_NOPLUGINS do not load shared plugins (speedup loading)\n"
" RZ_ASM_ARCH same as rz-asm -a\n"
" RZ_ASM_BITS same as rz-asm -b\n"
" RZ_DEBUG if defined, show error messages and crash signal\n"
" RZ_ARCH e asm.arch # architecture to assemble/disassemble (same as rz-asm -a)\n"
" RZ_ASM_ARCH # architecture to assemble/disassemble (same as rz-asm -a)\n"
" RZ_ASM_BITS # cpu register size (8, 16, 32, 64) (same as rz-asm -b)\n"
" RZ_BITS e asm.bits # cpu register size (8, 16, 32, 64) (same as rz-asm -b)\n"
" RZ_DEBUG # if defined, show error messages and crash signal\n"
" RZ_NOPLUGINS # do not load shared plugins (speedup loading)\n"
"");
if (v == 2) {
printf("Supported Assembler directives:\n");
Expand Down Expand Up @@ -580,10 +582,10 @@ RZ_API int rz_main_rz_asm(int argc, const char *argv[]) {
arch = rz_arch;
}

char *r2bits = rz_sys_getenv("RZ_BITS");
if (r2bits) {
bits = rz_num_math(NULL, r2bits);
free(r2bits);
char *rz_bits = rz_sys_getenv("RZ_BITS");
if (rz_bits) {
bits = rz_num_math(NULL, rz_bits);
free(rz_bits);
}

RzGetopt opt;
Expand Down
25 changes: 13 additions & 12 deletions librz/main/rz-bin.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,19 +235,20 @@ static int rzbin_show_help(int v) {
}
if (v) {
printf("Environment:\n"
" RZ_NOPLUGINS: # do not load shared plugins (speedup loading)\n"
" RZ_BIN_LANG: e bin.lang # assume lang for demangling\n"
" RZ_BIN_DEMANGLE=0:e bin.demangle # do not demangle symbols\n"
" RZ_BIN_MAXSTRBUF: e str.search.buffer_size # specify maximum buffer size\n"
" RZ_BIN_STRFILTER: e bin.str.filter # rizin -qc 'e bin.str.filter=?"
" RZ_BIN_CODESIGN_VERBOSE: # make code signatures verbose\n"
" RZ_BIN_DEBASE64: e bin.debase64 # try to debase64 all strings\n"
" RZ_BIN_DEBUGINFOD_URLS: e bin.dbginfo.debuginfod_urls # use alternative debuginfod server\n"
" RZ_BIN_DEMANGLE=0: e bin.demangle # do not demangle symbols\n"
" RZ_BIN_LANG: e bin.lang # assume lang for demangling\n"
" RZ_BIN_MAXSTRBUF: e str.search.buffer_size # specify maximum buffer size\n"
" RZ_BIN_PDBSERVER: e pdb.server # use alternative PDB server\n"
" RZ_BIN_PREFIX: e bin.prefix # prefix symbols/sections/relocs with a specific string\n"
" RZ_BIN_STRFILTER: e bin.str.filter # rizin -qc 'e bin.str.filter=?"
"?' -\n"
" RZ_BIN_STRPURGE: e bin.str.purge # try to purge false positives\n"
" RZ_BIN_DEBASE64: e bin.debase64 # try to debase64 all strings\n"
" RZ_BIN_PDBSERVER: e pdb.server # use alternative PDB server\n"
" RZ_BIN_SYMSTORE: e pdb.symstore # path to downstream symbol store\n"
" RZ_BIN_PREFIX: e bin.prefix # prefix symbols/sections/relocs with a specific string\n"
" RZ_BIN_DEBUGINFOD_URLS: e bin.dbginfo.debuginfod_urls # use alternative debuginfod server\n"
" RZ_CONFIG: # sdb config file\n");
" RZ_BIN_STRPURGE: e bin.str.purge # try to purge false positives\n"
" RZ_BIN_SYMSTORE: e pdb.symstore # path to downstream PDB symbol store\n"
" RZ_CONFIG: # config file\n"
" RZ_NOPLUGINS: # do not load plugins\n");
}
return 1;
}
Expand Down

0 comments on commit e3d27c9

Please sign in to comment.