Fix autocompletion of rz- commands in rizin shell and rename wrong rz_ (#944)

This commit is contained in:
Riccardo Schirone 2021-03-31 15:10:54 +01:00 committed by GitHub
parent fe5af64505
commit db04bed503
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 160 additions and 161 deletions

View file

@ -106,11 +106,11 @@ rules to make the git history more readable and consistent:
* ##projects - saving/loading state
* ##refactor - improve code quality
* ##remote - rizin over tcp, http, rap, serial .. including collaboration
* ##search - rz_find, / command, ..
* ##search - rz-find, / command, ..
* ##shell - commandline, newshell, ..
* ##signatures-searching/generating them
* ##test - testing infrastructure fixes/changes
* ##tools - rz-pm, rz_run, rz_ax ... that don't fit in other categories
* ##tools - rz-pm, rz-run, rz-ax ... that don't fit in other categories
* ##util - core APIs
* ##visual - visual UI, including panels

View file

@ -7,7 +7,7 @@ set -e
mkdir -p "${DESTDIR}/${MESON_INSTALL_PREFIX}/bin"
cd "${DESTDIR}/${MESON_INSTALL_PREFIX}/bin"
TOOLS="rz_hash rz_run rz_asm rz_bin rz_gg rz_agent rz_diff rz_find rassign2 rz_ax"
TOOLS="rz-hash rz-run rz-asm rz-bin rz-gg rz-agent rz-diff rz-find rassign2 rz-ax"
for TOOL in $TOOLS ; do
ln -sf rizin $TOOL ;

View file

@ -1,8 +1,8 @@
#!/usr/bin/rz_asm -a x86 -b 64 -f
#!/usr/bin/rz-asm -a x86 -b 64 -f
# SPDX-FileCopyrightText: 2011 pancake <pancake@nopcode.org>
# SPDX-License-Identifier: LGPL-3.0-only
# - pancake xor encoder egg engine #
# rz_asm -a x86.nasm -f xorencoder.asm
# rz-asm -a x86.nasm -f xorencoder.asm
.equ CODESIZE,22
.equ BASE,0x29

View file

@ -135,7 +135,7 @@ confirm() {
purgeRZ() {
P="$1"
BINS="rizin rz_bin rz_find rz-pm "
BINS="rizin rz-bin rz-find rz-pm "
cd "$P/bin" && rm -f ${BINS}
cd "$P/lib" && rm -f libr_*
cd "$P/lib" && rm -rf rizin

View file

@ -58,7 +58,7 @@ static int help(bool verbose) {
" -r [rizin] path to rizin executable (default is " RIZIN_CMD_DEFAULT ")\n"
" -m [rz-asm] path to rz-asm executable (default is " RZ_ASM_CMD_DEFAULT ")\n"
" -f [file] file to use for json tests (default is " JSON_TEST_FILE_DEFAULT ")\n"
" -C [dir] chdir before running rz_test (default follows executable symlink + test/new\n"
" -C [dir] chdir before running rz-test (default follows executable symlink + test/new\n"
" -t [seconds] timeout per test (default is " TIMEOUT_DEFAULT_STR ")\n"
" -o [file] output test run information in JSON format to file"
"\n"
@ -81,7 +81,7 @@ static bool rz_test_chdir(const char *argv0) {
char *rz_test_path = rz_file_path(argv0);
bool found = false;
if (readlink(rz_test_path, src_path, sizeof(src_path)) != -1) {
char *p = strstr(src_path, RZ_SYS_DIR "binrz" RZ_SYS_DIR "rz_test" RZ_SYS_DIR "rz_test");
char *p = strstr(src_path, RZ_SYS_DIR "binrz" RZ_SYS_DIR "rz-test" RZ_SYS_DIR "rz-test");
if (p) {
*p = 0;
strcat(src_path, RZ_SYS_DIR "test" RZ_SYS_DIR);
@ -202,7 +202,7 @@ int main(int argc, char **argv) {
if (quiet) {
printf(RZ_VERSION "\n");
} else {
char *s = rz_str_version("rz_test");
char *s = rz_str_version("rz-test");
printf("%s\n", s);
free(s);
}
@ -1067,7 +1067,7 @@ static void interact_commands(RzTestResultInfo *result, RzPVector *fixup_results
return;
}
char *name = NULL;
int fd = rz_file_mkstemp("rz_test-cmds", &name);
int fd = rz_file_mkstemp("rz-test-cmds", &name);
if (fd == -1) {
free(name);
eprintf("Failed to open tmp file\n");

View file

@ -12,11 +12,11 @@ Install SDK from Arduino:
Install avarice, the gdbserver <-> jtag:
rz_pm -i avarice
rz-pm -i avarice
Run the proxy:
rz_pm -r avarice --jtag /dev/tty.wch* --mkI :4242
rz-pm -r avarice --jtag /dev/tty.wch* --mkI :4242
Using GDB:

View file

@ -16,7 +16,7 @@ rizin-built farm beats the facebook one.
Thank you for using rizin. Have a nice night!
Your rizin was built 20h ago. TOO OLD!
Use rizin! Lemons included!
rz_ax -s 20e296b20ae296b220e296b20a
rz-ax -s 20e296b20ae296b220e296b20a
Connection lost with the license server, your rizin session will terminate in 30 minutes.
This is amazing ...
I love gradients.
@ -212,7 +212,7 @@ This accessory is not supported by this version of rizin.
When can we have an official anime mascot for rizin?
Sorry, rizin has experienced an internal error.
Segmentation fault (core dumped)
Use rz_bin to discover the real TRUTH
Use rz-bin to discover the real TRUTH
==1337== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
**** COMMODORE 64 RIZIN V2 **** 64K RAM SYSTEM 38911 DISASM BYTES FREE READY.
Most likely your core dump fell into a blackhole, can't see it.

View file

@ -29,7 +29,7 @@ Assemble opcodes with the 'a' and 'A' keys in visual mode, which are bindings to
Find expanded AES keys in memory with '/ca'
Find wide-char strings with the '/w <string>' command
Control the signal handlers of the child process with the 'dk' command
Get a free shell with 'rz_gg -i exec -x'
Get a free shell with 'rz-gg -i exec -x'
Interpret rizin scripts with '. <path-to-script>'. Similar to the bash source alias command.
Most of commands accept '?' as a suffix. Use it to understand how they work :)
Find hexpairs with '/x a0 cc 33'
@ -50,7 +50,7 @@ Change the UID of the debugged process with child.uid (requires root)
Enhance your graphs by increasing the size of the block and graph.depth eval variable.
Control the height of the terminal on serial consoles with e scr.height
Emulate the base address of a file with e file.baddr.
Bindiff two files with '$ rz_diff /bin/true /bin/false'
Bindiff two files with '$ rz-diff /bin/true /bin/false'
Execute commands on a temporary offset by appending '@ offset' to your command.
Temporally drop the verbosity prefixing the commands with ':'
Change the graph block definition with graph.callblocks, graph.jmpblocks, graph.flagblocks
@ -60,7 +60,7 @@ Analyze socket connections with the socket plugin: 'rizin socket://www.foo.com:8
Setup dbg.fpregs to true to visualize the fpu registers in the debugger view.
To debug a program, you can call rizin with 'dbg://<path-to-program>' or '-d <path..>'
Use 'e' and 't' in Visual mode to edit configuration and track flags.
Use 'rz_bin -ris' to get the import/export symbols of any binary.
Use 'rz-bin -ris' to get the import/export symbols of any binary.
Remember to maintain your ~/.rizin_history
Enable the PAGER with 'e scr.pager=less -R'
Use 'e asm.offset=true' to show offsets in 16bit segment addressing mode.
@ -68,8 +68,8 @@ The '?' command can be used to evaluate math expressions. Like this: '? (0x34+22
Set 'e bin.dbginfo=true' to load debug information at startup.
Rename a function using the 'afr <newname> @ <offset>' command.
You can redefine descriptive commands in the hud file and using the 'V_' command.
Pass '-j' to rz_bin to get the information of the binary in JSON format.
Use rz_run to launch your programs with a predefined environment.
Pass '-j' to rz-bin to get the information of the binary in JSON format.
Use rz-run to launch your programs with a predefined environment.
You are probably using an old version of rizin, go checkout the git!
Run your own rizin scripts in awk using the rizinawk program.
Use '-e bin.strings=false' to disable automatic string search when loading the binary.

View file

@ -6226,7 +6226,7 @@ void thisplay(const char *str) {
char cmd[32];
int op = armass_assemble(str, 0x1000, 1);
printf("[%04x] %s\n", op, str);
snprintf(cmd, sizeof(cmd), "rz_asm -d -b 16 -a arm %04x", op);
snprintf(cmd, sizeof(cmd), "rz-asm -d -b 16 -a arm %04x", op);
system(cmd);
}
@ -6234,7 +6234,7 @@ void display(const char *str) {
char cmd[32];
int op = armass_assemble(str, 0x1000, 0);
printf("[%08x] %s\n", op, str);
snprintf(cmd, sizeof(cmd), "rz_asm -d -a arm %08x", op);
snprintf(cmd, sizeof(cmd), "rz-asm -d -a arm %08x", op);
system(cmd);
}

View file

@ -1405,39 +1405,36 @@ static int __runMain(RzMainCallback cb, const char *arg) {
static bool cmd_rzcmd(RzCore *core, const char *_input) {
char *input = rz_str_newf("r%s", _input);
int rc = 0;
if (rz_str_startswith(input, "rz_ax")) {
rc = __runMain(core->rz_main_rz_ax, input);
} else if (rz_str_startswith(input, "rz")) {
if (rz_str_startswith(input, "rizin")) {
rz_sys_cmdf("%s", input);
// rc = __runMain (core->rz_main_rizin, input);
} else if (rz_str_startswith(input, "rizin")) {
} else if (rz_str_startswith(input, "rz-agent")) {
rz_sys_cmdf("%s", input);
// rc = __runMain (core->rz_main_rizin, input);
} else if (rz_str_startswith(input, "rz_asm")) {
} else if (rz_str_startswith(input, "rz-asm")) {
rz_sys_cmdf("%s", input);
// rc = __runMain (core->rz_main_rz_asm, input);
} else if (rz_str_startswith(input, "rz_bin")) {
} else if (rz_str_startswith(input, "rz-ax")) {
rc = __runMain(core->rz_main_rz_ax, input);
} else if (rz_str_startswith(input, "rz-bin")) {
rz_sys_cmdf("%s", input);
// rc = __runMain (core->rz_main_rz_bin, input);
} else if (rz_str_startswith(input, "rz_gg")) {
} else if (rz_str_startswith(input, "rz-diff")) {
rc = __runMain(core->rz_main_rz_diff, input);
} else if (rz_str_startswith(input, "rz-find")) {
rz_sys_cmdf("%s", input);
} else if (rz_str_startswith(input, "rz-gg")) {
rz_sys_cmdf("%s", input);
// rc = __runMain (core->rz_main_rz_gg, input);
} else if (rz_str_startswith(input, "rz_pm")) {
} else if (rz_str_startswith(input, "rz-hash")) {
rz_sys_cmdf("%s", input);
} else if (rz_str_startswith(input, "rz-pm")) {
rz_sys_cmdf("%s", input);
// rc = __runMain (core->rz_main_rz_pm, input);
} else if (rz_str_startswith(input, "rz_diff")) {
rc = __runMain(core->rz_main_rz_diff, input);
} else if (rz_str_startswith(input, "rz-run")) {
rz_sys_cmdf("%s", input);
} else if (rz_str_startswith(input, "rz-sign")) {
rz_sys_cmdf("%s", input);
} else {
const char *rzcmds[] = {
"rz-ax", "rz-pm", "rz-asm", "rz-bin", "rz-hash", "rz-find", "rz-run", "rz-gg", "rizin", "rz", NULL
};
int i;
for (i = 0; rzcmds[i]; i++) {
if (rz_str_startswith(input, rzcmds[i])) {
free(input);
return true;
}
}
free(input);
return false;
}

View file

@ -280,9 +280,9 @@ static const char *help_msg_dmp[] = {
static const char *help_msg_do[] = {
"Usage:", "do", " # Debug (re)open commands",
"do", "", "Open process (reload, alias for 'oo')",
"dor", " [rz_run]", "Comma separated list of k=v rz_run profile options (e dbg.profile)",
"doe", "", "Show rz_run startup profile",
"doe!", "", "Edit rz_run startup profile with $EDITOR",
"dor", " [rz-run]", "Comma separated list of k=v rz-run profile options (e dbg.profile)",
"doe", "", "Show rz-run startup profile",
"doe!", "", "Edit rz-run startup profile with $EDITOR",
"doo", " [args]", "Reopen in debug mode with args (alias for 'ood')",
"doof", " [args]", "Reopen in debug mode from file (alias for 'oodf')",
"doc", "", "Close debug session",
@ -515,7 +515,7 @@ struct trace_node {
// XXX those tmp files are never removed and we shuoldnt use files for this
static void setRarunProfileString(RzCore *core, const char *str) {
char *file = rz_file_temp("rz_run");
char *file = rz_file_temp("rz-run");
char *s = strdup(str);
rz_config_set(core->config, "dbg.profile", file);
rz_str_replace_char(s, ',', '\n');
@ -5047,7 +5047,7 @@ RZ_IPI int rz_cmd_debug(void *data, const char *input) {
setRarunProfileString(core, input + 3);
} else {
// TODO use the api
rz_sys_xsystem("rz_run -h");
rz_sys_xsystem("rz-run -h");
}
break;
case 'o': // "doo" : reopen in debug mode

View file

@ -151,7 +151,7 @@ static const char *help_msg_ood[] = {
"Usage:", "ood", " # Debug (re)open commands",
"ood", " [args]", " # reopen in debug mode (with args)",
"oodf", " [file]", " # reopen in debug mode using the given file",
"oodr", " [rz_run]", " # same as dor ..;ood",
"oodr", " [rz-run]", " # same as dor ..;ood",
NULL
};

View file

@ -51,7 +51,7 @@ RZ_IPI int rz_cmd_plugins(void *data, const char *input) {
rz_core_cmdf(core, "dL%s", input + 1);
break;
case 'h': // "Lh"
rz_core_cmd0(core, "ph"); // rz_hash -L is more verbose
rz_core_cmd0(core, "ph"); // rz-hash -L is more verbose
break;
case 'a': // "La"
rz_core_cmd0(core, "e asm.arch=??");

View file

@ -39,7 +39,7 @@ static const char *help_msg_pp[] = {
"pp4", "", "print incremental dword pattern",
"pp8", "", "print incremental qword pattern",
"ppa", "[lu]", "latin alphabet (lowercase, uppercases restrictions)",
"ppd", "", "print debruijn pattern (see rz_gg -P, -q and wopD)",
"ppd", "", "print debruijn pattern (see rz-gg -P, -q and wopD)",
"ppf", "", "print buffer filled with 0xff",
"ppn", "", "numeric pin patterns",
NULL

View file

@ -2320,8 +2320,9 @@ static void __init_autocomplete_default(RzCore *core) {
const char *files[] = {
".", "..", ".*", "/F", "/m", "!", "!!", "#!c", "#!v", "#!cpipe", "#!vala",
"#!rust", "#!zig", "#!pipe", "#!python", "aeli", "arp", "arpg", "dmd", "drp", "drpg", "o",
"idp", "idpi", "L", "obf", "o+", "oc", "rz", "rz_bin", "rz_asm", "rz_hash", "rz_ax",
"rz_find", "cd", "ls", "on", "op", "wf", "rm", "wF", "wp", "Sd", "Sl", "to", "pm",
"idp", "idpi", "L", "obf", "o+", "oc",
"rizin", "rz-agent", "rz-asm", "rz-ax", "rz-bin", "rz-diff", "rz-find", "rz-gg", "rz-hash", "rz-pm", "rz-run", "rz-sign",
"cd", "ls", "on", "op", "wf", "rm", "wF", "wp", "Sd", "Sl", "to", "pm",
"/m", "zos", "zfd", "zfs", "zfz", "cat", "wta", "wtf", "wxf", "dml", "vi",
"less", "head", "Ps", "Pl", NULL
};

View file

@ -56,7 +56,7 @@ static void crc_final(RZ_CRC_CTX *ctx, utcrc *r) {
#define CRC_PRESET(crc, size, reflect, poly, xout) \
{ UTCRC_C(crc), (size), (reflect), UTCRC_C(poly), UTCRC_C(xout) }
/* NOTE: Run `rz_hash -a <algo> -s 123456789` to test CRC. */
/* NOTE: Run `rz-hash -a <algo> -s 123456789` to test CRC. */
RZ_CRC_CTX crc_presets[] = {
CRC_PRESET(0x00, 8, 0, 0x07, 0x00), //CRC-8-SMBUS, test vector for "1234567892: f4
#if RZ_HAVE_CRC8_EXTRA

View file

@ -269,12 +269,12 @@ static RzRunProfile *_get_run_profile(RzIO *io, int bits, char **argv) {
rz_run_free(rp);
return NULL;
}
if (strstr(io->runprofile, RZ_SYS_DIR ".rz_run.")) {
if (strstr(io->runprofile, RZ_SYS_DIR ".rz-run.")) {
(void)rz_file_rm(io->runprofile);
}
} else if (io->envprofile) {
if (!rz_run_parse(rp, io->envprofile)) {
eprintf("Can't parse default rz_run profile\n");
eprintf("Can't parse default rz-run profile\n");
rz_run_free(rp);
return NULL;
}

View file

@ -139,7 +139,7 @@ static int __close(RzIODesc *fd) {
return -1;
}
// XXX
rz_sys_cmdf("pkill rz_run");
rz_sys_cmdf("pkill rz-run");
return 0;
}

View file

@ -1,7 +1,7 @@
static const char *page_index =
"<html>"
"<head>"
"<title>rz_agent</title>"
"<title>rz-agent</title>"
"<script>"
"function file_open() {"
" var file = window.prompt ('path to file?');"
@ -10,7 +10,7 @@ static const char *page_index =
"</script>"
"</head>"
"<body>"
" <h2>rz_agent</h2>"
" <h2>rz-agent</h2>"
" <hr size=1 />"
"File<br />"
" - <a href='javascript:file_open()'>open</a><br />"

View file

@ -124,11 +124,11 @@ static int main_help(int line) {
" -qq quit after running all -c and -i\n"
" -Q quiet mode (no prompt) and quit faster (quickLeak=true)\n"
" -p [p.rzdb] load project file\n"
" -r [rz_run] specify rz_run profile to load (same as -e dbg.profile=X)\n"
" -R [rrz_testule] specify custom rz_run directive\n"
" -r [rz-run] specify rz-run profile to load (same as -e dbg.profile=X)\n"
" -R [rrz_testule] specify custom rz-run directive\n"
" -s [addr] initial seek\n"
#if USE_THREADS && ALLOW_THREADED
" -t load rz_bin info in thread\n"
" -t load rz-bin info in thread\n"
#endif
" -T do not compute file hashes\n"
" -u set bin.filter=false to get raw sym/sec/cls names\n"
@ -384,7 +384,7 @@ RZ_API int rz_main_rizin(int argc, const char **argv) {
#endif
rz_sys_env_init();
// Create rz_run profile with startup environ
// Create rz-run profile with startup environ
char **env = rz_sys_get_environ();
char *envprofile = rz_run_get_environ_profile(env);
@ -590,7 +590,7 @@ RZ_API int rz_main_rizin(int argc, const char **argv) {
break;
case 'r':
if (RZ_STR_ISEMPTY(opt.arg)) {
eprintf("Cannot open empty rz_run profile path\n");
eprintf("Cannot open empty rz-run profile path\n");
ret = 1;
goto beach;
}
@ -731,7 +731,7 @@ RZ_API int rz_main_rizin(int argc, const char **argv) {
pfile = rz_acp_to_utf8(pfile);
#endif // __WINDOWS__
if (customRarunProfile) {
char *tfn = rz_file_temp(".rz_run");
char *tfn = rz_file_temp(".rz-run");
if (!rz_file_dump(tfn, (const ut8 *)customRarunProfile, strlen(customRarunProfile), 0)) {
eprintf("Cannot create %s\n", tfn);
} else {

View file

@ -27,7 +27,7 @@ static int usage(int v) {
}
static int showversion(void) {
return rz_main_version_print("rz_agent");
return rz_main_version_print("rz-agent");
}
RZ_API int rz_main_rz_agent(int argc, const char **argv) {

View file

@ -296,7 +296,7 @@ static int rasm_show_help(int v) {
" -l [len] Input/Output length\n"
" -L List Asm plugins: (a=asm, d=disasm, A=analyze, e=ESIL)\n"
" -o,-@ [addr] Set start address for code (default 0)\n"
" -O [file] Output file name (rz_asm -Bf a.asm -O a)\n"
" -O [file] Output file name (rz-asm -Bf a.asm -O a)\n"
" -p Run SPP over input for assembly\n"
" -q quiet mode\n"
" -r output in rizin commands\n"
@ -308,8 +308,8 @@ static int rasm_show_help(int v) {
" If the last argument is '-' reads from stdin\n");
printf("Environment:\n"
" RZ_ASM_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_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"
"");
}
@ -672,7 +672,7 @@ RZ_API int rz_main_rz_asm(int argc, const char *argv[]) {
if (as->quiet) {
printf("%s\n", RZ_VERSION);
} else {
ret = rz_main_version_print("rz_asm");
ret = rz_main_version_print("rz-asm");
}
goto beach;
case 'w':
@ -694,19 +694,19 @@ RZ_API int rz_main_rz_asm(int argc, const char *argv[]) {
if (arch) {
if (!rz_asm_use(as->a, arch)) {
eprintf("rz_asm: Unknown asm plugin '%s'\n", arch);
eprintf("rz-asm: Unknown asm plugin '%s'\n", arch);
ret = 0;
goto beach;
}
rz_analysis_use(as->analysis, arch);
} else if (env_arch) {
if (!rz_asm_use(as->a, env_arch)) {
eprintf("rz_asm: Unknown asm plugin '%s'\n", env_arch);
eprintf("rz-asm: Unknown asm plugin '%s'\n", env_arch);
ret = 0;
goto beach;
}
} else if (!rz_asm_use(as->a, "x86")) {
eprintf("rz_asm: Cannot find asm.x86 plugin\n");
eprintf("rz-asm: Cannot find asm.x86 plugin\n");
ret = 0;
goto beach;
}
@ -782,7 +782,7 @@ RZ_API int rz_main_rz_asm(int argc, const char *argv[]) {
content = rz_file_slurp(file, &length);
if (content) {
if (length > ST32_MAX) {
eprintf("rz_asm: File %s is too big\n", file);
eprintf("rz-asm: File %s is too big\n", file);
ret = 1;
} else {
if (len && len > 0 && len < length) {
@ -808,7 +808,7 @@ RZ_API int rz_main_rz_asm(int argc, const char *argv[]) {
}
free(content);
} else {
eprintf("rz_asm: Cannot open file %s\n", file);
eprintf("rz-asm: Cannot open file %s\n", file);
ret = 1;
}
}

View file

@ -110,52 +110,52 @@ static void print_ascii_table(void) {
static int help(void) {
printf(
" =[base] ; rz_ax =10 0x46 -> output in base 10\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"
" 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"
" -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"
" -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 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"
" -K randomart ; rz_ax -K 0x34 1020304050\n"
" -L bin -> hex(bignum) ; rz_ax -L 111111111 # 0x1ff\n"
" -n binary number ; 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 tstamp -> str ; rz_ax -t 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");
" -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 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"
" -K randomart ; rz-ax -K 0x34 1020304050\n"
" -L bin -> hex(bignum) ; rz-ax -L 111111111 # 0x1ff\n"
" -n binary number ; 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 tstamp -> str ; rz-ax -t 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");
return true;
}
@ -212,7 +212,7 @@ static int rax(RNum *num, char *str, int len, int last, ut64 *_flags, int *fm) {
case 'i': flags ^= 1 << 21; break;
case 'o': flags ^= 1 << 22; break;
case 'I': flags ^= 1 << 23; break;
case 'v': return rz_main_version_print("rz_ax");
case 'v': return rz_main_version_print("rz-ax");
case '\0':
*_flags = flags;
return !use_stdin(num, _flags, fm);

View file

@ -797,7 +797,7 @@ RZ_API int rz_main_rz_bin(int argc, const char **argv) {
case 'r': rad = true; break;
case 'v':
rz_core_fini(&core);
return rz_main_version_print("rz_bin");
return rz_main_version_print("rz-bin");
case 'L':
set_action(RZ_BIN_REQ_LISTPLUGINS);
break;
@ -1070,7 +1070,7 @@ RZ_API int rz_main_rz_bin(int argc, const char **argv) {
//if this return false means that we did not return a valid bin object
//but we have yet the chance that this file is a fat binary
if (!bin->cur || !bin->cur->xtr_data) {
eprintf("rz_bin: Cannot open file\n");
eprintf("rz-bin: Cannot open file\n");
rz_core_file_free(fh);
rz_core_fini(&core);
return 1;

View file

@ -1060,7 +1060,7 @@ RZ_API int rz_main_rz_diff(int argc, const char **argv) {
ro.diffmode = 'U';
break;
case 'v':
return rz_main_version_print("rz_diff");
return rz_main_version_print("rz-diff");
case 'q':
ro.quiet = true;
break;
@ -1208,13 +1208,13 @@ RZ_API int rz_main_rz_diff(int argc, const char **argv) {
bufa = slurp(&ro, &c, ro.file, &fsz);
sza = fsz;
if (!bufa) {
eprintf("rz_diff: Cannot open %s\n", rz_str_get_null(ro.file));
eprintf("rz-diff: Cannot open %s\n", rz_str_get_null(ro.file));
return 1;
}
bufb = slurp(&ro, &c, ro.file2, &fsz);
szb = fsz;
if (!bufb) {
eprintf("rz_diff: Cannot open: %s\n", rz_str_get_null(ro.file2));
eprintf("rz-diff: Cannot open: %s\n", rz_str_get_null(ro.file2));
free(bufa);
return 1;
}

View file

@ -439,7 +439,7 @@ RZ_API int rz_main_rz_find(int argc, const char **argv) {
ro.quiet = true;
break;
case 'v':
return rz_main_version_print("rz_find");
return rz_main_version_print("rz-find");
case 'h':
return show_help(argv[0], 0);
case 'z':

View file

@ -308,7 +308,7 @@ RZ_API int rz_main_rz_gg(int argc, const char **argv) {
case 'v':
free(sequence);
rz_egg_free(egg);
return rz_main_version_print("rz_gg");
return rz_main_version_print("rz-gg");
case 'z':
show_str = 1;
break;

View file

@ -480,7 +480,7 @@ RZ_API int rz_main_rz_hash(int argc, const char **argv) {
case 'b': bsize = (int)rz_num_math(NULL, opt.arg); break;
case 'f': from = rz_num_math(NULL, opt.arg); break;
case 't': to = 1 + rz_num_math(NULL, opt.arg); break;
case 'v': return rz_main_version_print("rz_hash");
case 'v': return rz_main_version_print("rz-hash");
case 'h': return do_help(0);
case 's': setHashString(opt.arg, 0); break;
case 'x': setHashString(opt.arg, 1); break;

View file

@ -31,7 +31,7 @@ RZ_API int rz_main_rz_run(int argc, const char **argv) {
return 1;
}
if (!strcmp(argv[1], "-v")) {
return rz_main_version_print("rz_run");
return rz_main_version_print("rz-run");
}
const char *file = argv[1];
if (!strcmp(file, "-t")) {

View file

@ -15,7 +15,7 @@ static void rasign_show_help(void) {
" -s signspace save all signatures under this signspace\n"
" -v show version information\n"
"Examples:\n"
" rz_sign -o libc.sdb libc.so.6\n");
" rz-sign -o libc.sdb libc.so.6\n");
}
static RzCore *opencore(const char *fname) {
@ -94,7 +94,7 @@ RZ_API int rz_main_rz_sign(int argc, const char **argv) {
flirt = true;
break;
case 'v':
return rz_main_version_print("rz_sign");
return rz_main_version_print("rz-sign");
case 'h':
rasign_show_help();
return 0;

View file

@ -396,12 +396,12 @@ static int handle_redirection(const char *cmd, bool in, bool out, bool err) {
if (rz_sys_pipe(pipes, true) != -1) {
size_t cmdl = strlen(cmd) - 2;
if (write(pipes[1], cmd + 1, cmdl) != cmdl) {
eprintf("[ERROR] rz_run: Cannot write to the pipe\n");
eprintf("[ERROR] rz-run: Cannot write to the pipe\n");
close(0);
return 1;
}
if (write(pipes[1], "\n", 1) != 1) {
eprintf("[ERROR] rz_run: Cannot write to the pipe\n");
eprintf("[ERROR] rz-run: Cannot write to the pipe\n");
close(0);
return 1;
}
@ -410,7 +410,7 @@ static int handle_redirection(const char *cmd, bool in, bool out, bool err) {
rz_sys_pipe_close(pipes[0]);
rz_sys_pipe_close(pipes[1]);
} else {
eprintf("[ERROR] rz_run: Cannot create pipe\n");
eprintf("[ERROR] rz-run: Cannot create pipe\n");
}
}
#else
@ -436,7 +436,7 @@ static int handle_redirection(const char *cmd, bool in, bool out, bool err) {
#endif
f = open(cmd, flag, mode);
if (f < 0) {
eprintf("[ERROR] rz_run: Cannot open: %s\n", cmd);
eprintf("[ERROR] rz-run: Cannot open: %s\n", cmd);
return 1;
}
#define DUP(x) \
@ -627,7 +627,7 @@ RZ_API const char *rz_run_help(void) {
"# arg2=hello\n"
"# arg3=\"hello\\nworld\"\n"
"# arg4=:048490184058104849\n"
"# arg5=:!rz_gg -p n50 -d 10:0x8048123\n"
"# arg5=:!rz-gg -p n50 -d 10:0x8048123\n"
"# arg6=@arg.txt\n"
"# arg7=@300@ABCD # 300 chars filled with ABCD pattern\n"
"# system=rizin -\n"
@ -868,7 +868,7 @@ RZ_API int rz_run_config_env(RzRunProfile *p) {
RzSocket *child, *fd = rz_socket_new(0);
bool is_child = false;
if (!rz_socket_listen(fd, p->_listen, NULL)) {
eprintf("rz_run: cannot listen\n");
eprintf("rz-run: cannot listen\n");
rz_socket_free(fd);
return 1;
}
@ -880,7 +880,7 @@ RZ_API int rz_run_config_env(RzRunProfile *p) {
if (p->_dofork && !p->_dodebug) {
pid_t child_pid = rz_sys_fork();
if (child_pid == -1) {
eprintf("rz_run: cannot fork\n");
eprintf("rz-run: cannot fork\n");
rz_socket_free(child);
rz_socket_free(fd);
return 1;
@ -990,14 +990,14 @@ RZ_API int rz_run_config_env(RzRunProfile *p) {
close(0);
dup2(f2[0], 0);
} else {
eprintf("[ERROR] rz_run: Cannot create pipe\n");
eprintf("[ERROR] rz-run: Cannot create pipe\n");
return 1;
}
inp = getstr(p->_input);
if (inp) {
size_t inpl = strlen(inp);
if (write(f2[1], inp, inpl) != inpl) {
eprintf("[ERROR] rz_run: Cannot write to the pipe\n");
eprintf("[ERROR] rz-run: Cannot write to the pipe\n");
}
rz_sys_pipe_close(f2[1]);
free(inp);
@ -1014,7 +1014,7 @@ RZ_API int rz_run_config_env(RzRunProfile *p) {
}
if (p->_libpath) {
#if __WINDOWS__
eprintf("rz_run: libpath unsupported for this platform\n");
eprintf("rz-run: libpath unsupported for this platform\n");
#elif __HAIKU__
rz_sys_setenv("LIBRARY_PATH", p->_libpath);
#elif __APPLE__
@ -1185,7 +1185,7 @@ RZ_API int rz_run_start(RzRunProfile *p) {
p->_program = progpath;
} else {
free(progpath);
eprintf("rz_run: %s: file not found\n", p->_program);
eprintf("rz-run: %s: file not found\n", p->_program);
return 1;
}
}

View file

@ -211,7 +211,7 @@ RZ_API bool rz_socket_spawn(RzSocket *s, const char *cmd, unsigned int timeout)
int childPid = rz_sys_fork();
if (childPid == 0) {
char *a = rz_str_replace(strdup(cmd), "\\", "\\\\", true);
int res = rz_sys_cmdf("rz_run system=\"%s\" listen=%d", a, port);
int res = rz_sys_cmdf("rz-run system=\"%s\" listen=%d", a, port);
free(a);
#if 0
// TODO: use the api
@ -224,7 +224,7 @@ RZ_API bool rz_socket_spawn(RzSocket *s, const char *cmd, unsigned int timeout)
free (profile);
#endif
if (res != 0) {
eprintf("rz_socket_spawn: rz_run failed\n");
eprintf("rz_socket_spawn: rz-run failed\n");
exit(1);
}
eprintf("rz_socket_spawn: %s is dead\n", cmd);

View file

@ -326,7 +326,7 @@ RZ_API int rz_lib_open_ptr(RzLib *lib, const char *file, void *handler, RzLibStr
int minor = dot ? atoi(dot + 1) : 0;
// The pkgname member was introduced in 4.2.0
if (major > 4 || (major == 4 && minor >= 2)) {
printf("rz_pm -ci %s\n", stru->pkgname);
printf("rz-pm -ci %s\n", stru->pkgname);
}
}
return -1;

View file

@ -4,13 +4,13 @@
.Nm RASIGN2
.Nd rizin zignature utility
.Sh SYNOPSIS
.Nm rz_sign
.Nm rz-sign
.Op Fl afhjqrv
.Op Fl s Ar space
.Op Fl o Ar outfile
.Ar file
.Sh DESCRIPTION
rz_diff implements many binary diffing algorithms for data and code.
rz-diff implements many binary diffing algorithms for data and code.
.Pp
.Bl -tag -width Fl
.It Fl a
@ -35,11 +35,11 @@ Show version information.
.Sh SEE ALSO
.Pp
.Xr rizin(1) ,
.Xr rz_find(1) ,
.Xr rz_hash(1) ,
.Xr rz_bin(1) ,
.Xr rz_asm(1) ,
.Xr rz_gg(1) ,
.Xr rz_run(1) ,
.Xr rz_ax(1) ,
.Xr rz_diff(1) ,
.Xr rz-find(1) ,
.Xr rz-hash(1) ,
.Xr rz-bin(1) ,
.Xr rz-asm(1) ,
.Xr rz-gg(1) ,
.Xr rz-run(1) ,
.Xr rz-ax(1) ,
.Xr rz-diff(1) ,

View file

@ -622,7 +622,8 @@ if cli_enabled
'man/rz-run.1',
'man/rz-asm.1',
'man/rz-ax.1',
'man/rz-esil.7'
'man/rz-sign.1',
'man/rz-esil.7',
)
install_data('doc/hud',

View file

@ -38,4 +38,4 @@ option('debugger', type: 'boolean', value: true)
option('use_webui', type: 'boolean', value: false, description: 'Install different WebUIs for rizin')
option('enable_tests', type: 'boolean', value: true, description: 'Build unit tests in test/unit')
option('enable_rz_test', type: 'boolean', value: true, description: 'Build rz_test executable for regression testing')
option('enable_rz_test', type: 'boolean', value: true, description: 'Build rz-test executable for regression testing')

View file

@ -167,7 +167,7 @@ Interpret r2 commands
.. myfile
. myfile.r2
.* file
.!rz_bin -ri $FILE
.!rz-bin -ri $FILE
.(foo 1 2 3)
./ ELF
pd 10 |.

View file

@ -42,7 +42,7 @@ MARKER_META_REGISTER = "_MREG_"
MARKER_WIDTH_MARKER = "_WIDTH_"
MARKER_SEGREG_MARKER = "_SEGREG_"
CONCURRENCY = 8
ASM_ENGINE = "x86.nz" # See rz_asm -L. Note this script is not x86-specific
ASM_ENGINE = "x86.nz" # See rz-asm -L. Note this script is not x86-specific
DISASM_ENGINE = "x86" # capstone
REFERENCE_ASM_ENGINE = "x86.ks"
REFERENCE_DISASM_ENGINE = None # no alternative right now

View file

@ -1,4 +1,4 @@
#!/usr/bin/rz_gg -FO
#!/usr/bin/rz-gg -FO
goto(main);
exit@syscall(1);

View file

@ -1,12 +1,12 @@
#INCDIR@alias(i/);
/*
TODO: we need rz_gg to setup OS ARCH BITS environs
TODO: we need rz-gg to setup OS ARCH BITS environs
use environment to set/get values
OS@env(osx);
syscalls.r@include($OS);
use rz_gg -I to add new include path
use rz-gg -I to add new include path
*/
#INCDIR@env(/usr/include/r_egg);

View file

@ -1,4 +1,4 @@
#!/usr/bin/rz_gg -X
#!/usr/bin/rz-gg -X
main();
// OSX syscall definitions