Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add environment variables documentation to manpages and -hh #4560

Merged
merged 12 commits into from
Jul 10, 2024
Merged
60 changes: 60 additions & 0 deletions binrz/man/rizin.1
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,66 @@ 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
_NT_DEBUGGER_EXTENSION_PATH: path(s) to debugger extension DLLs
.Pp
ALACRITTY_LOG: alacritty log file's path
XVilka marked this conversation as resolved.
Show resolved Hide resolved
.Pp
ANSICON: ansicon's W & H of the buffer and w & h of the window in the form of: "WxH (wxh)"
.Pp
CC: compiler's name or path
.Pp
DEBUGINFOD_URLS: e bin.dbginfo.debuginfod_urls - use alternative debuginfod server
.Pp
COLORTERM: extra color capabilities for a terminal
.Pp
COLUMNS: terminal columns to use
.Pp
LD_LIBRARY_PATH: path(s) to search for shared libraries at run time
.Pp
LIBRARY_PATH: path(s) to search for static and shared libraries at compile time
.Pp
PATH: path(s) with executables
.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
.Pp
SHELL: shell to use (eg: "sh")
.Pp
TEMP: Temp directory path (Windows)
.Pp
TMPDIR: tmp directory path (eg: /tmp)
.Pp
WT_SESSION: check if in Windows terminal
.Pp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably these, ALACRITTY_LOG and PATH should not be in the documentation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TERM: terminal's type and color

.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
46 changes: 36 additions & 10 deletions librz/main/rizin.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,44 @@ 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"
" _NT_DEBUGGER_EXTENSION_PATH path(s) to debugger extension DLLs\n"
XVilka marked this conversation as resolved.
Show resolved Hide resolved
" ALACRITTY_LOG alacritty log file's path\n"
" ANSICON ansicon's W & H of the buffer and w & h of the window in the form of: \"WxH (wxh)\"\n"
" CC compiler's name or path\n"
" DEBUGINFOD_URLS e bin.dbginfo.debuginfod_urls - use alternative debuginfod server\n"
" COLORTERM extra color capabilities for a terminal\n"
" COLUMNS terminal columns to use\n"
" LD_LIBRARY_PATH path(s) to search for shared libraries at run time\n"
" LIBRARY_PATH path(s) to search for static and shared libraries at compile time\n"
" PATH path(s) with executables\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=1 set a breakpoint when hitting an assert\n"
" RZ_DEBUG_TOOL=gdb 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 (TODO)\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe remove since it's not implemented

Copy link
Member

@wargio wargio Jul 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

" 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"
" SHELL=sh shell to use (eg: \"sh\")\n"
XVilka marked this conversation as resolved.
Show resolved Hide resolved
" TEMP=C:\\WINDOWS\\Temp\\ Temp directory path (Windows)\n"
XVilka marked this conversation as resolved.
Show resolved Hide resolved
" TMPDIR=/tmp tmp directory path (eg: /tmp)\n"
Copy link
Member

@wargio wargio Jul 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
" TMPDIR=/tmp tmp directory path (eg: /tmp)\n"
" TMPDIR tmp directory path (eg: /tmp)\n"

" WT_SESSION check if in Windows terminal\n"
" TERM terminal's type and color\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"
XVilka marked this conversation as resolved.
Show resolved Hide resolved
" 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"
XVilka marked this conversation as resolved.
Show resolved Hide resolved
" 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"
XVilka marked this conversation as resolved.
Show resolved Hide resolved
" 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 symbol store\n"
XVilka marked this conversation as resolved.
Show resolved Hide resolved
" RZ_CONFIG: # sdb config file\n"
XVilka marked this conversation as resolved.
Show resolved Hide resolved
" RZ_NOPLUGINS: # do not load shared plugins (speedup loading)\n");
XVilka marked this conversation as resolved.
Show resolved Hide resolved
}
return 1;
}
Expand Down
Loading