Colorify rz-ax -h (#5413)
* Colorify `rz-ax -h` * Hardcode `rz-find` binary name
This commit is contained in:
parent
5cbab45fd8
commit
a60c32b46e
5 changed files with 538 additions and 191 deletions
|
|
@ -234,7 +234,10 @@ RZ_API RZ_OWN char *rz_print_json_indent(RZ_NULLABLE const char *s, bool color,
|
|||
RZ_API char *rz_print_json_human(const char *s);
|
||||
|
||||
RZ_API RZ_OWN RzStrBuf *rz_print_colorize_asm_str(RZ_BORROW RzPrint *p, const RzAsmTokenString *toks);
|
||||
RZ_API void rz_print_colored_help_option(const char *option, const char *arg, const char *description, size_t maxOptionAndArgLength);
|
||||
RZ_API void rz_print_colored_help_option(const char *flag, const char *arg, const char *desc,
|
||||
size_t maxFlagAndArgLength);
|
||||
RZ_API void rz_print_colored_help_option_example(RZ_NULLABLE const char *flag, RZ_NULLABLE const char *arg,
|
||||
const char *desc, size_t maxFlagAndArgLength, RZ_NULLABLE const char *example, size_t maxDescLength);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -188,57 +188,86 @@ static void print_ascii_table(void) {
|
|||
}
|
||||
|
||||
static int help(void) {
|
||||
printf(
|
||||
"Usage: rz-ax [options] [expr ...]\n"
|
||||
"If expr is not provided, reads from stdin\n"
|
||||
" int -> hex ; rz-ax 10\n"
|
||||
" hex -> int ; rz-ax 0xa\n"
|
||||
" -int -> hex ; rz-ax -77\n"
|
||||
" -hex -> int ; rz-ax 0xffffffb3\n"
|
||||
" int -> bin ; rz-ax b30\n"
|
||||
" int -> ternary ; rz-ax t42\n"
|
||||
" bin -> int ; rz-ax 1010d\n"
|
||||
" ternary -> int ; rz-ax 1010dt\n"
|
||||
" float -> hex ; rz-ax 3.33f\n"
|
||||
" hex -> float ; rz-ax Fx40551ed8\n"
|
||||
" oct -> hex ; rz-ax 35o\n"
|
||||
" hex -> oct ; rz-ax Ox12 (O is a letter)\n"
|
||||
" bin -> hex ; rz-ax 1100011b\n"
|
||||
" hex -> bin ; rz-ax Bx63\n"
|
||||
" ternary -> hex ; rz-ax 212t\n"
|
||||
" hex -> ternary ; rz-ax Tx23\n"
|
||||
" raw -> hex ; rz-ax -S < /binfile\n"
|
||||
" hex -> raw ; rz-ax -s 414141\n"
|
||||
" =base ; rz-ax =10 0x46 -> output in base 10\n"
|
||||
" -l ; append newline to output (for -E/-D/-r/..\n"
|
||||
" -a show ascii table ; rz-ax -a\n"
|
||||
" -b bin -> str ; rz-ax -b 01000101 01110110\n"
|
||||
" -B str -> bin ; rz-ax -B hello\n"
|
||||
" -d force integer ; rz-ax -d 3 -> 3 instead of 0x3\n"
|
||||
" -e swap endianness ; rz-ax -e 0x33\n"
|
||||
" -D base64 decode ;\n"
|
||||
" -E base64 encode ;\n"
|
||||
" -f floating point ; rz-ax -f 6.3+2.1\n"
|
||||
" -F stdin slurp code hex ; rz-ax -F < shellcode.[c/py/js]\n"
|
||||
" -h show this help ; rz-ax -h\n"
|
||||
" -i dump as C byte array ; rz-ax -i < bytes\n"
|
||||
" -I IP address <-> LONG ; rz-ax -I 3530468537\n"
|
||||
" -k keep base ; rz-ax -k 33+3 -> 36\n"
|
||||
" -L bin -> hex(bignum) ; rz-ax -L 111111111 # 0x1ff\n"
|
||||
" -n int value -> hexpairs; rz-ax -n 0x1234 # 34120000\n"
|
||||
" -o octalstr -> raw ; rz-ax -o \\162 \\172 # rz\n"
|
||||
" -N binary number ; rz-ax -N 0x1234 # \\x34\\x12\\x00\\x00\n"
|
||||
" -r rz style output ; rz-ax -r 0x1234\n"
|
||||
" -s hexstr -> raw ; rz-ax -s 43 4a 50\n"
|
||||
" -S raw -> hexstr ; rz-ax -S < /bin/ls > ls.hex\n"
|
||||
" -t Unix tstamp -> str ; rz-ax -t 1234567890\n"
|
||||
" -m MS-DOS tstamp -> str ; rz-ax -m 1234567890\n"
|
||||
" -W Win32 tstamp -> str ; rz-ax -W 1234567890\n"
|
||||
" -x hash string ; rz-ax -x linux osx\n"
|
||||
" -u units ; rz-ax -u 389289238 # 317.0M\n"
|
||||
" -w signed word ; rz-ax -w 16 0xffff\n"
|
||||
" -v version ; rz-ax -v\n"
|
||||
" -p position of set bits ; rz-ax -p 0xb3\n");
|
||||
printf(Color_CYAN "Usage:" Color_RESET " rz-ax [options] [expr ...]\n"
|
||||
"If expr is not provided, reads from stdin\n");
|
||||
#define CF Color_GREEN
|
||||
#define CA Color_YELLOW
|
||||
#define CR Color_RESET
|
||||
const char *options[] = {
|
||||
// clang-format off
|
||||
NULL, NULL, "int -> hex", "rz-ax 10",
|
||||
NULL, NULL, "hex -> int", "rz-ax 0xa",
|
||||
NULL, NULL, "-int -> hex", "rz-ax -77",
|
||||
NULL, NULL, "-hex -> int", "rz-ax 0xffffffb3",
|
||||
NULL, NULL, "int -> bin", "rz-ax b30",
|
||||
NULL, NULL, "int -> ternary", "rz-ax t42",
|
||||
NULL, NULL, "bin -> int", "rz-ax 1010d",
|
||||
NULL, NULL, "ternary -> int", "rz-ax 1010dt",
|
||||
NULL, NULL, "float -> hex", "rz-ax 3.33f",
|
||||
NULL, NULL, "hex -> float", "rz-ax Fx40551ed8",
|
||||
NULL, NULL, "oct -> hex", "rz-ax 35o",
|
||||
NULL, NULL, "hex -> oct", "rz-ax Ox12 (O is a letter)",
|
||||
NULL, NULL, "bin -> hex", "rz-ax 1100011b",
|
||||
NULL, NULL, "hex -> bin", "rz-ax Bx63",
|
||||
NULL, NULL, "ternary -> hex", "rz-ax 212t",
|
||||
NULL, NULL, "hex -> ternary", "rz-ax Tx23",
|
||||
NULL, NULL, "raw -> hex", "rz-ax " CF "-S" CR " < /binfile",
|
||||
NULL, NULL, "hex -> raw", "rz-ax " CF "-s" CR " 414141",
|
||||
"=", "\bbase", "", "rz-ax " CF "=" CA "10" CR " 0x46 -> output in base 10",
|
||||
"-l", "", "", "append newline to output (for " CF "-E" CR "/" CF "-D" CR "/" CF "-r" CR "/..",
|
||||
"-a", "", "show ascii table", "rz-ax " CF "-a" CR "",
|
||||
"-b", "", "bin -> str", "rz-ax " CF "-b" CR " 01000101 01110110",
|
||||
"-B", "", "str -> bin", "rz-ax " CF "-B" CR " hello",
|
||||
"-d", "", "force integer", "rz-ax " CF "-d" CR " 3 -> 3 instead of 0x3",
|
||||
"-e", "", "swap endianness", "rz-ax " CF "-e" CR " 0x33",
|
||||
"-D", "", "base64 decode", NULL,
|
||||
"-E", "", "base64 encode", NULL,
|
||||
"-f", "", "floating point", "rz-ax " CF "-f" CR " 6.3+2.1",
|
||||
"-F", "", "stdin slurp code hex", "rz-ax " CF "-F" CR " < shellcode.[c/py/js]",
|
||||
"-h", "", "show this help", "rz-ax " CF "-h" CR "",
|
||||
"-i", "", "dump as C byte array", "rz-ax " CF "-i" CR " < bytes",
|
||||
"-I", "", "IP address <-> LONG", "rz-ax " CF "-I" CR " 3530468537",
|
||||
"-k", "", "keep base", "rz-ax " CF "-k" CR " 33+3 -> 36",
|
||||
"-L", "", "bin -> hex(bignum)", "rz-ax " CF "-L" CR " 111111111 # 0x1ff",
|
||||
"-n", "", "int value -> hexpairs", "rz-ax " CF "-n" CR " 0x1234 # 34120000",
|
||||
"-o", "", "octalstr -> raw", "rz-ax " CF "-o" CR " \\162 \\172 # rz",
|
||||
"-N", "", "binary number", "rz-ax " CF "-N" CR " 0x1234 # \\x34\\x12\\x00\\x00",
|
||||
"-r", "", "rz style output", "rz-ax " CF "-r" CR " 0x1234",
|
||||
"-s", "", "hexstr -> raw", "rz-ax " CF "-s" CR " 43 4a 50",
|
||||
"-S", "", "raw -> hexstr", "rz-ax " CF "-S" CR " < /bin/ls > ls.hex",
|
||||
"-t", "", "Unix tstamp -> str", "rz-ax " CF "-t" CR " 1234567890",
|
||||
"-m", "", "MS-DOS tstamp -> str", "rz-ax " CF "-m" CR " 1234567890",
|
||||
"-W", "", "Win32 tstamp -> str", "rz-ax " CF "-W" CR " 1234567890",
|
||||
"-x", "", "hash string", "rz-ax " CF "-x" CR " linux osx",
|
||||
"-u", "", "units", "rz-ax " CF "-u" CR " 389289238 # 317.0M",
|
||||
"-w", "", "signed word", "rz-ax " CF "-w" CR " 16 0xffff",
|
||||
"-v", "", "version", "rz-ax " CF "-v" CR "",
|
||||
"-p", "", "position of set bits", "rz-ax " CF "-p" CR " 0xb3",
|
||||
// clang-format on
|
||||
};
|
||||
#undef CF
|
||||
#undef CA
|
||||
#undef CR
|
||||
size_t maxFlagAndArgLength = 0;
|
||||
size_t maxDescLength = 0;
|
||||
for (int i = 0; i < RZ_ARRAY_SIZE(options); i += 4) {
|
||||
size_t flagLength = options[i] ? strlen(options[i]) : 0;
|
||||
size_t argLength = options[i + 1] ? strlen(options[i + 1]) : 0;
|
||||
size_t totalFlagAndArgLength = flagLength + argLength;
|
||||
if (totalFlagAndArgLength > maxFlagAndArgLength) {
|
||||
maxFlagAndArgLength = totalFlagAndArgLength;
|
||||
}
|
||||
size_t descLength = strlen(options[i + 2]);
|
||||
if (descLength > maxDescLength) {
|
||||
maxDescLength = descLength;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < RZ_ARRAY_SIZE(options); i += 4) {
|
||||
if (i + 1 < RZ_ARRAY_SIZE(options)) {
|
||||
rz_print_colored_help_option_example(options[i], options[i + 1], options[i + 2],
|
||||
maxFlagAndArgLength, options[i + 3], maxDescLength);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ static void print_bin_string(RzBinFile *bf, RzBinString *string, PJ *pj) {
|
|||
|
||||
static int show_help(const char *argv0, int line) {
|
||||
printf("%s%s%s", Color_CYAN, "Usage: ", Color_RESET);
|
||||
printf("%s [-mXnzZhqv] [-a align] [-b sz] [-f/t from/to] [-[e|s|w|S|I] str] [-x hex] -|file|dir ..\n", argv0);
|
||||
printf("rz-find [-mXnzZhqv] [-a align] [-b sz] [-f/t from/to] [-[e|s|w|S|I] str] [-x hex] -|file|dir ..\n");
|
||||
if (line) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1456,16 +1456,66 @@ RZ_API RZ_OWN RzStrBuf *rz_print_colorize_asm_str(RZ_BORROW RzPrint *p, const Rz
|
|||
return out;
|
||||
}
|
||||
|
||||
// Prints a help option with the option/arg strings colorized and aligned to a max length.
|
||||
RZ_API void rz_print_colored_help_option(const char *option, const char *arg, const char *description, size_t maxOptionAndArgLength) {
|
||||
size_t optionWidth = strlen(option);
|
||||
size_t maxSpaces = maxOptionAndArgLength + 2;
|
||||
printf(Color_GREEN " %-.*s" Color_RESET, (int)optionWidth, option);
|
||||
size_t remainingSpaces = maxSpaces - optionWidth;
|
||||
if (RZ_STR_ISNOTEMPTY(arg)) {
|
||||
printf(Color_YELLOW " %-s " Color_RESET, arg);
|
||||
remainingSpaces -= strlen(arg) + 2;
|
||||
}
|
||||
printf("%-*.*s", (int)remainingSpaces, (int)remainingSpaces, "");
|
||||
printf(Color_RESET "%s\n", description);
|
||||
/**
|
||||
* \brief Prints a help option with the option flag and arg strings colorized, and description aligned to a column.
|
||||
*
|
||||
* \param flag Option flag, will be colored green.
|
||||
* \param arg Option arg, will be colored yellow.
|
||||
* \param desc Option description, will be aligned in the third column.
|
||||
* \param maxFlagAndArgLength Width of column containing \p flag and \p arg. It needs to be calculated beforehand
|
||||
* as the max over all options.
|
||||
*/
|
||||
RZ_API void rz_print_colored_help_option(const char *flag, const char *arg, const char *desc,
|
||||
size_t maxFlagAndArgLength) {
|
||||
|
||||
rz_return_if_fail(flag && arg && desc);
|
||||
rz_print_colored_help_option_example(flag, arg, desc, maxFlagAndArgLength, NULL, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Prints a help option with example, with the option flag and arg strings colorized, and both description and
|
||||
* example aligned to columns.
|
||||
*
|
||||
* \param flag Option flag, will be colored green.
|
||||
* \param arg Option arg, will be colored yellow.
|
||||
* \param desc Option description, will be aligned in the third column unless both \p flag and \p arg are NULL. If so,
|
||||
* it will be aligned at the first column.
|
||||
* \param maxFlagAndArgLength Width of column containing \p flag and \p arg. It needs to be calculated beforehand
|
||||
* as the max over all options.
|
||||
* \param example Optional option example, will be aligned in a column after the description and prefixed with "; ".
|
||||
* \param maxDescLength Width of column containing \p desc. It needs to be calculated beforehand as the max over all
|
||||
* descriptions.
|
||||
*/
|
||||
RZ_API void rz_print_colored_help_option_example(RZ_NULLABLE const char *flag, RZ_NULLABLE const char *arg,
|
||||
const char *desc, size_t maxFlagAndArgLength, RZ_NULLABLE const char *example, size_t maxDescLength) {
|
||||
|
||||
rz_return_if_fail(desc);
|
||||
bool desc_start = !flag && !arg;
|
||||
size_t maxOptSpaces = maxFlagAndArgLength + 2;
|
||||
printf(" ");
|
||||
if (!desc_start) {
|
||||
if (!flag) {
|
||||
flag = "";
|
||||
}
|
||||
if (!arg) {
|
||||
arg = "";
|
||||
}
|
||||
printf(Color_GREEN "%s" Color_RESET, flag);
|
||||
size_t remainingSpaces = maxOptSpaces - strlen(flag);
|
||||
if (RZ_STR_ISNOTEMPTY(arg)) {
|
||||
printf(Color_YELLOW " %s " Color_RESET, arg);
|
||||
remainingSpaces -= strlen(arg) + 2;
|
||||
if (arg[0] == '\b') {
|
||||
remainingSpaces += 2;
|
||||
}
|
||||
}
|
||||
printf("%*s", (int)remainingSpaces, "");
|
||||
}
|
||||
printf(Color_RESET "%s", desc);
|
||||
if (example) {
|
||||
size_t maxDescSpaces = (desc_start ? maxOptSpaces : 0) + maxDescLength;
|
||||
size_t remainingSpaces = maxDescSpaces - strlen(desc);
|
||||
printf("%*s ; %s", (int)remainingSpaces, "", example);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
|
|
|||
517
test/db/tools/rz
517
test/db/tools/rz
|
|
@ -236,139 +236,404 @@ RUN
|
|||
NAME=<program> -h
|
||||
FILE=--
|
||||
CMDS=<<EOF
|
||||
!rizin -h
|
||||
echo
|
||||
!rz-ax -h
|
||||
echo
|
||||
!rz-hash -h
|
||||
(help prog; !${prog} -h; echo)
|
||||
..(help rizin rz-asm rz-ax rz-bin rz-diff rz-find rz-gg rz-hash rz-run rz-sign)
|
||||
!!rz-test -h~:..-1
|
||||
EOF
|
||||
EXPECT=<<EOF
|
||||
[36mUsage: [0mrizin [-ACdfLMnNqStuvwzX] [-P patch] [-p prj] [-a arch] [-b bits] [-i file]
|
||||
[-s addr] [-B baddr] [-m maddr] [-c cmd] [-e k=v] file|pid|-|--|=
|
||||
[32m --[0m [0mRun rizin without opening any file
|
||||
[32m =[0m [0mSame as 'rizin malloc://512'
|
||||
[32m - [0m [0mRead file from stdin
|
||||
[32m -=[0m [0mPerform R=! command to run all commands remotely
|
||||
[32m -0[0m [0mPrint \x00 after init and every command
|
||||
[32m -1[0m [0mRedirect stderr to stdout
|
||||
[32m -2[0m [0mClose stderr file descriptor (silent warning messages)
|
||||
[32m -a[0m[33m arch [0m [0mSet asm.arch
|
||||
[32m -A[0m [0mRun 'aaa' command to analyze all referenced code
|
||||
[32m -b[0m[33m bits [0m [0mSet asm.bits
|
||||
[32m -B[0m[33m baddr [0m [0mSet base address for PIE binaries
|
||||
[32m -c[0m[33m 'cmd..' [0m[0mExecute rizin command
|
||||
[32m -C[0m [0mFile is host:port (alias for -cR+http://%%s/cmd/)
|
||||
[32m -d[0m [0mDebug the executable 'file' or running process 'pid'
|
||||
[32m -D[0m[33m backend [0m[0mEnable debug mode (e cfg.debug=true)
|
||||
[32m -e[0m[33m k=v [0m [0mEvaluate config var
|
||||
[32m -f[0m [0mBlock size = file size
|
||||
[32m -F[0m[33m binplug [0m[0mForce to use that rbin plugin
|
||||
[32m -h, -hh[0m [0mShow help message, -hh for long
|
||||
[32m -H[0m[33m [var] [0m [0mDisplay variable
|
||||
[32m -i[0m[33m file [0m [0mRun script file
|
||||
[32m -I[0m[33m file [0m [0mRun script file before the file is opened
|
||||
[32m -k[0m[33m OS/kern [0m[0mSet asm.os (linux, macos, w32, netbsd, ...)
|
||||
[32m -l[0m[33m lib [0m [0mLoad plugin file
|
||||
[32m -L[0m [0mList supported IO plugins
|
||||
[32m -m[0m[33m addr [0m [0mMap file at given address (loadaddr)
|
||||
[32m -M[0m [0mDo not demangle symbol names
|
||||
[32m -n, -nn[0m [0mDo not load RzBin info (-nn only load bin structures)
|
||||
[32m -N[0m [0mDo not load user settings and scripts
|
||||
[32m -NN[0m [0mDo not load any script or plugin
|
||||
[32m -q[0m [0mQuiet mode (no prompt) and quit after -i and -c
|
||||
[32m -qq[0m [0mQuiet mode (no prompt) and force quit
|
||||
[32m -p[0m[33m p.rzdb [0m [0mLoad project file
|
||||
[32m -r[0m[33m rz-run [0m [0mSpecify rz-run profile to load (same as -e dbg.profile=X)
|
||||
[32m -R[0m[33m rule [0m [0mSpecify custom rz-run directive
|
||||
[32m -s[0m[33m addr [0m [0mInitial seek
|
||||
[32m -T[0m [0mDo not compute file hashes
|
||||
[32m -u[0m [0mSet bin.filter=false to get raw sym/sec/cls names
|
||||
[32m -v, -V[0m [0mShow rizin version (-V show lib versions)
|
||||
[32m -w[0m [0mOpen file in write mode
|
||||
[32m -x[0m [0mOpen without exec-flag (asm.emu will not work), See io.exec
|
||||
[32m -X[0m [0mSame as -e bin.usextr=false (useful for dyldcache)
|
||||
[32m -z, -zz[0m [0mDo not load strings or load them even in raw
|
||||
[32m--[0m [0mRun rizin without opening any file
|
||||
[32m=[0m [0mSame as 'rizin malloc://512'
|
||||
[32m- [0m [0mRead file from stdin
|
||||
[32m-=[0m [0mPerform R=! command to run all commands remotely
|
||||
[32m-0[0m [0mPrint \x00 after init and every command
|
||||
[32m-1[0m [0mRedirect stderr to stdout
|
||||
[32m-2[0m [0mClose stderr file descriptor (silent warning messages)
|
||||
[32m-a[0m[33m arch [0m [0mSet asm.arch
|
||||
[32m-A[0m [0mRun 'aaa' command to analyze all referenced code
|
||||
[32m-b[0m[33m bits [0m [0mSet asm.bits
|
||||
[32m-B[0m[33m baddr [0m [0mSet base address for PIE binaries
|
||||
[32m-c[0m[33m 'cmd..' [0m[0mExecute rizin command
|
||||
[32m-C[0m [0mFile is host:port (alias for -cR+http://%%s/cmd/)
|
||||
[32m-d[0m [0mDebug the executable 'file' or running process 'pid'
|
||||
[32m-D[0m[33m backend [0m[0mEnable debug mode (e cfg.debug=true)
|
||||
[32m-e[0m[33m k=v [0m [0mEvaluate config var
|
||||
[32m-f[0m [0mBlock size = file size
|
||||
[32m-F[0m[33m binplug [0m[0mForce to use that rbin plugin
|
||||
[32m-h, -hh[0m [0mShow help message, -hh for long
|
||||
[32m-H[0m[33m [var] [0m [0mDisplay variable
|
||||
[32m-i[0m[33m file [0m [0mRun script file
|
||||
[32m-I[0m[33m file [0m [0mRun script file before the file is opened
|
||||
[32m-k[0m[33m OS/kern [0m[0mSet asm.os (linux, macos, w32, netbsd, ...)
|
||||
[32m-l[0m[33m lib [0m [0mLoad plugin file
|
||||
[32m-L[0m [0mList supported IO plugins
|
||||
[32m-m[0m[33m addr [0m [0mMap file at given address (loadaddr)
|
||||
[32m-M[0m [0mDo not demangle symbol names
|
||||
[32m-n, -nn[0m [0mDo not load RzBin info (-nn only load bin structures)
|
||||
[32m-N[0m [0mDo not load user settings and scripts
|
||||
[32m-NN[0m [0mDo not load any script or plugin
|
||||
[32m-q[0m [0mQuiet mode (no prompt) and quit after -i and -c
|
||||
[32m-qq[0m [0mQuiet mode (no prompt) and force quit
|
||||
[32m-p[0m[33m p.rzdb [0m [0mLoad project file
|
||||
[32m-r[0m[33m rz-run [0m [0mSpecify rz-run profile to load (same as -e dbg.profile=X)
|
||||
[32m-R[0m[33m rule [0m [0mSpecify custom rz-run directive
|
||||
[32m-s[0m[33m addr [0m [0mInitial seek
|
||||
[32m-T[0m [0mDo not compute file hashes
|
||||
[32m-u[0m [0mSet bin.filter=false to get raw sym/sec/cls names
|
||||
[32m-v, -V[0m [0mShow rizin version (-V show lib versions)
|
||||
[32m-w[0m [0mOpen file in write mode
|
||||
[32m-x[0m [0mOpen without exec-flag (asm.emu will not work), See io.exec
|
||||
[32m-X[0m [0mSame as -e bin.usextr=false (useful for dyldcache)
|
||||
[32m-z, -zz[0m [0mDo not load strings or load them even in raw
|
||||
|
||||
Usage: rz-ax [options] [expr ...]
|
||||
[36mUsage: [0mrz-asm [-ACdDehLBvw] [-a arch] [-b bits] [-m plugin] [-o addr] [-s syntax]
|
||||
[-f file] [-F fil:ter] [-i skip] [-l len] 'code'|hex|-
|
||||
[32m-a[0m[33m arch [0m [0mSet architecture to assemble/disassemble (see -L)
|
||||
[32m-A[0m [0mShow Analysis information from given hexpairs
|
||||
[32m-b[0m[33m bits [0m [0mSet cpu register size (8, 16, 32, 64) (RZ_ASM_BITS)
|
||||
[32m-B[0m [0mBinary input/output (-l is mandatory for binary input)
|
||||
[32m-c[0m[33m cpu [0m [0mSelect specific CPU (depends on arch)
|
||||
[32m-C[0m [0mOutput in C format
|
||||
[32m-d, -D[0m [0mDisassemble from hexpair bytes (-D show hexpairs)
|
||||
[32m-e[0m [0mUse big endian instead of little endian
|
||||
[32m-I[0m [0mDisplay lifted RzIL code (same input as in -d, IL is also validated)
|
||||
[32m-E[0m [0mDisplay ESIL expression (same input as in -d)
|
||||
[32m-f[0m[33m file [0m [0mRead data from file
|
||||
[32m-F[0m[33m in:out [0m [0mSpecify input and/or output filters (att2intel, x86.pseudo, ...)
|
||||
[32m-h, -hh[0m [0mShow this help, -hh for long
|
||||
[32m-i[0m[33m len [0m [0mIgnore N bytes of the input buffer
|
||||
[32m-j[0m [0mOutput in JSON format
|
||||
[32m-k[0m[33m kernel [0m [0mSelect operating system (linux, windows, darwin, ..)
|
||||
[32m-l[0m[33m len [0m [0mInput/Output length
|
||||
[32m-L[0m [0mList Asm plugins: (a=asm, d=disasm, A=analyze, e=ESIL, I=RzIL)
|
||||
[32m-m[0m[33m plugin [0m [0mList supported CPUs for the chosen plugin
|
||||
[32m-o, -@[0m[33m addr [0m[0mSet start address for code (default 0)
|
||||
[32m-O[0m[33m file [0m [0mOutput file name (rz-asm -Bf a.asm -O a)
|
||||
[32m-p[0m [0mRun SPP over input for assembly
|
||||
[32m-q[0m [0mQuiet mode
|
||||
[32m-r[0m [0mOutput in rizin commands
|
||||
[32m-s[0m[33m syntax [0m [0mSelect syntax (intel, att)
|
||||
[32m-v[0m [0mShow version information
|
||||
[32m-x[0m [0mUse hex dwords instead of hex pairs when assembling.
|
||||
[32m-w[0m [0mDescribe opcode
|
||||
If '-l' value is greater than output length, output is padded with nops
|
||||
If the last argument is '-' reads from stdin
|
||||
Environment:
|
||||
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)
|
||||
|
||||
[36mUsage:[0m rz-ax [options] [expr ...]
|
||||
If expr is not provided, reads from stdin
|
||||
int -> hex ; rz-ax 10
|
||||
hex -> int ; rz-ax 0xa
|
||||
-int -> hex ; rz-ax -77
|
||||
-hex -> int ; rz-ax 0xffffffb3
|
||||
int -> bin ; rz-ax b30
|
||||
int -> ternary ; rz-ax t42
|
||||
bin -> int ; rz-ax 1010d
|
||||
ternary -> int ; rz-ax 1010dt
|
||||
float -> hex ; rz-ax 3.33f
|
||||
hex -> float ; rz-ax Fx40551ed8
|
||||
oct -> hex ; rz-ax 35o
|
||||
hex -> oct ; rz-ax Ox12 (O is a letter)
|
||||
bin -> hex ; rz-ax 1100011b
|
||||
hex -> bin ; rz-ax Bx63
|
||||
ternary -> hex ; rz-ax 212t
|
||||
hex -> ternary ; rz-ax Tx23
|
||||
raw -> hex ; rz-ax -S < /binfile
|
||||
hex -> raw ; rz-ax -s 414141
|
||||
=base ; rz-ax =10 0x46 -> output in base 10
|
||||
-l ; append newline to output (for -E/-D/-r/..
|
||||
-a show ascii table ; rz-ax -a
|
||||
-b bin -> str ; rz-ax -b 01000101 01110110
|
||||
-B str -> bin ; rz-ax -B hello
|
||||
-d force integer ; rz-ax -d 3 -> 3 instead of 0x3
|
||||
-e swap endianness ; rz-ax -e 0x33
|
||||
-D base64 decode ;
|
||||
-E base64 encode ;
|
||||
-f floating point ; rz-ax -f 6.3+2.1
|
||||
-F stdin slurp code hex ; rz-ax -F < shellcode.[c/py/js]
|
||||
-h show this help ; rz-ax -h
|
||||
-i dump as C byte array ; rz-ax -i < bytes
|
||||
-I IP address <-> LONG ; rz-ax -I 3530468537
|
||||
-k keep base ; rz-ax -k 33+3 -> 36
|
||||
-L bin -> hex(bignum) ; rz-ax -L 111111111 # 0x1ff
|
||||
-n int value -> hexpairs; rz-ax -n 0x1234 # 34120000
|
||||
-o octalstr -> raw ; rz-ax -o \162 \172 # rz
|
||||
-N binary number ; rz-ax -N 0x1234 # \x34\x12\x00\x00
|
||||
-r rz style output ; rz-ax -r 0x1234
|
||||
-s hexstr -> raw ; rz-ax -s 43 4a 50
|
||||
-S raw -> hexstr ; rz-ax -S < /bin/ls > ls.hex
|
||||
-t Unix tstamp -> str ; rz-ax -t 1234567890
|
||||
-m MS-DOS tstamp -> str ; rz-ax -m 1234567890
|
||||
-W Win32 tstamp -> str ; rz-ax -W 1234567890
|
||||
-x hash string ; rz-ax -x linux osx
|
||||
-u units ; rz-ax -u 389289238 # 317.0M
|
||||
-w signed word ; rz-ax -w 16 0xffff
|
||||
-v version ; rz-ax -v
|
||||
-p position of set bits ; rz-ax -p 0xb3
|
||||
[0mint -> hex ; rz-ax 10
|
||||
[0mhex -> int ; rz-ax 0xa
|
||||
[0m-int -> hex ; rz-ax -77
|
||||
[0m-hex -> int ; rz-ax 0xffffffb3
|
||||
[0mint -> bin ; rz-ax b30
|
||||
[0mint -> ternary ; rz-ax t42
|
||||
[0mbin -> int ; rz-ax 1010d
|
||||
[0mternary -> int ; rz-ax 1010dt
|
||||
[0mfloat -> hex ; rz-ax 3.33f
|
||||
[0mhex -> float ; rz-ax Fx40551ed8
|
||||
[0moct -> hex ; rz-ax 35o
|
||||
[0mhex -> oct ; rz-ax Ox12 (O is a letter)
|
||||
[0mbin -> hex ; rz-ax 1100011b
|
||||
[0mhex -> bin ; rz-ax Bx63
|
||||
[0mternary -> hex ; rz-ax 212t
|
||||
[0mhex -> ternary ; rz-ax Tx23
|
||||
[0mraw -> hex ; rz-ax [32m-S[0m < /binfile
|
||||
[0mhex -> raw ; rz-ax [32m-s[0m 414141
|
||||
[32m=[0m[33m base [0m [0m ; rz-ax [32m=[33m10[0m 0x46 -> output in base 10
|
||||
[32m-l[0m [0m ; append newline to output (for [32m-E[0m/[32m-D[0m/[32m-r[0m/..
|
||||
[32m-a[0m [0mshow ascii table ; rz-ax [32m-a[0m
|
||||
[32m-b[0m [0mbin -> str ; rz-ax [32m-b[0m 01000101 01110110
|
||||
[32m-B[0m [0mstr -> bin ; rz-ax [32m-B[0m hello
|
||||
[32m-d[0m [0mforce integer ; rz-ax [32m-d[0m 3 -> 3 instead of 0x3
|
||||
[32m-e[0m [0mswap endianness ; rz-ax [32m-e[0m 0x33
|
||||
[32m-D[0m [0mbase64 decode
|
||||
[32m-E[0m [0mbase64 encode
|
||||
[32m-f[0m [0mfloating point ; rz-ax [32m-f[0m 6.3+2.1
|
||||
[32m-F[0m [0mstdin slurp code hex ; rz-ax [32m-F[0m < shellcode.[c/py/js]
|
||||
[32m-h[0m [0mshow this help ; rz-ax [32m-h[0m
|
||||
[32m-i[0m [0mdump as C byte array ; rz-ax [32m-i[0m < bytes
|
||||
[32m-I[0m [0mIP address <-> LONG ; rz-ax [32m-I[0m 3530468537
|
||||
[32m-k[0m [0mkeep base ; rz-ax [32m-k[0m 33+3 -> 36
|
||||
[32m-L[0m [0mbin -> hex(bignum) ; rz-ax [32m-L[0m 111111111 # 0x1ff
|
||||
[32m-n[0m [0mint value -> hexpairs ; rz-ax [32m-n[0m 0x1234 # 34120000
|
||||
[32m-o[0m [0moctalstr -> raw ; rz-ax [32m-o[0m \162 \172 # rz
|
||||
[32m-N[0m [0mbinary number ; rz-ax [32m-N[0m 0x1234 # \x34\x12\x00\x00
|
||||
[32m-r[0m [0mrz style output ; rz-ax [32m-r[0m 0x1234
|
||||
[32m-s[0m [0mhexstr -> raw ; rz-ax [32m-s[0m 43 4a 50
|
||||
[32m-S[0m [0mraw -> hexstr ; rz-ax [32m-S[0m < /bin/ls > ls.hex
|
||||
[32m-t[0m [0mUnix tstamp -> str ; rz-ax [32m-t[0m 1234567890
|
||||
[32m-m[0m [0mMS-DOS tstamp -> str ; rz-ax [32m-m[0m 1234567890
|
||||
[32m-W[0m [0mWin32 tstamp -> str ; rz-ax [32m-W[0m 1234567890
|
||||
[32m-x[0m [0mhash string ; rz-ax [32m-x[0m linux osx
|
||||
[32m-u[0m [0munits ; rz-ax [32m-u[0m 389289238 # 317.0M
|
||||
[32m-w[0m [0msigned word ; rz-ax [32m-w[0m 16 0xffff
|
||||
[32m-v[0m [0mversion ; rz-ax [32m-v[0m
|
||||
[32m-p[0m [0mposition of set bits ; rz-ax [32m-p[0m 0xb3
|
||||
|
||||
[36mUsage: [0mrz-bin [-AcdeEghHiIjlLMqrRsSUvVxzZ] [-@ at] [-a arch] [-b bits] [-B addr]
|
||||
[-C F:C:D] [-f str] [-m addr] [-n str] [-N m:M] [-P pdb]
|
||||
[-o str] [-O str] [-k query] [-D lang symname] file
|
||||
[32m-@[0m[33m [addr] [0m [0mShow section, symbol, or import at the given address
|
||||
[32m-A[0m [0mList sub-binaries and their arch-bits pairs
|
||||
[32m-a[0m[33m [arch] [0m [0mSet arch (x86, arm, .. or <arch>_<bits>)
|
||||
[32m-b[0m[33m [bits] [0m [0mSet bits (32, 64 ...)
|
||||
[32m-B[0m[33m [addr] [0m [0mOverride base address (pie bins)
|
||||
[32m-c[0m [0mList classes
|
||||
[32m-cc[0m [0mList classes in header format
|
||||
[32m-C[0m[33m [fmt:C:D] [0m [0mCreate [elf,mach0,pe] with Code and Data hexpairs (see -a)
|
||||
[32m-d[0m [0mShow debug/dwarf information
|
||||
[32m-dd[0m [0mLoad debug/dwarf information from debuginfod server
|
||||
[32m-D[0m[33m lang name [0m [0mDemangle symbol name (-D all for bin.demangle=true)z
|
||||
[32m-e[0m [0mEntrypoint
|
||||
[32m-ee[0m [0mConstructor/destructor entrypoints
|
||||
[32m-E[0m [0mGlobally exportable symbols
|
||||
[32m-f[0m[33m [mach] [0m [0mSelect sub-binary for the machine [mach].
|
||||
[32m-F[0m[33m [binfmt] [0m [0mForce to use that bin plugin (ignore header check)
|
||||
[32m-g[0m [0mSame as -SMZIHVResizcld -SS -SSS -ee (show all info)
|
||||
[32m-G[0m[33m [addr] [0m [0mLoad address . offset to header
|
||||
[32m-h[0m [0mShow this help
|
||||
[32m-H[0m [0mHeader fields
|
||||
[32m-i[0m [0mImport (symbols imported from libraries)
|
||||
[32m-I[0m [0mBinary info
|
||||
[32m-j[0m [0mOutput in JSON
|
||||
[32m-k[0m[33m [sdb-query] [0m [0mRun sdb query. for example: '*'
|
||||
[32m-K[0m[33m [algo] [0m [0mCalculate checksums (md5, sha1, ..)
|
||||
[32m-l[0m [0mLinked libraries
|
||||
[32m-L[0m[33m [plugin] [0m [0mList supported bin plugins or plugin details
|
||||
[32m-m[0m[33m [addr] [0m [0mShow source line at addr
|
||||
[32m-M[0m [0mMain (show address of main symbol)
|
||||
[32m-n[0m[33m [str] [0m [0mShow section, symbol or import named str
|
||||
[32m-N[0m[33m [min:max] [0m [0mForce min:max number of chars per string (see -z and -zz)
|
||||
[32m-o[0m[33m [str] [0m [0mOutput file/folder for write operations (out by default)
|
||||
[32m-O[0m[33m [str] [0m [0mWrite/extract operations (-O help)
|
||||
[32m-p[0m [0mShow physical addresses
|
||||
[32m-P[0m [0mShow debug/pdb information
|
||||
[32m-PP[0m [0mDownload pdb file for binary
|
||||
[32m-q[0m [0mQuiet mode, just show fewer data
|
||||
[32m-qq[0m [0mShow less info (no offset/size for -z for ex.)
|
||||
[32m-Q[0m [0mShow load address used by dlopen (non-aslr libs)
|
||||
[32m-r[0m [0mShow output in rizin format
|
||||
[32m-R[0m [0mShow relocations
|
||||
[32m-s[0m [0mSymbols
|
||||
[32m-S[0m [0mSections
|
||||
[32m-SS[0m [0mSegments
|
||||
[32m-SSS[0m [0mSections mapping to segments
|
||||
[32m-T[0m [0mDisplay file signature
|
||||
[32m-u[0m [0mUnfiltered (no rename duplicated symbols/sections)
|
||||
[32m-U[0m [0mResources
|
||||
[32m-v[0m [0mShow version information
|
||||
[32m-V[0m [0mShow binary version information
|
||||
[32m-w[0m [0mDisplay try/catch blocks
|
||||
[32m-x[0m [0mExtract bins contained in file
|
||||
[32m-X[0m[33m [fmt] [f] .. [0m[0mPackage in fat or zip the given files and bins contained in file
|
||||
[32m-Y[0m[33m [fw file] [0m [0mCalculate all the possibles base address candidates of a firmware bin
|
||||
[32m-z[0m [0mShow strings (from data section)
|
||||
[32m-zz[0m [0mShow strings (from raw strings from bin)
|
||||
[32m-zzz[0m [0mDump raw strings to stdout (for huge files)
|
||||
[32m-Z[0m [0mGuess size of binary program
|
||||
Environment:
|
||||
RZ_BIN_CODESIGN_VERBOSE: # make code signatures verbose
|
||||
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 search.str.max_length # 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
|
||||
|
||||
[36mUsage: [0mrz-diff [options] <file0> <file1>
|
||||
[32m-a[0m[33m [arch] [0m[0mSpecify architecture plugin to use (x86, arm, ..)
|
||||
[32m-b[0m[33m [bits] [0m[0mSpecify register size for arch (16 (thumb), 32, 64, ..)
|
||||
[32m-d[0m[33m [algo] [0m[0mCompute edit distance based on the chosen algorithm:
|
||||
[32m[0m [0m myers | Eugene W. Myers' O(ND) algorithm (no substitution)
|
||||
[32m[0m [0m leven | Levenshtein O(N^2) algorithm (with substitution)
|
||||
[32m[0m [0m ssdeep | Context triggered piecewise hashing comparison
|
||||
[32m-i[0m [0mUse command line arguments instead of files (only for -d)
|
||||
[32m-H[0m [0mHexadecimal visual mode
|
||||
[32m-h[0m [0mShow this help
|
||||
[32m-j[0m [0mJSON output
|
||||
[32m-q[0m [0mQuite output
|
||||
[32m-V[0m [0mShow version information
|
||||
[32m-v[0m [0mBe more verbose (stderr output)
|
||||
[32m-e[0m[33m [k=v] [0m [0mSet an evaluable config variable
|
||||
[32m-A[0m [0mCompare virtual and physical addresses
|
||||
[32m-B[0m [0mRun 'aaa' when loading the bin
|
||||
[32m-C[0m [0mDisable colors
|
||||
[32m-T[0m [0mShow timestamp information
|
||||
[32m-S[0m[33m [WxH] [0m [0mSet the width and height of the terminal for visual mode
|
||||
[32m-0[0m[33m [cmd] [0m [0mInput for file0 when option -t 'commands' is given.
|
||||
[32m[0m [0mThe same value will be set for file1, if -1 is not set.
|
||||
[32m-1[0m[33m [cmd] [0m [0mInput for file1 when option -t 'commands' is given.
|
||||
[32m-t[0m[33m [type] [0m[0mCompute the difference between two files based on its type:
|
||||
[32m[0m [0m bytes | compare raw bytes in the files (only for small files)
|
||||
[32m[0m [0m lines | compare text files
|
||||
[32m[0m [0m functions | compare functions found in the files
|
||||
[32m[0m [0m | optional -0 <fcn name|offset> to compare only one function
|
||||
[32m[0m [0m classes | compare classes found in the files
|
||||
[32m[0m [0m command | compare command output returned when executed in both files
|
||||
[32m[0m [0m | require -0 <cmd> and -1 <cmd> is optional
|
||||
[32m[0m [0m entries | compare entries found in the files
|
||||
[32m[0m [0m fields | compare fields found in the files
|
||||
[32m[0m [0m graphs | compare 2 functions and outputs in graphviz/dot format
|
||||
[32m[0m [0m | require -0 <fcn name|offset> and -1 <fcn name|offset> is optional
|
||||
[32m[0m [0m imports | compare imports found in the files
|
||||
[32m[0m [0m libraries | compare libraries found in the files
|
||||
[32m[0m [0m sections | compare sections found in the files
|
||||
[32m[0m [0m strings | compare strings found in the files
|
||||
[32m[0m [0m symbols | compare symbols found in the files
|
||||
palette colors can be changed by adding the following lines
|
||||
inside the $HOME/.rizinrc file
|
||||
ec diff.unknown blue | offset color
|
||||
ec diff.match green | match color
|
||||
ec diff.unmatch red | mismatch color
|
||||
|
||||
[36mUsage: [0mrz-find [-mXnzZhqv] [-a align] [-b sz] [-f/t from/to] [-[e|s|w|S|I] str] [-x hex] -|file|dir ..
|
||||
[32m-a[0m[33m [align] [0m[0mOnly accept aligned hits
|
||||
[32m-b[0m[33m [size] [0m [0mSet block size
|
||||
[32m-e[0m[33m [regex] [0m[0mSearch for regex matches (can be used multiple times)
|
||||
[32m-E[0m[33m [cmd] [0m [0mExecute command for each file found
|
||||
[32m-f[0m[33m [from] [0m [0mStart searching from address 'from'
|
||||
[32m-F[0m[33m [file] [0m [0mRead the contents of the file and use it as keyword
|
||||
[32m-h[0m [0mShow this help
|
||||
[32m-i[0m [0mIdentify filetype (rizin -nqcpm file)
|
||||
[32m-j[0m [0mOutput in JSON
|
||||
[32m-m[0m [0mMagic search, file-type carver
|
||||
[32m-M[0m[33m [str] [0m [0mSet a binary mask to be applied on keywords
|
||||
[32m-n[0m [0mDo not stop on read errors
|
||||
[32m-r[0m [0mPrint using rizin commands
|
||||
[32m-s[0m[33m [str] [0m [0mSearch for a specific string (can be used multiple times)
|
||||
[32m-w[0m[33m [str] [0m [0mSearch for a specific wide string (can be used multiple times). Assumes str is UTF-8.
|
||||
[32m-I[0m[33m [str] [0m [0mSearch for an entry in import table.
|
||||
[32m-S[0m[33m [str] [0m [0mSearch for a symbol in symbol table.
|
||||
[32m-t[0m[33m [to] [0m [0mStop search at address 'to'
|
||||
[32m-q[0m [0mQuiet - do not show headings (filenames) above matching contents (default for searching a single file)
|
||||
[32m-v[0m [0mShow version information
|
||||
[32m-x[0m[33m [hex] [0m [0mSearch for hexpair string (909090) (can be used multiple times)
|
||||
[32m-X[0m [0mShow hexdump of search results
|
||||
[32m-z[0m [0mSearch for zero-terminated strings
|
||||
[32m-Z[0m [0mShow string found on each search hit
|
||||
|
||||
[36mUsage: [0mrz-gg [-FOLsrxhvz] [-a arch] [-b bits] [-k os] [-o file] [-I path]
|
||||
[-i sc] [-e enc] [-B hex] [-c k=v] [-C file] [-p pad] [-q off]
|
||||
[-S string] [-f fmt] [-nN dword] [-dDw off:hex] file|f.asm|-
|
||||
[32m-a[0m[33m [arch] [0m [0mSelect architecture (x86, mips, arm)
|
||||
[32m-b[0m[33m [bits] [0m [0mSet Register size (32, 64, ..)
|
||||
[32m-B[0m[33m [hexpairs] [0m [0mAppend some hexpair bytes
|
||||
[32m-c[0m[33m [k=v] [0m [0mSet configuration options
|
||||
[32m-C[0m[33m [file] [0m [0mAppend contents of file
|
||||
[32m-d[0m[33m [off:dword] [0m[0mPatch dword (4 bytes) at given offset
|
||||
[32m-D[0m[33m [off:qword] [0m[0mPatch qword (8 bytes) at given offset
|
||||
[32m-e[0m[33m [encoder] [0m [0mUse specific encoder. see -L
|
||||
[32m-f[0m[33m [format] [0m [0mOutput format (raw, c, pe, elf, mach0, python, javascript)
|
||||
[32m-F[0m [0mOutput native format (osx=mach0, linux=elf, ..)
|
||||
[32m-h[0m [0mShow this help
|
||||
[32m-i[0m[33m [shellcode] [0m[0mInclude shellcode plugin, uses options. see -L
|
||||
[32m-I[0m[33m [path] [0m [0mAdd include path
|
||||
[32m-k[0m[33m [kernel] [0m [0mOperating system's kernel (linux,bsd,osx,w32)
|
||||
[32m-L[0m [0mList all plugins (shellcodes and encoders)
|
||||
[32m-n[0m[33m [dword] [0m [0mAppend 32bit number (4 bytes)
|
||||
[32m-N[0m[33m [dword] [0m [0mAppend 64bit number (8 bytes)
|
||||
[32m-o[0m[33m [file] [0m [0mOutput file
|
||||
[32m-O[0m [0mUse default output file (filename without extension or a.out)
|
||||
[32m-p[0m[33m [padding] [0m [0mAdd padding after compilation (padding=n10s32)
|
||||
[32m[0m [0mntas : begin nop, trap, 'a', sequence
|
||||
[32m[0m [0mNTAS : same as above, but at the end
|
||||
[32m-P[0m[33m [size] [0m [0mPrepend debruijn sequence of given length
|
||||
[32m-q[0m[33m [fragment] [0m [0mDebruijn pattern offset
|
||||
[32m-r[0m [0mShow raw bytes instead of hexpairs
|
||||
[32m-s[0m [0mShow assembler
|
||||
[32m-S[0m[33m [string] [0m [0mAppend a string
|
||||
[32m-v[0m [0mShow version information
|
||||
[32m-w[0m[33m [off:hex] [0m [0mPatch hexpairs at given offset
|
||||
[32m-x[0m [0mExecute
|
||||
[32m-X[0m[33m [hexpairs] [0m [0mExecute rop chain, using the stack provided
|
||||
[32m-z[0m [0mOutput in C string syntax
|
||||
|
||||
[36mUsage: [0mrz-hash [-vhBkjLq] [-b S] [-a A] [-c H] [-E A] [-D A] [-s S] [-x S] [-f O] [-t O] [files|-] ...
|
||||
[32m -v[0m [0mShow version information
|
||||
[32m -h[0m [0mShow this help
|
||||
[32m -[0m [0mInput read from stdin instead from a file
|
||||
[32m -a[0m[33m algo [0m [0mHash algorithm to use and you can specify multiple ones by
|
||||
[32m [0m [0mAppending a comma (example: sha1,md4,md5,sha256)
|
||||
[32m -B[0m [0mOutput the calculated value for each block
|
||||
[32m -b[0m[33m size [0m [0mSet the block size
|
||||
[32m -c[0m[33m value [0m [0mCompare calculated value with a given one (hexadecimal)
|
||||
[32m -e[0m[33m endian [0m[0mSet the endianness (default: 'big' accepted: 'big' or 'little')
|
||||
[32m -D[0m[33m algo [0m [0mDecrypt the given input; use -S to set key and -I to set IV (if needed)
|
||||
[32m -E[0m[33m algo [0m [0mEncrypt the given input; use -S to set key and -I to set IV (if needed)
|
||||
[32m -f[0m[33m from [0m [0mStart the calculation at given offset
|
||||
[32m -t[0m[33m to [0m [0mStop the calculation at given offset
|
||||
[32m -I[0m[33m iv [0m [0mSet the initialization vector (IV)
|
||||
[32m -i[0m[33m times [0m [0mRepeat the calculation N times
|
||||
[32m -j[0m [0mOutput the result as a JSON structure
|
||||
[32m -k[0m [0mOutput the calculated value using openssh's randomkey algorithm
|
||||
[32m -L[0m [0mList all algorithms
|
||||
[32m -q[0m [0mSet quiet mode (use -qq to get only the calculated value)
|
||||
[32m -S[0m[33m seed [0m [0mSet the seed for -a, use '^' to append it before the input, use '@'
|
||||
[32m [0m [0mPrefix to load it from a file and '-' from read it
|
||||
[32m -K[0m[33m key [0m [0mSet the hmac key for -a and the key for -E/-D, use '@' prefix to
|
||||
[32m [0m [0mLoad it from a file and '-' from read it
|
||||
[32m [0m [0mFrom stdin (you can combine them)
|
||||
[32m -s[0m[33m string [0m[0mInput read from a zero-terminated string instead from a file
|
||||
[32m -x[0m[33m hex [0m [0mInput read from a hexadecimal value instead from a file
|
||||
[32m [0m [0m
|
||||
[32m [0m [0mAll the input (besides -s/-x/-c) can be hexadecimal or strings
|
||||
[32m [0m [0mIf 's:' prefix is specified
|
||||
[32m-v[0m [0mShow version information
|
||||
[32m-h[0m [0mShow this help
|
||||
[32m-[0m [0mInput read from stdin instead from a file
|
||||
[32m-a[0m[33m algo [0m [0mHash algorithm to use and you can specify multiple ones by
|
||||
[32m[0m [0mAppending a comma (example: sha1,md4,md5,sha256)
|
||||
[32m-B[0m [0mOutput the calculated value for each block
|
||||
[32m-b[0m[33m size [0m [0mSet the block size
|
||||
[32m-c[0m[33m value [0m [0mCompare calculated value with a given one (hexadecimal)
|
||||
[32m-e[0m[33m endian [0m[0mSet the endianness (default: 'big' accepted: 'big' or 'little')
|
||||
[32m-D[0m[33m algo [0m [0mDecrypt the given input; use -S to set key and -I to set IV (if needed)
|
||||
[32m-E[0m[33m algo [0m [0mEncrypt the given input; use -S to set key and -I to set IV (if needed)
|
||||
[32m-f[0m[33m from [0m [0mStart the calculation at given offset
|
||||
[32m-t[0m[33m to [0m [0mStop the calculation at given offset
|
||||
[32m-I[0m[33m iv [0m [0mSet the initialization vector (IV)
|
||||
[32m-i[0m[33m times [0m [0mRepeat the calculation N times
|
||||
[32m-j[0m [0mOutput the result as a JSON structure
|
||||
[32m-k[0m [0mOutput the calculated value using openssh's randomkey algorithm
|
||||
[32m-L[0m [0mList all algorithms
|
||||
[32m-q[0m [0mSet quiet mode (use -qq to get only the calculated value)
|
||||
[32m-S[0m[33m seed [0m [0mSet the seed for -a, use '^' to append it before the input, use '@'
|
||||
[32m[0m [0mPrefix to load it from a file and '-' from read it
|
||||
[32m-K[0m[33m key [0m [0mSet the hmac key for -a and the key for -E/-D, use '@' prefix to
|
||||
[32m[0m [0mLoad it from a file and '-' from read it
|
||||
[32m[0m [0mFrom stdin (you can combine them)
|
||||
[32m-s[0m[33m string [0m[0mInput read from a zero-terminated string instead from a file
|
||||
[32m-x[0m[33m hex [0m [0mInput read from a hexadecimal value instead from a file
|
||||
[32m[0m [0m
|
||||
[32m[0m [0mAll the input (besides -s/-x/-c) can be hexadecimal or strings
|
||||
[32m[0m [0mIf 's:' prefix is specified
|
||||
|
||||
[36mUsage: [0m[directives] [script.rz] [--] [program] [args]
|
||||
[32m-h[0m [0mShow this help
|
||||
[32m-l[0m [0mShow profile options
|
||||
[32m-t[0m [0mOutput template profile
|
||||
[32m-v[0m [0mShow version information
|
||||
[32m-w[0m [0mWait for incoming terminal process
|
||||
[32m--[0m[33m [program] [args] [0m[0mRun commands
|
||||
|
||||
[36mUsage: [0mrz-sign [options] [file]
|
||||
[32m-h[0m [0mShow this help
|
||||
[32m-a[0m[33m [-a] [0m [0mAdd extra 'a' to analysis command (available only with -o option)
|
||||
[32m-e[0m[33m [k=v] [0m [0mSet an evaluable config variable (available only with -o option)
|
||||
[32m-c[0m[33m [output.pat] [input.sig] [0m[0mParse a FLIRT signature and convert it to its other format
|
||||
[32m-o[0m[33m [output.sig] [input.bin] [0m[0mPerform an analysis on the binary and generate the FLIRT signature
|
||||
[32m-d[0m[33m [flirt.sig] [0m [0mParse a FLIRT signature and dump its content
|
||||
[32m-q[0m [0mQuiet mode
|
||||
[32m-v[0m [0mShow version information
|
||||
Examples:
|
||||
rz-sign -d signature.sig
|
||||
rz-sign -c new_signature.pat old_signature.sig
|
||||
rz-sign -o libc.sig libc.so.6
|
||||
|
||||
Usage: rz-test [-qvVnL] [-j threads] [test file/dir | @test-type]
|
||||
-h Show this help
|
||||
-v Show version information
|
||||
-q Quiet mode
|
||||
-V Be verbose
|
||||
-i Interactive mode
|
||||
-y Accept all interactive changes
|
||||
-n Do nothing (don't run any test, just load/parse them)
|
||||
-L Log mode (better printing for CI, logfiles, etc.)
|
||||
-F [dir] Run fuzz tests (open and default analysis) on all files in the given dir
|
||||
-j [threads] How many threads to use for running tests concurrently (default is 8)
|
||||
-r [rizin] Path to rizin executable (default is rizin)
|
||||
-m [rz-asm] Path to rz-asm executable (default is rz-asm)
|
||||
-f [file] File to use for JSON tests (default is bins/elf/crackme0x00b)
|
||||
-C [dir] Chdir before running rz-test (default follows test pathname/cwd)
|
||||
-t [seconds] Timeout per test (default is 960 seconds)
|
||||
-o [file] Output test run information in JSON format to file
|
||||
-e [dir] Exclude a particular directory while testing (this option can appear many times)
|
||||
-s [num] Number of expected successful tests
|
||||
-x [num] Number of expected failed tests
|
||||
Supported test types: @json @unit @fuzz @cmds
|
||||
EOF
|
||||
RUN
|
||||
|
|
|
|||
Loading…
Reference in a new issue