Allow rizin tools to run as standalone binaries (#6011)

* Implement TOOL/ENVS/EXIT_STATUS for rz-test

* update readme
This commit is contained in:
Giovanni 2026-03-12 00:24:23 +08:00 committed by GitHub
parent 690daa2f54
commit 70fdd67278
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 2215 additions and 1797 deletions

View file

@ -102,6 +102,43 @@ static char *read_string_val(char **nextline, const char *val, ut64 *linenum) {
return strdup(val);
}
static const char *rz_test_tools[] = {
"rizin",
"rz-asm",
"rz-ax",
"rz-bin",
"rz-diff",
"rz-find",
"rz-gg",
"rz-hash",
"rz-run",
"rz-sign",
"rz-test",
};
RZ_API void rz_test_load_valid_tools(RZ_OUT RZ_NONNULL const char ***tools_o, RZ_OUT RZ_NONNULL size_t *size_o) {
rz_return_if_fail(tools_o && size_o);
*tools_o = rz_test_tools;
*size_o = RZ_ARRAY_SIZE(rz_test_tools);
}
static bool is_valid_tool(const char *tool) {
// we always whitelist the tools to avoid malware execution.
if (RZ_STR_ISEMPTY(tool)) {
// rz-test will run rizin or rz-asm
return true;
}
for (size_t i = 0; i < RZ_ARRAY_SIZE(rz_test_tools); ++i) {
if (RZ_STR_EQ(tool, rz_test_tools[i])) {
return true;
}
}
return false;
}
RZ_API RzPVector /*<RzCmdTest *>*/ *rz_test_load_cmd_test_file(const char *file) {
char *contents = rz_file_slurp(file, NULL);
if (!contents) {
@ -147,8 +184,14 @@ RZ_API RzPVector /*<RzCmdTest *>*/ *rz_test_load_cmd_test_file(const char *file)
// RUN is the only cmd without value
if (strcmp(line, "RUN") == 0) {
test->run_line = linenum;
if (!test->cmds.value) {
eprintf(LINEFMT "Error: Test without CMDS key\n", file, linenum);
if (RZ_STR_ISEMPTY(test->tool.value) && !test->cmds.value) {
eprintf(LINEFMT "Error: Rizin test without CMDS key\n", file, linenum);
goto fail;
} else if (RZ_STR_ISNOTEMPTY(test->tool.value) && !test->args.value) {
eprintf(LINEFMT "Error: Custom test without ARGS key\n", file, linenum);
goto fail;
} else if (!is_valid_tool(test->tool.value)) {
eprintf(LINEFMT "Error: TOOL key is set to '%s': this is not a valid rizin tool\n", file, linenum, test->tool.value);
goto fail;
}
if (!(test->expect.value || test->expect_err.value)) {

View file

@ -48,6 +48,9 @@ static RzSubprocessOutput *subprocess_runner(const char *file, const char *args[
#if __WINDOWS__
static char *convert_win_cmds(const char *cmds) {
if (RZ_STR_ISEMPTY(cmds)) {
return NULL;
}
char *r = malloc(strlen(cmds) + 1);
if (!r) {
return NULL;
@ -112,51 +115,159 @@ static char *convert_win_cmds(const char *cmds) {
}
#endif
static RzSubprocessOutput *run_rz_test(RzTestRunConfig *config, ut64 timeout_ms, const char *cmds, RzList /*<char *>*/ *files, RzList /*<char *>*/ *extra_args, bool load_plugins, RzTestCmdRunner runner, void *user) {
RzPVector args;
rz_pvector_init(&args, NULL);
rz_pvector_push(&args, "-escr.utf8=0");
rz_pvector_push(&args, "-escr.color=0");
rz_pvector_push(&args, "-escr.interactive=0");
rz_pvector_push(&args, "-eflirt.sigdb.load.system=false");
rz_pvector_push(&args, "-esearch.show_progress=false");
rz_pvector_push(&args, "-eflirt.sigdb.load.home=false");
rz_pvector_push(&args, "-N");
RzListIter *it;
void *extra_arg, *file_arg;
rz_list_foreach (extra_args, it, extra_arg) {
rz_pvector_push(&args, extra_arg);
typedef struct run_rz_test_s {
RzTestRunConfig *config; ///< Global configuration
ut64 timeout_ms; ///< Test timeout in millisec
const char *bin_path; ///< Path of the bin directory (can be null)
const char *tool; ///< When set executes a different tool rather than the default exe
const char *cmds; ///< Rizin command line passed as value of `-c` (-q will be added unless TOOL= is defined)
RzList /*<char *>*/ *envs; ///< Additional environment variables
RzList /*<char *>*/ *files; ///< Additional files or tool inputs
RzList /*<char *>*/ *extra_args; ///< Additional arguments
bool load_plugins; ///< When true, allows to load external plugins (RZ_NOPLUGINS=0)
bool color; ///< When true sets RZ_COLOR=1, otherwise RZ_COLOR=0 (default)
bool utf8; ///< When true sets RZ_UTF8=1, otherwise RZ_UTF8=0 (default)
RzTestCmdRunner runner; ///< Function to call to execute the test
void *user; ///< Additional user data passed to `runner`.
} RunRzTest;
static inline bool run_rz_test_is_custom(const RunRzTest *rrt) {
return RZ_STR_ISNOTEMPTY(rrt->tool);
}
static void run_rz_test_add_args_from_list(RzPVector /*<const char *>*/ *args, RzList /*<char *>*/ *list) {
RzListIter *it = NULL;
char *arg = NULL;
rz_list_foreach (list, it, arg) {
if (RZ_STR_ISEMPTY(arg)) {
continue;
}
rz_pvector_push(args, arg);
}
rz_pvector_push(&args, "-qc");
#if __WINDOWS__
char *wcmds = convert_win_cmds(cmds);
rz_pvector_push(&args, wcmds);
#else
rz_pvector_push(&args, (void *)cmds);
#endif
rz_list_foreach (files, it, file_arg) {
rz_pvector_push(&args, file_arg);
}
static void run_rz_test_init_args(const RunRzTest *rrt, const char *rizin_cmd, RzPVector /*<const char *>*/ *args) {
rz_pvector_init(args, NULL);
if (run_rz_test_is_custom(rrt)) {
// the test runs with custom args and may exec a different tool.
run_rz_test_add_args_from_list(args, rrt->extra_args);
if (rizin_cmd) {
rz_pvector_push(args, "-c");
rz_pvector_push(args, (void *)rizin_cmd);
}
run_rz_test_add_args_from_list(args, rrt->files);
return;
}
const char *envvars[] = {
// the test runs in a normal rizin test environment.
rz_pvector_push(args, "-escr.utf8=0");
rz_pvector_push(args, "-escr.color=0");
rz_pvector_push(args, "-escr.interactive=0");
rz_pvector_push(args, "-eflirt.sigdb.load.system=false");
rz_pvector_push(args, "-esearch.show_progress=false");
rz_pvector_push(args, "-eflirt.sigdb.load.home=false");
rz_pvector_push(args, "-N");
run_rz_test_add_args_from_list(args, rrt->extra_args);
rz_pvector_push(args, "-qc");
rz_pvector_push(args, (void *)rizin_cmd);
run_rz_test_add_args_from_list(args, rrt->files);
}
static void run_rz_test_init_envs(const RunRzTest *rrt, const char ***envvars_o, const char ***envvals_o, size_t *env_size_o) {
RzListIter *it = NULL;
char *env = NULL;
size_t env_size = 0;
const size_t reserve = 4 + rz_list_length(rrt->envs);
const char **envvars = RZ_NEWS0(const char *, reserve);
const char **envvals = RZ_NEWS0(const char *, reserve);
#define RUN_RZ_TEST_ENV_SET(k, v) \
do { \
envvars[env_size] = k; \
envvals[env_size] = v; \
env_size++; \
} while (0)
#if __WINDOWS__
"ANSICON",
RUN_RZ_TEST_ENV_SET("ANSICON", "1");
#endif
"RZ_NOPLUGINS"
};
const char *envvals[] = {
RUN_RZ_TEST_ENV_SET("RZ_COLOR", rrt->color ? "1" : "0");
RUN_RZ_TEST_ENV_SET("RZ_UTF8", rrt->utf8 ? "1" : "0");
if (!rrt->load_plugins) {
RUN_RZ_TEST_ENV_SET("RZ_NOPLUGINS", "1");
}
rz_list_foreach (rrt->envs, it, env) {
if (RZ_STR_ISEMPTY(env)) {
continue;
}
const char *key = env;
char *value = strchr(env, '=');
if (value) {
*value = 0;
RUN_RZ_TEST_ENV_SET(key, value + 1);
} else {
RUN_RZ_TEST_ENV_SET(key, "");
}
}
#undef RUN_RZ_TEST_ENV_SET
*envvars_o = envvars;
*envvals_o = envvals;
*env_size_o = env_size;
}
RZ_API RZ_OWN char *rz_test_find_executable(RZ_NULLABLE const char *exec, RZ_NULLABLE const char *bin_path) {
if (RZ_STR_ISEMPTY(exec)) {
return NULL;
} else if (RZ_STR_ISEMPTY(bin_path)) {
return rz_file_path(exec);
}
#if __WINDOWS__
"1",
#endif
"1"
};
#if __WINDOWS__
size_t env_size = load_plugins ? 1 : 2;
char *exe_path = rz_str_newf(RZ_JOIN_2_PATHS("%s", "%s.exe"), bin_path, exec);
#else
size_t env_size = load_plugins ? 0 : 1;
char *exe_path = rz_str_newf(RZ_JOIN_2_PATHS("%s", "%s"), bin_path, exec);
#endif
RzSubprocessOutput *out = runner(config->rz_cmd, args.v.a, rz_pvector_len(&args), envvars, envvals, env_size, timeout_ms, user);
if (rz_file_exists(exe_path)) {
return exe_path;
}
free(exe_path);
return rz_str_dup(exec);
}
static char *run_rz_test_find_executable(const RunRzTest *rrt, const char *default_exe) {
const char *exec = default_exe;
if (RZ_STR_ISNOTEMPTY(rrt->tool)) {
exec = rrt->tool;
}
return rz_test_find_executable(exec, rrt->bin_path);
}
static RzSubprocessOutput *run_rz_test(const RunRzTest *rrt, const char *default_exe) {
const char **envvars = NULL;
const char **envvals = NULL;
size_t env_size = 0;
RzPVector args;
#if __WINDOWS__
char *wcmds = convert_win_cmds(rrt->cmds);
run_rz_test_init_args(rrt, wcmds, &args);
#else
run_rz_test_init_args(rrt, rrt->cmds, &args);
#endif
run_rz_test_init_envs(rrt, &envvars, &envvals, &env_size);
char *executable = run_rz_test_find_executable(rrt, default_exe);
RzSubprocessOutput *out = rrt->runner(executable, args.v.a, rz_pvector_len(&args), envvars, envvals, env_size, rrt->timeout_ms, rrt->user);
rz_pvector_clear(&args);
free(executable);
#if __WINDOWS__
free(wcmds);
#endif
@ -166,6 +277,7 @@ static RzSubprocessOutput *run_rz_test(RzTestRunConfig *config, ut64 timeout_ms,
RZ_API RzSubprocessOutput *rz_test_run_cmd_test(RzTestRunConfig *config, RzCmdTest *test, RzTestCmdRunner runner, void *user) {
RzList *extra_args = test->args.value ? rz_str_split_duplist(test->args.value, " ", true) : NULL;
RzList *files = test->file.value ? rz_str_split_duplist(test->file.value, "\n", true) : NULL;
RzList *envs = test->envs.value ? rz_str_split_duplist(test->envs.value, "\n", true) : NULL;
RzListIter *it;
RzListIter *tmpit;
char *token;
@ -179,7 +291,7 @@ RZ_API RzSubprocessOutput *rz_test_run_cmd_test(RzTestRunConfig *config, RzCmdTe
rz_list_delete(files, it);
}
}
if (rz_list_empty(files)) {
if (rz_list_empty(files) && RZ_STR_ISEMPTY(test->tool.value)) {
if (!files) {
files = rz_list_new();
} else {
@ -188,9 +300,27 @@ RZ_API RzSubprocessOutput *rz_test_run_cmd_test(RzTestRunConfig *config, RzCmdTe
rz_list_push(files, "=");
}
ut64 timeout_ms = test->timeout.set ? test->timeout.value * 1000 : config->timeout_ms;
RzSubprocessOutput *out = run_rz_test(config, timeout_ms, test->cmds.value, files, extra_args, test->load_plugins, runner, user);
RunRzTest normal_rrt = {
.config = config,
.timeout_ms = timeout_ms,
.bin_path = config->bin_path,
.tool = test->tool.value,
.cmds = test->cmds.value,
.envs = envs,
.files = files,
.extra_args = extra_args,
.load_plugins = test->load_plugins,
.color = test->color.value,
.utf8 = test->utf8.value,
.runner = runner,
.user = user,
};
RzSubprocessOutput *out = run_rz_test(&normal_rrt, "rizin");
rz_list_free(extra_args);
rz_list_free(files);
rz_list_free(envs);
return out;
}
@ -227,7 +357,7 @@ RZ_API bool rz_test_cmp_cmd_output(const char *output, const char *expect, const
}
RZ_API bool rz_test_check_cmd_test(RzSubprocessOutput *out, RzCmdTest *test) {
if (!out || out->ret != 0 || !out->out || !out->err || out->timeout) {
if (!out || out->ret != test->exit_status.value || !out->out || !out->err || out->timeout) {
return false;
}
const char *expect_out = test->expect.value;
@ -248,7 +378,8 @@ RZ_API bool rz_test_check_cmd_test(RzSubprocessOutput *out, RzCmdTest *test) {
RZ_API bool rz_test_check_jq_available(void) {
const char *args[] = { "." };
const char *invalid_json = "this is not json lol";
RzSubprocess *proc = rz_subprocess_start(JQ_CMD, args, 1, NULL, NULL, 0);
char *jq_path = rz_file_path(JQ_CMD);
RzSubprocess *proc = rz_subprocess_start(jq_path, args, 1, NULL, NULL, 0);
if (proc) {
rz_subprocess_stdin_write(proc, (const ut8 *)invalid_json, strlen(invalid_json));
rz_subprocess_wait(proc, UT64_MAX);
@ -257,21 +388,54 @@ RZ_API bool rz_test_check_jq_available(void) {
rz_subprocess_free(proc);
const char *valid_json = "{\"this is\":\"valid json\",\"lol\":true}";
proc = rz_subprocess_start(JQ_CMD, args, 1, NULL, NULL, 0);
proc = rz_subprocess_start(jq_path, args, 1, NULL, NULL, 0);
if (proc) {
rz_subprocess_stdin_write(proc, (const ut8 *)valid_json, strlen(valid_json));
rz_subprocess_wait(proc, UT64_MAX);
}
bool valid_detected = proc && rz_subprocess_ret(proc) == 0;
rz_subprocess_free(proc);
free(jq_path);
return invalid_detected && valid_detected;
}
RZ_API bool rz_test_check_tool_available(RZ_NULLABLE const char *exec) {
if (RZ_STR_ISEMPTY(exec)) {
return false;
}
const char *args[] = { "-v" };
RzSubprocess *proc = rz_subprocess_start(exec, args, 1, NULL, NULL, 0);
if (!proc) {
return false;
}
rz_subprocess_wait(proc, UT64_MAX);
bool return_zero = rz_subprocess_ret(proc) == 0;
rz_subprocess_free(proc);
return return_zero;
}
RZ_API RzSubprocessOutput *rz_test_run_json_test(RzTestRunConfig *config, RzJsonTest *test, RzTestCmdRunner runner, void *user) {
RzList *files = rz_list_new();
rz_list_push(files, (void *)config->json_test_file);
RzSubprocessOutput *ret = run_rz_test(config, config->timeout_ms, test->cmd, files, NULL, test->load_plugins, runner, user);
RunRzTest json_rrt = {
.config = config,
.timeout_ms = config->timeout_ms,
.bin_path = config->bin_path,
.tool = NULL,
.cmds = test->cmd,
.files = files,
.extra_args = NULL,
.load_plugins = test->load_plugins,
.color = false,
.utf8 = false,
.runner = runner,
.user = user,
};
RzSubprocessOutput *ret = run_rz_test(&json_rrt, "rizin");
rz_list_free(files);
return ret;
}
@ -281,11 +445,13 @@ RZ_API bool rz_test_check_json_test(RzSubprocessOutput *out, RzJsonTest *test) {
return false;
}
const char *args[] = { "." };
RzSubprocess *proc = rz_subprocess_start(JQ_CMD, args, 1, NULL, NULL, 0);
char *jq_path = rz_file_path(JQ_CMD);
RzSubprocess *proc = rz_subprocess_start(jq_path, args, 1, NULL, NULL, 0);
rz_subprocess_stdin_write(proc, (const ut8 *)out->out, strlen((char *)out->out));
rz_subprocess_wait(proc, UT64_MAX);
bool ret = rz_subprocess_ret(proc) == 0;
rz_subprocess_free(proc);
free(jq_path);
return ret;
}
@ -295,6 +461,7 @@ RZ_API RzAsmTestOutput *rz_test_run_asm_test(RzTestRunConfig *config, RzAsmTest
return NULL;
}
out->as_ret = out->disas_ret = out->il_ret = INT_MAX;
char *rz_asm_exe = rz_file_path("rz-asm");
RzPVector args;
rz_pvector_init(&args, NULL);
@ -329,7 +496,7 @@ RZ_API RzAsmTestOutput *rz_test_run_asm_test(RzTestRunConfig *config, RzAsmTest
if (test->mode & RZ_ASM_TEST_MODE_ASSEMBLE) {
rz_pvector_push(&args, test->disasm);
RzSubprocess *proc = rz_subprocess_start(config->rz_asm_cmd, args.v.a, rz_pvector_len(&args), NULL, NULL, 0);
RzSubprocess *proc = rz_subprocess_start(rz_asm_exe, args.v.a, rz_pvector_len(&args), NULL, NULL, 0);
if (rz_subprocess_wait(proc, config->timeout_ms) == RZ_SUBPROCESS_TIMEDOUT) {
rz_subprocess_kill(proc);
out->as_timeout = true;
@ -367,7 +534,7 @@ RZ_API RzAsmTestOutput *rz_test_run_asm_test(RzTestRunConfig *config, RzAsmTest
}
rz_pvector_push(&args, "-d");
rz_pvector_push(&args, hex);
RzSubprocess *proc = rz_subprocess_start(config->rz_asm_cmd, args.v.a, rz_pvector_len(&args), NULL, NULL, 0);
RzSubprocess *proc = rz_subprocess_start(rz_asm_exe, args.v.a, rz_pvector_len(&args), NULL, NULL, 0);
if (rz_subprocess_wait(proc, config->timeout_ms) == RZ_SUBPROCESS_TIMEDOUT) {
rz_subprocess_kill(proc);
out->disas_timeout = true;
@ -397,7 +564,7 @@ RZ_API RzAsmTestOutput *rz_test_run_asm_test(RzTestRunConfig *config, RzAsmTest
}
rz_pvector_push(&args, "-I");
rz_pvector_push(&args, hex);
RzSubprocess *proc = rz_subprocess_start(config->rz_asm_cmd, args.v.a, rz_pvector_len(&args), NULL, NULL, 0);
RzSubprocess *proc = rz_subprocess_start(rz_asm_exe, args.v.a, rz_pvector_len(&args), NULL, NULL, 0);
if (rz_subprocess_wait(proc, config->timeout_ms) == RZ_SUBPROCESS_TIMEDOUT) {
rz_subprocess_kill(proc);
out->il_timeout = true;
@ -419,6 +586,7 @@ RZ_API RzAsmTestOutput *rz_test_run_asm_test(RzTestRunConfig *config, RzAsmTest
}
beach:
free(rz_asm_exe);
rz_pvector_clear(&args);
return out;
}
@ -478,7 +646,23 @@ RZ_API RzSubprocessOutput *rz_test_run_fuzz_test(RzTestRunConfig *config, RzFuzz
cmd = "?F";
}
#endif
RzSubprocessOutput *ret = run_rz_test(config, config->timeout_ms, cmd, files, NULL, false, runner, user);
RunRzTest fuzzer_rrt = {
.config = config,
.timeout_ms = config->timeout_ms,
.bin_path = config->bin_path,
.tool = NULL,
.cmds = cmd,
.files = files,
.extra_args = NULL,
.load_plugins = false,
.color = false,
.utf8 = false,
.runner = runner,
.user = user,
};
RzSubprocessOutput *ret = run_rz_test(&fuzzer_rrt, "rizin");
rz_list_free(files);
return ret;
}

View file

@ -80,8 +80,7 @@ static int help(bool verbose) {
"-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 " WORKERS_DEFAULT_STR ")",
"-r", "rizin", "Path to rizin executable (default is " RIZIN_CMD_DEFAULT ")",
"-m", "rz-asm", "Path to rz-asm executable (default is " RZ_ASM_CMD_DEFAULT ")",
"-r", "bindir", "Path to rizin bin folder (default is $PATH)",
"-f", "file", "File to use for JSON tests (default is " JSON_TEST_FILE_DEFAULT ")",
"-C", "dir", "Chdir before running rz-test (default follows test pathname/cwd)",
"-t", "seconds", "Timeout per test (default is " TIMEOUT_DEFAULT_STR " seconds)",
@ -160,6 +159,30 @@ static bool rz_test_chdir_fromtest(const char *test_path) {
return found;
}
static bool rz_test_can_find_rizin(const char *bin_path) {
char *exec = NULL;
const char **tools = NULL;
size_t count = 0;
rz_test_load_valid_tools(&tools, &count);
for (size_t i = 0; i < count; ++i) {
exec = rz_test_find_executable(tools[i], bin_path);
if (RZ_STR_ISEMPTY(exec)) {
eprintf("Cannot find %s in bin path: %s\n", tools[i], bin_path ? bin_path : "$PATH");
free(exec);
return false;
} else if (!rz_test_check_tool_available(exec)) {
eprintf("%s is not a valid executable\n", exec);
free(exec);
return false;
}
free(exec);
}
return true;
}
static bool log_mode = false;
int rz_test_main(int argc, const char **argv) {
@ -170,8 +193,7 @@ int rz_test_main(int argc, const char **argv) {
bool quiet = false;
bool interactive = false;
bool accept = false;
char *rizin_cmd = NULL;
char *rz_asm_cmd = NULL;
char *bin_path = NULL;
char *json_test_file = NULL;
char *output_file = NULL;
char *fuzz_dir = NULL;
@ -261,8 +283,7 @@ int rz_test_main(int argc, const char **argv) {
}
break;
case 'r':
free(rizin_cmd);
rizin_cmd = strdup(opt.arg);
bin_path = rz_file_abspath(opt.arg);
break;
case 'C':
rz_test_dir = opt.arg;
@ -270,10 +291,6 @@ int rz_test_main(int argc, const char **argv) {
case 'n':
nothing = true;
break;
case 'm':
free(rz_asm_cmd);
rz_asm_cmd = strdup(opt.arg);
break;
case 'f':
free(json_test_file);
json_test_file = strdup(opt.arg);
@ -339,17 +356,16 @@ int rz_test_main(int argc, const char **argv) {
}
atexit(rz_subprocess_fini);
// this must be done after initializing rz_subprocess
if (!rz_test_can_find_rizin(bin_path)) {
ret = -1;
goto beach;
}
rz_sys_setenv("TZ", "UTC");
ut64 time_start = rz_time_now_mono();
// Avoid PATH search for each process launched
if (!rizin_cmd) {
rizin_cmd = rz_file_path(RIZIN_CMD_DEFAULT);
}
if (!rz_asm_cmd) {
rz_asm_cmd = rz_file_path(RZ_ASM_CMD_DEFAULT);
}
state.run_config.rz_cmd = rizin_cmd;
state.run_config.rz_asm_cmd = rz_asm_cmd;
state.run_config.bin_path = bin_path;
state.run_config.json_test_file = json_test_file ? json_test_file : JSON_TEST_FILE_DEFAULT;
state.run_config.timeout_ms = timeout_sec > UT64_MAX / 1000 ? UT64_MAX : timeout_sec * 1000;
state.verbose = verbose;
@ -599,9 +615,8 @@ coast:
rz_test_test_database_free(state.db);
ht_sp_free(state.path_left);
beach:
free(bin_path);
free(output_file);
free(rizin_cmd);
free(rz_asm_cmd);
free(json_test_file);
free(fuzz_dir);
RZ_FREE(cwd);
@ -835,7 +850,7 @@ static void print_result_diff(RzTestRunConfig *config, RzTestResultInfo *result)
} else if (*err) {
printf("-- stderr\n%s\n", err);
}
if (result->proc_out->ret != 0) {
if (result->proc_out->ret != result->test->cmd_test->exit_status.value) {
printf("-- exit status: " Color_RED "%d" Color_RESET "\n", result->proc_out->ret);
}
break;
@ -1257,7 +1272,7 @@ static void replace_cmd_kv_file(const char *path, ut64 line_begin, ut64 line_end
static bool interact_fix_cmd(RzTestResultInfo *result, RzPVector /*<RzTestResultInfo *>*/ *fixup_results) {
assert(result->test->type == RZ_TEST_TYPE_CMD);
if (result->run_failed || result->proc_out->ret != 0) {
if (result->run_failed || result->proc_out->ret != result->test->cmd_test->exit_status.value) {
return false;
}
RzCmdTest *test = result->test->cmd_test;

View file

@ -62,6 +62,8 @@ typedef struct rz_test_cmd_test_t {
RzCmdTestStringRecord name;
RzCmdTestStringRecord file;
RzCmdTestStringRecord args;
RzCmdTestStringRecord tool;
RzCmdTestStringRecord envs;
RzCmdTestStringRecord source;
RzCmdTestStringRecord cmds;
RzCmdTestStringRecord expect;
@ -69,7 +71,10 @@ typedef struct rz_test_cmd_test_t {
RzCmdTestStringRecord regexp_out;
RzCmdTestStringRecord regexp_err;
RzCmdTestBoolRecord broken;
RzCmdTestBoolRecord color;
RzCmdTestBoolRecord utf8;
RzCmdTestNumRecord timeout;
RzCmdTestNumRecord exit_status;
ut64 run_line;
bool load_plugins;
} RzCmdTest;
@ -83,14 +88,19 @@ typedef struct rz_test_cmd_test_t {
macro_str ("NAME", name) \
macro_str ("FILE", file) \
macro_str ("ARGS", args) \
macro_str ("TOOL", tool) \
macro_str ("ENVS", envs) \
macro_int ("TIMEOUT", timeout) \
macro_int ("EXIT_STATUS", exit_status) \
macro_str ("SOURCE", source) \
macro_str ("CMDS", cmds) \
macro_str ("EXPECT", expect) \
macro_str ("EXPECT_ERR", expect_err) \
macro_str ("REGEXP_FILTER_OUT", regexp_out) \
macro_str ("REGEXP_FILTER_ERR", regexp_err) \
macro_bool ("BROKEN", broken)
macro_bool ("BROKEN", broken) \
macro_bool ("COLOR", color) \
macro_bool ("UTF8", utf8)
// clang-format on
typedef enum rz_test_asm_test_mode_t {
@ -148,8 +158,7 @@ typedef struct rz_test_test_database_t {
} RzTestDatabase;
typedef struct rz_test_run_config_t {
const char *rz_cmd;
const char *rz_asm_cmd;
const char *bin_path;
const char *json_test_file;
ut64 timeout_ms;
} RzTestRunConfig;
@ -229,4 +238,8 @@ RZ_API bool rz_test_test_broken(RzTest *test);
RZ_API RzTestResultInfo *rz_test_run_test(RzTestRunConfig *config, RzTest *test);
RZ_API void rz_test_test_result_info_free(RzTestResultInfo *result);
RZ_API void rz_test_load_valid_tools(RZ_OUT RZ_NONNULL const char ***tools_o, RZ_OUT RZ_NONNULL size_t *size_o);
RZ_API RZ_OWN char *rz_test_find_executable(RZ_NULLABLE const char *exec, RZ_NULLABLE const char *bin_path);
RZ_API bool rz_test_check_tool_available(RZ_NULLABLE const char *exec);
#endif // RIZIN_RZTEST_H

View file

@ -624,6 +624,7 @@ static RzPVector /*<RzBinResource *>*/ *pe_resources(RzBinFile *bf) {
goto err;
}
br->vaddr = PE_(rz_bin_pe_get_image_base)(obj) + rs->data->OffsetToData;
br->paddr = PE_(bin_pe_rva_to_paddr)(obj, rs->data->OffsetToData);
br->size = rs->data->Size;
br->type = rz_str_dup(rs->type);
if (!br->type) {

View file

@ -5186,11 +5186,12 @@ static void bin_resources_print_standard(RzCore *core, RzList /*<char *>*/ *hash
rz_cons_printf(" name: %s\n", resource->name);
rz_cons_printf(" timestamp: %s\n", resource->time);
rz_cons_printf(" vaddr: 0x%08" PFMT64x "\n", resource->vaddr);
rz_cons_printf(" paddr: 0x%08" PFMT64x "\n", resource->paddr);
rz_cons_printf(" size: %s\n", humansz);
rz_cons_printf(" type: %s\n", resource->type);
rz_cons_printf(" language: %s\n", resource->language);
if (hashes && resource->size > 0) {
HtSS *digests = rz_core_bin_create_digests(core, resource->vaddr, resource->size, hashes);
HtSS *digests = rz_core_bin_create_digests(core, resource->paddr, resource->size, hashes);
if (!digests) {
return;
}
@ -5208,10 +5209,10 @@ static void bin_resources_print_standard(RzCore *core, RzList /*<char *>*/ *hash
}
static void bin_resources_print_table(RzCore *core, RzCmdStateOutput *state, RzList /*<char *>*/ *hashes, RzBinResource *resource) {
rz_table_add_rowf(state->d.t, "dssXxss", resource->index, resource->name,
resource->type, resource->vaddr, resource->size, resource->language, resource->time);
rz_table_add_rowf(state->d.t, "dssXXxss", resource->index, resource->name,
resource->type, resource->vaddr, resource->paddr, resource->size, resource->language, resource->time);
if (hashes && resource->size > 0) {
HtSS *digests = rz_core_bin_create_digests(core, resource->vaddr, resource->size, hashes);
HtSS *digests = rz_core_bin_create_digests(core, resource->paddr, resource->size, hashes);
if (!digests) {
return;
}
@ -5234,11 +5235,12 @@ static void bin_resources_print_json(RzCore *core, RzCmdStateOutput *state, RzLi
pj_ki(state->d.pj, "index", resource->index);
pj_ks(state->d.pj, "type", resource->type);
pj_kn(state->d.pj, "vaddr", resource->vaddr);
pj_kn(state->d.pj, "paddr", resource->paddr);
pj_ki(state->d.pj, "size", resource->size);
pj_ks(state->d.pj, "lang", resource->language);
pj_ks(state->d.pj, "timestamp", resource->time);
if (hashes && resource->size > 0) {
HtSS *digests = rz_core_bin_create_digests(core, resource->vaddr, resource->size, hashes);
HtSS *digests = rz_core_bin_create_digests(core, resource->paddr, resource->size, hashes);
if (!digests) {
goto end;
}
@ -5264,7 +5266,7 @@ RZ_API bool rz_core_bin_resources_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBi
char *hashname = NULL;
rz_cmd_state_output_array_start(state);
rz_cmd_state_output_set_columnsf(state, "dssXxss", "index", "name", "type", "vaddr", "size", "lang", "timestamp");
rz_cmd_state_output_set_columnsf(state, "dssXXxss", "index", "name", "type", "vaddr", "paddr", "size", "lang", "timestamp");
rz_list_foreach (hashes, it, hashname) {
const RzHashPlugin *msg_plugin = rz_hash_plugin_by_name(core->hash, hashname);

View file

@ -851,6 +851,7 @@ typedef struct rz_bin_resource_t {
char *name;
char *time;
ut64 vaddr;
ut64 paddr;
ut64 size;
char *type;
char *language;

View file

@ -231,6 +231,8 @@ static int rzbin_show_help(int v) {
" 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_COLOR: # enables/disables colors support\n"
" RZ_UTF8: # enables/disables utf8 support\n"
" RZ_NOPLUGINS: # do not load plugins\n");
}
return 1;
@ -782,6 +784,14 @@ RZ_API int rz_main_rz_bin(int argc, const char **argv) {
rz_config_set(core.config, "pdb.server", tmp);
free(tmp);
}
if ((tmp = rz_sys_getenv("RZ_COLOR"))) {
rz_config_set(core.config, "scr.color", tmp);
free(tmp);
}
if ((tmp = rz_sys_getenv("RZ_UTF8"))) {
rz_config_set(core.config, "scr.utf8", tmp);
free(tmp);
}
#define is_active(x) (action & (x))
#define set_action(x) \
@ -1313,6 +1323,7 @@ RZ_API int rz_main_rz_bin(int argc, const char **argv) {
}
ut32 mask = actions2mask(action);
rz_core_bin_apply_config(&core, bf);
rz_core_bin_print(&core, bf, mask, &filter, &state, chksum_list);
run_action("classes source", RZ_BIN_REQ_CLASSES_SOURCES, classes_as_source_print);

View file

@ -205,17 +205,16 @@ static void rz_diff_show_help(bool usage_only) {
// clang-format off
"-a", "arch", "Specify architecture plugin to use (x86, arm, ..)",
"-b", "bits", "Specify register size for arch (16 (thumb), 32, 64, ..)",
"-d", "algo", "Compute edit distance based on the chosen algorithm:",
"", "", " myers | Eugene W. Myers' O(ND) algorithm (no substitution)",
"", "", " leven | Levenshtein O(N^2) algorithm (with substitution)",
"", "", " ssdeep | Context triggered piecewise hashing comparison",
"-d", "myers", "Compute edit distance using Eugene W. Myers' O(ND) algorithm (no substitution)",
"-d", "leven", "Compute edit distance using Levenshtein O(N^2) algorithm (with substitution)",
"-d", "ssdeep", "Compute edit distance using Context triggered piecewise hashing comparison",
"-i", "", "Use command line arguments instead of files (only for -d)",
"-H", "", "Hexadecimal visual mode",
"-h", "", "Show this help",
"-j", "", "JSON output",
"-q", "", "Quiet output",
"-V", "", "Show version information",
"-v", "", "Be more verbose (stderr output)",
"-v", "", "Show version information",
"-V", "", "Be more verbose (stderr output)",
"-K", "theme", "Set a give color theme (see rizin 'eco' command)",
"-e", "k=v", "Set an evaluable config variable",
"-A", "", "Compare virtual and physical addresses",
@ -226,32 +225,32 @@ static void rz_diff_show_help(bool usage_only) {
"-0", "cmd", "Input for file0 when option -t 'commands' is given.",
"", "", "The same value will be set for file1, if -1 is not set.",
"-1", "cmd", "Input for file1 when option -t 'commands' is given.",
"-t", "type", "Compute the difference between two files based on its type:",
"", "", " bytes | compare raw bytes in the files (only for small files)",
"", "", " lines | compare text files",
"", "", " functions | compare functions found in the files",
"", "", " | optional -0 <fcn name|offset> to compare only one function",
"", "", " classes | compare classes found in the files",
"", "", " command | compare command output returned when executed in both files",
"", "", " | require -0 <cmd> and -1 <cmd> is optional",
"", "", " entries | compare entries found in the files",
"", "", " fields | compare fields found in the files",
"", "", " graphs | compare 2 functions and outputs in graphviz/dot format",
"", "", " | require -0 <fcn name|offset> and -1 <fcn name|offset> is optional",
"", "", " imports | compare imports found in the files",
"", "", " libraries | compare libraries found in the files",
"", "", " sections | compare sections found in the files",
"", "", " strings | compare strings found in the files",
"", "", " symbols | compare symbols found in the files",
"-t", "bytes", "Compare raw bytes in the files (only for small files)",
"-t", "lines", "Compare text files",
"-t", "functions", "Compare functions found in the files",
"", "", "optional -0 <fcn name|offset> to compare only one function",
"-t", "classes", "Compare classes found in the files",
"-t", "command", "Compare command output returned when executed in both files",
"", "", "requires -0 <cmd> and -1 <cmd> is optional",
"-t", "entries", "Compare entries found in the files",
"-t", "fields", "Compare fields found in the files",
"-t", "graphs", "Compare 2 functions and outputs in graphviz/dot format",
"", "", "requires -0 <fcn name|offset> and -1 <fcn name|offset> is optional",
"-t", "imports", "Compare imports found in the files",
"-t", "libraries", "Compare libraries found in the files",
"-t", "sections", "Compare sections found in the files",
"-t", "strings", "Compare strings found in the files",
"-t", "symbols", "Compare symbols found in the files",
// clang-format on
};
rz_print_colored_help(options, RZ_ARRAY_SIZE(options), false);
printf(
"palette colors can be changed by adding the following lines\n"
"inside the $HOME/.rizinrc file\n"
"ec diff.unknown blue | offset color\n"
"ec diff.match green | match color\n"
"ec diff.unmatch red | mismatch color\n");
"Palette colors can be changed by adding the following lines inside the $HOME/.rizinrc file\n"
" ec diff.unknown blue | offset color\n"
" ec diff.match green | match color\n"
" ec diff.unmatch red | mismatch color\n"
"Environment variables\n"
" RZ_COLOR | enables/disables colors support\n");
}
static bool rz_diff_is_file(const char *file) {
@ -264,12 +263,22 @@ static bool rz_diff_is_file(const char *file) {
return true;
}
static bool diff_env_get_bool(const char *key, bool def_value) {
bool value = def_value;
char *tmp = rz_sys_getenv(key);
if (RZ_STR_ISNOTEMPTY(tmp)) {
value = rz_num_get(NULL, tmp) != 0;
}
free(tmp);
return value;
}
static void rz_diff_parse_arguments(int argc, const char **argv, DiffContext *ctx) {
const char *type = NULL;
const char *algorithm = NULL;
const char *screen = NULL;
memset((void *)ctx, 0, sizeof(DiffContext));
ctx->colors = true;
ctx->colors = diff_env_get_bool("RZ_COLOR", true);
ctx->evars = rz_list_newf(free);
if (!ctx->evars) {
@ -286,7 +295,7 @@ static void rz_diff_parse_arguments(int argc, const char **argv, DiffContext *ct
case '1': rz_diff_ctx_set_def(ctx, input_b, NULL, opt.arg); break;
case 'A': rz_diff_ctx_set_def(ctx, compare_addresses, false, true); break;
case 'B': rz_diff_ctx_set_def(ctx, analyze_all, false, true); break;
case 'C': rz_diff_ctx_set_def(ctx, colors, true, false); break;
case 'C': rz_diff_ctx_set_def(ctx, colors, ctx->colors, false); break;
case 'T': rz_diff_ctx_set_def(ctx, show_time, false, true); break;
case 'a': rz_diff_ctx_set_def(ctx, architecture, NULL, opt.arg); break;
case 'b': rz_diff_ctx_set_unsigned(ctx, arch_bits, opt.arg); break;
@ -296,8 +305,8 @@ static void rz_diff_parse_arguments(int argc, const char **argv, DiffContext *ct
case 'j': rz_diff_ctx_set_mode(ctx, DIFF_MODE_JSON); break;
case 'q': rz_diff_ctx_set_mode(ctx, DIFF_MODE_QUIET); break;
case 't': rz_diff_set_def(type, NULL, opt.arg); break;
case 'V': rz_diff_ctx_set_opt(ctx, DIFF_OPT_VERSION); break;
case 'v': rz_diff_ctx_set_def(ctx, verbose, false, true); break;
case 'v': rz_diff_ctx_set_opt(ctx, DIFF_OPT_VERSION); break;
case 'V': rz_diff_ctx_set_def(ctx, verbose, false, true); break;
case 'S': rz_diff_set_def(screen, NULL, opt.arg); break;
case 'H': rz_diff_ctx_set_opt(ctx, DIFF_OPT_HEX_VISUAL); break;
case 'e': rz_diff_ctx_add_evar(ctx, opt.arg); break;

View file

@ -140,51 +140,41 @@ static void rz_run_help(int v) {
}
}
static RzRunProfile *rz_run_new_from_cmdline(int start, int argc, const char **argv) {
bool no_more_directives = false;
int directive_index = 0;
RzRunProfile *p = rz_run_new(NULL);
if (!p) {
RZ_LOG_ERROR("Failed to create new RzRunProfile\n");
return NULL;
}
for (int i = start; i < argc; i++) {
if (!strcmp(argv[i], "--")) {
no_more_directives = true;
continue;
}
if (no_more_directives) {
const char *word = argv[i];
char *line = directive_index
? rz_str_newf("arg%d=%s", directive_index, word)
: rz_str_newf("program=%s", word);
rz_run_parseline(p, line);
directive_index++;
free(line);
} else if (!rz_run_parseline(p, argv[i])) {
goto fail;
}
}
return p;
fail:
rz_run_free(p);
return NULL;
}
RZ_API int rz_main_rz_run(int argc, const char **argv) {
RzRunProfile *p;
int i, ret;
const char *file = argv[1];
if (!strcmp(file, "-w")) {
#if __UNIX__
rz_run_tty();
return 0;
#else
RZ_LOG_ERROR("Not supported\n");
return 1;
#endif
}
if (*file && !strchr(file, '=')) {
p = rz_run_new(file);
} else {
bool noMoreDirectives = false;
int directiveIndex = 0;
p = rz_run_new(NULL);
if (!p) {
RZ_LOG_ERROR("Failed to create new RzRunProfile\n");
return 1;
}
for (i = *file ? 1 : 2; i < argc; i++) {
if (!strcmp(argv[i], "--")) {
noMoreDirectives = true;
continue;
}
if (noMoreDirectives) {
const char *word = argv[i];
char *line = directiveIndex
? rz_str_newf("arg%d=%s", directiveIndex, word)
: rz_str_newf("program=%s", word);
rz_run_parseline(p, line);
directiveIndex++;
free(line);
} else {
rz_run_parseline(p, argv[i]);
}
}
}
if (!p) {
return 1;
}
int ret = 0;
RzRunProfile *p = NULL;
if (argc == 1 || !strcmp(argv[1], "-h")) {
rz_run_help(0);
ret = 1;
@ -210,6 +200,24 @@ RZ_API int rz_main_rz_run(int argc, const char **argv) {
ret = 0;
goto finish;
}
const char *file = argc > 1 ? argv[1] : "";
if (RZ_STR_ISNOTEMPTY(file) && !strcmp(file, "-w")) {
#if __UNIX__
rz_run_tty();
return 0;
#else
RZ_LOG_ERROR("Not supported\n");
return 1;
#endif
}
if (RZ_STR_ISNOTEMPTY(file) && !strchr(file, '=')) {
p = rz_run_new(file);
} else {
p = rz_run_new_from_cmdline(*file ? 1 : 2, argc, argv);
}
if (!p) {
return 1;
}
ret = rz_run_config_env(p);
if (ret) {
printf("error while configuring the environment.\n");

View file

@ -77,13 +77,17 @@ static void dyn_init(void) {
RZ_API RzRunProfile *rz_run_new(const char *str) {
RzRunProfile *p = RZ_NEW0(RzRunProfile);
if (p) {
rz_run_reset(p);
if (str) {
rz_run_parsefile(p, str);
}
if (!p) {
return NULL;
}
return p;
rz_run_reset(p);
if (!str || rz_run_parsefile(p, str)) {
return p;
}
rz_run_free(p);
return NULL;
}
RZ_API void rz_run_reset(RzRunProfile *p) {
@ -104,7 +108,10 @@ RZ_API bool rz_run_parse(RzRunProfile *pf, const char *profile) {
if ((o = strchr(p, '\n'))) {
*o++ = 0;
}
rz_run_parseline(pf, p);
if (!rz_run_parseline(pf, p)) {
free(str);
return false;
}
p = o;
}
free(str);
@ -112,22 +119,23 @@ RZ_API bool rz_run_parse(RzRunProfile *pf, const char *profile) {
}
RZ_API void rz_run_free(RzRunProfile *r) {
if (r) {
free(r->_system);
free(r->_program);
free(r->_runlib);
free(r->_runlib_fcn);
free(r->_stdio);
free(r->_stdin);
free(r->_stdout);
free(r->_stderr);
free(r->_chgdir);
free(r->_chroot);
free(r->_libpath);
free(r->_preload);
free(r->_input);
free(r);
if (!r) {
return;
}
free(r->_system);
free(r->_program);
free(r->_runlib);
free(r->_runlib_fcn);
free(r->_stdio);
free(r->_stdin);
free(r->_stdout);
free(r->_stderr);
free(r->_chgdir);
free(r->_chroot);
free(r->_libpath);
free(r->_preload);
free(r->_input);
free(r);
}
#if __UNIX__
@ -597,7 +605,13 @@ RZ_API bool rz_run_parseline(RzRunProfile *p, const char *b) {
} else if (!memcmp(b, "arg", 3)) {
int n = atoi(b + 3);
if (n >= 0 && n < RZ_RUN_PROFILE_NARGS) {
p->_args[n] = resolve_value(value, NULL);
char *arg_n = resolve_value(value, NULL);
if (!arg_n) {
free(key);
free(value);
return false;
}
p->_args[n] = arg_n;
p->_argc++;
} else {
RZ_LOG_ERROR("rz-run: out of bounds args index: %d\n", n);

View file

@ -1947,13 +1947,14 @@ RZ_API char *rz_str_escape_mutf8_for_json(const char *buf, int buf_size) {
RZ_API RZ_OWN char *rz_str_format_msvc_argv(size_t argc, const char **argv) {
RzStrBuf sb;
rz_strbuf_init(&sb);
size_t i;
for (i = 0; i < argc; i++) {
if (i > 0) {
for (size_t i = 0; i < argc; i++) {
const char *arg = argv[i];
if (!arg) {
arg = "";
}
if (!rz_strbuf_is_empty(&sb)) {
rz_strbuf_append(&sb, " ");
}
const char *arg = argv[i];
bool must_escape = strchr(arg, '\"') != NULL;
bool must_quote = strpbrk(arg, " \t") != NULL || !*arg;
if (!must_escape && must_quote && *arg && arg[strlen(arg) - 1] == '\\') {

View file

@ -189,9 +189,14 @@ Without the regex that filtered out the non-deterministic file path and addresse
```
* **NAME** is the name of the test, it must be unique
* **FILE** is the path of the file used for the test
* **ARGS** (optional) are the command line argument passed to rizin (e.g -b 16)
* **FILE** (optional when `TOOL` is set) is the file or input used for the test
* **TOOL** (optional) allows you to override the tool to test (supports only `rizin`, `rz-asm`, `rz-ax`, `rz-bin`, `rz-diff`, `rz-find`, `rz-gg`, `rz-hash`, `rz-run`, `rz-sign`, `rz-test`)
* **ARGS** (optional, unless `TOOL` is set) are the command line argument passed to rizin (e.g -b 16)
* **CMDS** are the commands to be executed by the test
* **ENVS** (optional) allows to set a custom environment variable (example `FOO=bar`)
* **EXIT_STATUS** (optional) allows to override the default expected exit status.
* **COLOR** (optional) allows to use colors in the test (default `0`)
* **UTF8** (optional) allows to use utf-8 in the test (default `0`)
* **EXPECT** is the expected output of the test from stdout. If `REGEXP_FILTER_OUT` is used, `EXPECT` matches only the filtered output.
* **EXPECT_ERR** (optional) is the expected output of the test from stderr. Can be specified in addition or instead of `EXPECT`
* **BROKEN** (optional) is 1 if the tests is expected to be fail, 0 or unspecified otherwise

View file

@ -1,22 +1,22 @@
NAME=TriCore lea
FILE=malloc://512
CMDS=!rz-asm -a tricore -d d916606c
TOOL=rz-asm
ARGS=-a tricore -d d916606c
EXPECT=<<EOF
lea a6, [a1]#-0x3a60
EOF
RUN
NAME=TriCore sub
FILE=malloc://512
CMDS=!rz-asm -a tricore -d 200a
TOOL=rz-asm
ARGS=-a tricore -d 200a
EXPECT=<<EOF
sub.a sp, #0xa
EOF
RUN
NAME=TriCore multi
FILE=malloc://512
CMDS=!rz-asm -a tricore -d 0f0200007cb10880f8130200
TOOL=rz-asm
ARGS=-a tricore -d 0f0200007cb10880f8130200
EXPECT=<<EOF
sh d0, d2, d0
jnz.a a11, #6
@ -27,8 +27,8 @@ EOF
RUN
NAME=TriCore multi
FILE=malloc://512
CMDS=!rz-asm -a tricore -d 0f0200007cb10880f8130200
TOOL=rz-asm
ARGS=-a tricore -d 0f0200007cb10880f8130200
EXPECT=<<EOF
sh d0, d2, d0
jnz.a a11, #6
@ -40,16 +40,14 @@ RUN
NAME=TriCore return_0.elf
FILE=bins/tricore/return_0.elf
CMDS=iI~arch
CMDS=<<EOF
iI~arch
echo ---
arp
EOF
EXPECT=<<EOF
arch tricore
EOF
RUN
NAME=TriCore return_0.elf
FILE=bins/tricore/return_0.elf
CMDS=arp
EXPECT=<<EOF
---
=PC pc
=SP a10
=A0 a0
@ -807,6 +805,11 @@ aga
agc
agr
agf
echo ---
pdr
pdR
pdsf
afi
EOF
EXPECT=<<EOF
.-----------.
@ -911,21 +914,7 @@ EXPECT=<<EOF
| mov d2, d15 |
| ret |
`---------------------------------------'
EOF
RUN
NAME=tricore analysis disassemble fcn
FILE=bins/elf/float_ex1/float_ex1_tricore_gcc
CMDS=<<EOF
e asm.arch=tricore
aaa
s sym.fn1
pdr
pdR
pdsf
afi
EOF
EXPECT=<<EOF
---
; CALL XREF from main @ 0x80000642
/ sym.fn1(size_t nbytes, int32_t arg5, int32_t arg6, int32_t arg7);
| ; arg size_t nbytes @ a0

View file

@ -1,46 +1,52 @@
NAME=rz-asm #1167 3
FILE==
CMDS=!rz-asm -s att -a x86.as -b 64 "test %rbx, %rax"
TOOL=rz-asm
FILE=test %rbx, %rax
ARGS=-s att -a x86.as -b 64
EXPECT=<<EOF
4885d8
EOF
RUN
NAME=rz-asm #1167 4
FILE==
CMDS=!rz-asm -s intel -a x86.as -b 64 "test rax, rbx"
TOOL=rz-asm
FILE=test rax, rbx
ARGS=-s intel -a x86.as -b 64
EXPECT=<<EOF
4885d8
EOF
RUN
NAME=rz-asm #1167 5
FILE==
CMDS=!rz-asm -s att -a x86.as -b 64 "add $33, %rbx"
TOOL=rz-asm
FILE=add $33, %rbx
ARGS=-s att -a x86.as -b 64
EXPECT=<<EOF
4883c321
EOF
RUN
NAME=rz-asm #1167 6
FILE==
CMDS=!rz-asm -s intel -a x86.as -b 64 "add rbx, 33"
TOOL=rz-asm
FILE=add rbx, 33
ARGS=-s intel -a x86.as -b 64
EXPECT=<<EOF
4883c321
EOF
RUN
NAME=rz-asm -s att -a x86.as -b 64 "movq %rdx, %rax"
FILE==
CMDS=!rz-asm -s att -a x86.as -b 64 "movq %rdx, %rax"
TOOL=rz-asm
FILE=movq %rdx, %rax
ARGS=-s att -a x86.as -b 64
EXPECT=<<EOF
4889d0
EOF
RUN
NAME=rz-asm -a x86 -s att "movl %eax, %ebx"
FILE==
CMDS=!rz-asm -a x86 -s att "movl %eax, %ebx"
TOOL=rz-asm
FILE=movl %eax, %ebx
ARGS=-a x86 -s att
EXPECT=<<EOF
89c3
EOF

View file

@ -4222,79 +4222,133 @@ imp.exit
EOF
RUN
NAME=iRj
NAME=iR
FILE=bins/pe/standard.exe
CMDS=iRj sha1 md5~{}
CMDS=<<EOF
iR sha1 md5
iRj sha1 md5~{}
iRt sha1 md5
EOF
EXPECT=<<EOF
Resource 0
name: 1576
timestamp: Thu Jan 1 00:00:00 1970 UTC
vaddr: 0x00401180
paddr: 0x00000380
size: 5.5K
type: ICON
language: LANG_NEUTRAL
sha1: 0641e148e71cb823888894028e5ba9f203181814
md5: 87507b293740fb9e8faee28a69237940
Resource 1
name: 10
timestamp: Thu Jan 1 00:00:00 1970 UTC
vaddr: 0x00402a10
paddr: 0x00001c10
size: 76
type: STRING
language: LANG_NEUTRAL
sha1: 86abc7b4e5b564362fb7fb3e1645aa3f2fd8b8da
md5: db3c483da9950c7bd46844f03cbd6887
Resource 2
name: 788
timestamp: Thu Jan 1 00:00:00 1970 UTC
vaddr: 0x004027b0
paddr: 0x000019b0
size: 20
type: GROUP_ICON
language: LANG_NEUTRAL
sha1: 7c25f71d5507224c737aca686cbcf4d9a24a5aae
md5: e4211b2ef5cc41f9f1c9e676ef9a69be
Resource 3
name: 1
timestamp: Thu Jan 1 00:00:00 1970 UTC
vaddr: 0x004027d0
paddr: 0x000019d0
size: 452
type: VERSION
language: LANG_NEUTRAL
sha1: 7a09fe300081b9cd92bc40261c95f65f23f95dde
md5: d8753c8132ba58cc148c14347def9ef4
Resource 4
name: 1
timestamp: Thu Jan 1 00:00:00 1970 UTC
vaddr: 0x004029a0
paddr: 0x00001ba0
size: 74
type: MANIFEST
language: LANG_NEUTRAL
sha1: 3d743931c2fe134aee14483fac1625910289c29e
md5: a8ce572d4e2ecee820d55df5698c690f
[
{
"name": "1576",
"index": 0,
"type": "ICON",
"vaddr": 4198784,
"paddr": 896,
"size": 5672,
"lang": "LANG_NEUTRAL",
"timestamp": "Thu Jan 1 00:00:00 1970 UTC",
"sha1": "ead6c27941988470ea241780d5f03bda35ffb023",
"md5": "4ca2df93b0862cc601fb4c5df46722aa"
"sha1": "0641e148e71cb823888894028e5ba9f203181814",
"md5": "87507b293740fb9e8faee28a69237940"
},
{
"name": "10",
"index": 1,
"type": "STRING",
"vaddr": 4205072,
"paddr": 7184,
"size": 76,
"lang": "LANG_NEUTRAL",
"timestamp": "Thu Jan 1 00:00:00 1970 UTC",
"sha1": "ece05370137621ead05fcf468ba546e2dab83c7a",
"md5": "e6b62b76fb2eb2a0e0adde0c067da680"
"sha1": "86abc7b4e5b564362fb7fb3e1645aa3f2fd8b8da",
"md5": "db3c483da9950c7bd46844f03cbd6887"
},
{
"name": "788",
"index": 2,
"type": "GROUP_ICON",
"vaddr": 4204464,
"paddr": 6576,
"size": 20,
"lang": "LANG_NEUTRAL",
"timestamp": "Thu Jan 1 00:00:00 1970 UTC",
"sha1": "6768033e216468247bd031a0a2d9876d79818f8f",
"md5": "441018525208457705bf09a8ee3c1093"
"sha1": "7c25f71d5507224c737aca686cbcf4d9a24a5aae",
"md5": "e4211b2ef5cc41f9f1c9e676ef9a69be"
},
{
"name": "1",
"index": 3,
"type": "VERSION",
"vaddr": 4204496,
"paddr": 6608,
"size": 452,
"lang": "LANG_NEUTRAL",
"timestamp": "Thu Jan 1 00:00:00 1970 UTC",
"sha1": "af9d0faa532f99a1a7e5b8f6bbf5ceaef55e38b6",
"md5": "3ce9d74193d28338494362767873ba7b"
"sha1": "7a09fe300081b9cd92bc40261c95f65f23f95dde",
"md5": "d8753c8132ba58cc148c14347def9ef4"
},
{
"name": "1",
"index": 4,
"type": "MANIFEST",
"vaddr": 4204960,
"paddr": 7072,
"size": 74,
"lang": "LANG_NEUTRAL",
"timestamp": "Thu Jan 1 00:00:00 1970 UTC",
"sha1": "1dcc0c704303ccc1729abd618f490073331e8b22",
"md5": "aa6672fe9e8426f8dd570c81095e1476"
"sha1": "3d743931c2fe134aee14483fac1625910289c29e",
"md5": "a8ce572d4e2ecee820d55df5698c690f"
}
]
EOF
RUN
NAME=iRt
FILE=bins/pe/standard.exe
CMDS=iRt:quiet sha1 md5
EXPECT=<<EOF
0 1576 ICON 0x00401180 0x1628 LANG_NEUTRAL Thu Jan 1 00:00:00 1970 UTC ead6c27941988470ea241780d5f03bda35ffb023 4ca2df93b0862cc601fb4c5df46722aa
1 10 STRING 0x00402a10 0x4c LANG_NEUTRAL Thu Jan 1 00:00:00 1970 UTC ece05370137621ead05fcf468ba546e2dab83c7a e6b62b76fb2eb2a0e0adde0c067da680
2 788 GROUP_ICON 0x004027b0 0x14 LANG_NEUTRAL Thu Jan 1 00:00:00 1970 UTC 6768033e216468247bd031a0a2d9876d79818f8f 441018525208457705bf09a8ee3c1093
3 1 VERSION 0x004027d0 0x1c4 LANG_NEUTRAL Thu Jan 1 00:00:00 1970 UTC af9d0faa532f99a1a7e5b8f6bbf5ceaef55e38b6 3ce9d74193d28338494362767873ba7b
4 1 MANIFEST 0x004029a0 0x4a LANG_NEUTRAL Thu Jan 1 00:00:00 1970 UTC 1dcc0c704303ccc1729abd618f490073331e8b22 aa6672fe9e8426f8dd570c81095e1476
index name type vaddr paddr size lang timestamp sha1 md5
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
0 1576 ICON 0x00401180 0x00000380 0x1628 LANG_NEUTRAL Thu Jan 1 00:00:00 1970 UTC 0641e148e71cb823888894028e5ba9f203181814 87507b293740fb9e8faee28a69237940
1 10 STRING 0x00402a10 0x00001c10 0x4c LANG_NEUTRAL Thu Jan 1 00:00:00 1970 UTC 86abc7b4e5b564362fb7fb3e1645aa3f2fd8b8da db3c483da9950c7bd46844f03cbd6887
2 788 GROUP_ICON 0x004027b0 0x000019b0 0x14 LANG_NEUTRAL Thu Jan 1 00:00:00 1970 UTC 7c25f71d5507224c737aca686cbcf4d9a24a5aae e4211b2ef5cc41f9f1c9e676ef9a69be
3 1 VERSION 0x004027d0 0x000019d0 0x1c4 LANG_NEUTRAL Thu Jan 1 00:00:00 1970 UTC 7a09fe300081b9cd92bc40261c95f65f23f95dde d8753c8132ba58cc148c14347def9ef4
4 1 MANIFEST 0x004029a0 0x00001ba0 0x4a LANG_NEUTRAL Thu Jan 1 00:00:00 1970 UTC 3d743931c2fe134aee14483fac1625910289c29e a8ce572d4e2ecee820d55df5698c690f
EOF
RUN

View file

@ -1,8 +1,8 @@
# XXX its green on mac, but it's os-specific test and will fail on travis
NAME=rz-gg eggtest.c
BROKEN=1
FILE==
CMDS=!rz-gg bins/src/eggtest.c
TOOL=rz-gg
ARGS=bins/src/eggtest.c
EXPECT=<<EOF
rz-bin -o 'bins/src/eggtest.c.text' -O d/S/'0..__text' 'bins/src/eggtest.c.o'
e900000000662e0f1f8400000000009050c744240400000000bf01000000488d3543000000ba06000000e80000000031d289042489d059c30f1f840000000000897c24fc48897424f0895424ec8b7c24fc488b7424f048634424ec48894424d8ba0400000289d0488b5424d80f0548894424e0488b4424e089c1894c24d48b4424d4c348656c6c6f0a00

View file

@ -82,16 +82,17 @@ EOF
RUN
NAME=binary
FILE==
CMDS=<<EOF
e asm.arch=x86
echo
!rz-ax Bxff3f0000fcff
!rz-ax Bxff3ffcff
EOF
TOOL=rz-ax
ARGS=Bxff3f0000fcff
EXPECT=<<EOF
111111110011111100000000000000001111110011111111b
EOF
RUN
NAME=binary
TOOL=rz-ax
ARGS=Bxff3ffcff
EXPECT=<<EOF
11111111001111111111110011111111b
EOF
RUN

View file

@ -997,7 +997,6 @@ RUN
NAME=arm s110 syscalls /ad svc
FILE=bins/elf/BLE_Beacon2.NRF51822_OTA.bin
ARGS=-m 0x16000
CMDS=
CMDS=<<EOF
e asm.arch=arm
e asm.bits=16

View file

@ -1,6 +1,6 @@
NAME=binsym demangling
FILE=bins/mach0/hellocxx-osx-i386
CMDS=!rz-bin -qsD c++ all bins/mach0/hellocxx-osx-i386
TOOL=rz-bin
ARGS=-qsD c++ all bins/mach0/hellocxx-osx-i386
EXPECT=<<EOF
0x00002054 0 _NXArgc
0x00002058 0 _NXArgv

View file

@ -47,9 +47,9 @@ EOF
RUN
NAME=ELF: main rebased 3
FILE==
ARGS=-B 0x200000
CMDS=!rz-bin -qMB 0x200000 bins/elf/analysis/main
TOOL=rz-bin
FILE=bins/elf/analysis/main
ARGS=-qMB 0x200000
EXPECT=2098438
RUN

View file

@ -24,13 +24,19 @@ EOF
RUN
NAME=ELF: rz-bin entrypoint with baddr
FILE==
CMDS=<<EOF
!rz-bin -I -B 0x300000 bins/elf/analysis/pie | grep baddr
!rz-bin -e -B 0x300000 bins/elf/analysis/pie | grep program
EOF
TOOL=rz-bin
ARGS=-I -B 0x300000 bins/elf/analysis/pie
REGEXP_FILTER_OUT=baddr.+
EXPECT=<<EOF
baddr 0x00300000
EOF
RUN
NAME=ELF: rz-bin entrypoint with baddr
TOOL=rz-bin
ARGS=-e -B 0x300000 bins/elf/analysis/pie
REGEXP_FILTER_OUT=.+program
EXPECT=<<EOF
0x00300450 0x00000450 0x00300018 0x00000018 program
EOF
RUN

View file

@ -6,6 +6,7 @@ Resource 0
name: 29524
timestamp: Thu Jan 1 00:00:00 1970 UTC
vaddr: 0x00401168
paddr: 0x00000368
size: 32
type: UNKNOWN (789)
language: LANG_NEUTRAL
@ -20,6 +21,7 @@ Resource 0
name: 7354
timestamp: Thu Jan 1 00:00:00 1970 UTC
vaddr: 0x00401178
paddr: 0x00000378
size: 39
type: UNKNOWN (315)
language: LANG_NEUTRAL
@ -34,6 +36,7 @@ Resource 0
name: 1576
timestamp: Thu Jan 1 00:00:00 1970 UTC
vaddr: 0x00401200
paddr: 0x00000400
size: 5.5K
type: ICON
language: LANG_NEUTRAL
@ -41,6 +44,7 @@ Resource 1
name: 788
timestamp: Thu Jan 1 00:00:00 1970 UTC
vaddr: 0x00402828
paddr: 0x00001a28
size: 20
type: GROUP_ICON
language: LANG_NEUTRAL
@ -55,6 +59,7 @@ Resource 0
name: 10
timestamp: Thu Jan 1 00:00:00 1970 UTC
vaddr: 0x004010d6
paddr: 0x000002d6
size: 94
type: STRING
language: LANG_NEUTRAL
@ -69,6 +74,7 @@ Resource 0
name: 29524
timestamp: Thu Jan 1 00:00:00 1970 UTC
vaddr: 0x004011a0
paddr: 0x000003a0
size: 34
type: UNKNOWN (789)
language: LANG_NEUTRAL

View file

@ -55,32 +55,16 @@ RUN
NAME=rizin -V
FILE==
CMDS=!!rizin -V~rz_arch?
CMDS=<<EOF
!!rizin -V~rz_arch?
!!rizin -h~Usage?
!!rizin -hh~RZ_USER_PLUGINS?
!!rizin -L~default?
EOF
EXPECT=<<EOF
1
EOF
RUN
NAME=rizin -h
FILE==
CMDS=!!rizin -h~Usage?
EXPECT=<<EOF
1
EOF
RUN
NAME=rizin -hh
FILE==
CMDS=!!rizin -hh~RZ_USER_PLUGINS?
EXPECT=<<EOF
1
EOF
RUN
NAME=rizin -L
FILE==
CMDS=!!rizin -L~default?
EXPECT=<<EOF
1
EOF
RUN
@ -194,8 +178,10 @@ EXPECT_ERR=
RUN
NAME=prompt settings
FILE==
CMDS=!rizin -e cfg.fortunes=0 -e scr.color=0 -c "< \ne scr.prompt.file=true\ne scr.prompt.flag=true\nsd 1\ne scr.prompt.flag.only=true\ne scr.prompt.sect=true\nq\n" ./bins/elf/hello_world
TOOL=rizin
FILE=bins/elf/hello_world
CMDS=< \ne scr.prompt.file=true\ne scr.prompt.flag=true\nsd 1\ne scr.prompt.flag.only=true\ne scr.prompt.sect=true\nq\n
ARGS=-e cfg.fortunes=0 -e scr.color=0
EXPECT=<<EOF
 [0x000006a0]> [0x000006a0]>  [0x000006a0]>
 [0x000006a0]> [0x000006a0]>   [0x000006a0]> e [0x000006a0]> e  [0x000006a0]> e [0x000006a0]> e   [0x000006a0]> e s [0x000006a0]> e s  [0x000006a0]> e sc [0x000006a0]> e sc  [0x000006a0]> e scr [0x000006a0]> e scr  [0x000006a0]> e scr. [0x000006a0]> e scr.  [0x000006a0]> e scr.p [0x000006a0]> e scr.p  [0x000006a0]> e scr.pr [0x000006a0]> e scr.pr  [0x000006a0]> e scr.pro [0x000006a0]> e scr.pro  [0x000006a0]> e scr.prom [0x000006a0]> e scr.prom  [0x000006a0]> e scr.promp [0x000006a0]> e scr.promp  [0x000006a0]> e scr.prompt [0x000006a0]> e scr.prompt  [0x000006a0]> e scr.prompt. [0x000006a0]> e scr.prompt.  [0x000006a0]> e scr.prompt.f [0x000006a0]> e scr.prompt.f  [0x000006a0]> e scr.prompt.fi [0x000006a0]> e scr.prompt.fi  [0x000006a0]> e scr.prompt.fil [0x000006a0]> e scr.prompt.fil  [0x000006a0]> e scr.prompt.file [0x000006a0]> e scr.prompt.file  [0x000006a0]> e scr.prompt.file= [0x000006a0]> e scr.prompt.file=  [0x000006a0]> e scr.prompt.file=t [0x000006a0]> e scr.prompt.file=t  [0x000006a0]> e scr.prompt.file=tr [0x000006a0]> e scr.prompt.file=tr  [0x000006a0]> e scr.prompt.file=tru [0x000006a0]> e scr.prompt.file=tru  [0x000006a0]> e scr.prompt.file=true [0x000006a0]> e scr.prompt.file=true [0x000006a0]> e scr.prompt.file=true
@ -240,15 +226,9 @@ EXPECT=<<EOF
EOF
RUN
NAME=<program> -h
FILE=--
CMDS=<<EOF
(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)
e scr.color.grep=true
!!rz-test -h~:..-1
!!rz-test -h~:-1 | grep -o ".*:"
EOF
NAME=rizin -h
TOOL=rizin
ARGS=-h
EXPECT=<<EOF
Usage: rizin [-ACdfLMnNqStuvwzX] [-P patch] [-p prj] [-a arch] [-b bits] [-i file]
[-s addr] [-B baddr] [-m maddr] [-c cmd] [-e k=v] file|pid|-|--|=
@ -296,7 +276,13 @@ EXPECT=<<EOF
-x Open without exec-flag (asm.emu will not work), See io.exec
-X Same as -e bin.usextr=false (useful for dyldcache)
-z, -zz Do not load strings or load them even in raw
EOF
RUN
NAME=rz-asm -h
TOOL=rz-asm
ARGS=-h
EXPECT=<<EOF
Usage: rz-asm [-ACdDehLBvw] [-a arch] [-b bits] [-m plugin] [-o addr] [-s syntax]
[-f file] [-F fil:ter] [-i skip] [-l len] 'code'|hex|-
-a arch  Set architecture to assemble/disassemble (see -L)
@ -336,7 +322,13 @@ Environment:
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)
EOF
RUN
NAME=rz-ax -h
TOOL=rz-ax
ARGS=-h
EXPECT=<<EOF
Usage: rz-ax [options] [expr ...]
If expr is not provided, reads from stdin
int -> hex ; rz-ax 10
@ -387,7 +379,14 @@ If expr is not provided, reads from stdin
-w signed word ; rz-ax -w 16 0xffff
-v version ; rz-ax -v
-p position of set bits ; rz-ax -p 0xb3
EOF
RUN
NAME=rz-bin -h
TOOL=rz-bin
ARGS=-h
EXIT_STATUS=1
EXPECT=<<EOF
Usage: rz-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
@ -460,55 +459,68 @@ Environment:
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_COLOR: # enables/disables colors support
RZ_UTF8: # enables/disables utf8 support
RZ_NOPLUGINS: # do not load plugins
EOF
RUN
NAME=rz-diff -h
TOOL=rz-diff
ARGS=-h
EXPECT=<<EOF
Usage: rz-diff [options] <file0> <file1>
-a arch  Specify architecture plugin to use (x86, arm, ..)
-b bits  Specify register size for arch (16 (thumb), 32, 64, ..)
-d algo  Compute edit distance based on the chosen algorithm:
  myers | Eugene W. Myers' O(ND) algorithm (no substitution)
  leven | Levenshtein O(N^2) algorithm (with substitution)
  ssdeep | Context triggered piecewise hashing comparison
-i Use command line arguments instead of files (only for -d)
-H Hexadecimal visual mode
-h Show this help
-j JSON output
-q Quiet output
-V Show version information
-v Be more verbose (stderr output)
-K theme Set a give color theme (see rizin 'eco' command)
-e k=v  Set an evaluable config variable
-A Compare virtual and physical addresses
-B Run 'aaa' when loading the bin
-C Disable colors
-T Show timestamp information
-S WxH  Set the width and height of the terminal for visual mode
-0 cmd  Input for file0 when option -t 'commands' is given.
 The same value will be set for file1, if -1 is not set.
-1 cmd  Input for file1 when option -t 'commands' is given.
-t type  Compute the difference between two files based on its type:
  bytes | compare raw bytes in the files (only for small files)
  lines | compare text files
  functions | compare functions found in the files
  | optional -0 <fcn name|offset> to compare only one function
  classes | compare classes found in the files
  command | compare command output returned when executed in both files
  | require -0 <cmd> and -1 <cmd> is optional
  entries | compare entries found in the files
  fields | compare fields found in the files
  graphs | compare 2 functions and outputs in graphviz/dot format
  | require -0 <fcn name|offset> and -1 <fcn name|offset> is optional
  imports | compare imports found in the files
  libraries | compare libraries found in the files
  sections | compare sections found in the files
  strings | compare strings found in the files
  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
-a arch  Specify architecture plugin to use (x86, arm, ..)
-b bits  Specify register size for arch (16 (thumb), 32, 64, ..)
-d myers  Compute edit distance using Eugene W. Myers' O(ND) algorithm (no substitution)
-d leven  Compute edit distance using Levenshtein O(N^2) algorithm (with substitution)
-d ssdeep  Compute edit distance using Context triggered piecewise hashing comparison
-i Use command line arguments instead of files (only for -d)
-H Hexadecimal visual mode
-h Show this help
-j JSON output
-q Quiet output
-v Show version information
-V Be more verbose (stderr output)
-K theme  Set a give color theme (see rizin 'eco' command)
-e k=v  Set an evaluable config variable
-A Compare virtual and physical addresses
-B Run 'aaa' when loading the bin
-C Disable colors
-T Show timestamp information
-S WxH  Set the width and height of the terminal for visual mode
-0 cmd  Input for file0 when option -t 'commands' is given.
 The same value will be set for file1, if -1 is not set.
-1 cmd  Input for file1 when option -t 'commands' is given.
-t bytes  Compare raw bytes in the files (only for small files)
-t lines  Compare text files
-t functions Compare functions found in the files
 optional -0 <fcn name|offset> to compare only one function
-t classes  Compare classes found in the files
-t command  Compare command output returned when executed in both files
 requires -0 <cmd> and -1 <cmd> is optional
-t entries  Compare entries found in the files
-t fields  Compare fields found in the files
-t graphs  Compare 2 functions and outputs in graphviz/dot format
 requires -0 <fcn name|offset> and -1 <fcn name|offset> is optional
-t imports  Compare imports found in the files
-t libraries Compare libraries found in the files
-t sections  Compare sections found in the files
-t strings  Compare strings found in the files
-t 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
Environment variables
RZ_COLOR | enables/disables colors support
EOF
RUN
NAME=rz-find -h
TOOL=rz-find
ARGS=-h
EXPECT=<<EOF
Usage: rz-find [-mXnzZhqvV] [-a align] [-b sz] [-f/t from/to] [-[e|s|w|S|I] str] [-x hex] -|file|dir ..
-a align Only accept aligned hits
-b size  Set block size
@ -535,7 +547,14 @@ ec diff.unmatch red | mismatch color
-X Show hexdump of search results
-z Search for zero-terminated strings
-Z Show string found on each search hit
EOF
RUN
NAME=rz-gg -h
TOOL=rz-gg
ARGS=-h
EXIT_STATUS=1
EXPECT=<<EOF
Usage: rz-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|-
@ -572,7 +591,13 @@ ec diff.unmatch red | mismatch color
-x Execute
-X Execute rop chain, using the stack provided
-z Output in C string syntax
EOF
RUN
NAME=rz-hash -h
TOOL=rz-hash
ARGS=-h
EXPECT=<<EOF
Usage: rz-hash [-vhBkjLq] [-b S] [-a A] [-c H] [-E A] [-D A] [-s S] [-x S] [-f O] [-t O] [files|-] ...
-v Show version information
-h Show this help
@ -603,7 +628,14 @@ ec diff.unmatch red | mismatch color
 
 All the input (besides -s/-x/-c) can be hexadecimal or strings
 If 's:' prefix is specified
EOF
RUN
NAME=rz-run -h
TOOL=rz-run
ARGS=-h
EXIT_STATUS=1
EXPECT=<<EOF
Usage: rz-run [directives | script.rz] [-- program [args]]
-h Show this help
-l Show profile directives
@ -611,7 +643,13 @@ ec diff.unmatch red | mismatch color
-v Show version information
-w Wait for incoming terminal process
-- program [args] Run program
EOF
RUN
NAME=rz-sign -h
TOOL=rz-sign
ARGS=-h
EXPECT=<<EOF
Usage: rz-sign [-aqv] [-e k=v] (-c pat sig | -o sig bin | -d sig)
-h Show this help
-a, -aa Add extra 'a' to analysis command (available only with -o option)
@ -625,29 +663,5 @@ 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
-N Disable diffing unless the test fails.
-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
OS/Arch for archos tests:
EOF
RUN

View file

@ -1,85 +1,66 @@
NAME=rz-asm i4004
FILE==
CMDS=<<EOF
!rz-asm -L~4004
EOF
TOOL=rz-asm
ARGS=-L
REGEXP_FILTER_OUT=.+i4004.+
EXIT_STATUS=1
EXPECT=<<EOF
_dA__ 4 i4004 LGPL3 Intel 4004 disassembler
EOF
RUN
NAME=rz-asm arm asm/dis endian
FILE==
CMDS=<<EOF
!rz-asm -a arm -b32 "mov r0, 3"
!rz-asm -a arm -b32 -e "mov r0, 3"
!rz-asm -a arm -b32 -d 0300a0e3
!rz-asm -a arm -b32 -e -d e3a00003
EOF
NAME=rz-asm arm32le assemble
TOOL=rz-asm
FILE=mov r0, 3
ARGS=-a arm -b32
EXPECT=<<EOF
0300a0e3
EOF
RUN
NAME=rz-asm arm32be assemble
TOOL=rz-asm
FILE=mov r0, 3
ARGS=-a arm -b32 -e
EXPECT=<<EOF
e3a00003
mov r0, 3
EOF
RUN
NAME=rz-asm arm32le disassemble
TOOL=rz-asm
ARGS=-a arm -b32 -d 0300a0e3
EXPECT=<<EOF
mov r0, 3
EOF
RUN
NAME=1: rz-asm
FILE==
CMDS=!rz-asm -a arm -b32 "mov r0, 3"
NAME=rz-asm arm32be disassemble
TOOL=rz-asm
ARGS=-a arm -b32 -e -d e3a00003
EXPECT=<<EOF
0300a0e3
mov r0, 3
EOF
RUN
NAME=rz-asm blx arm/thumb
FILE==
CMDS=!rz-asm -o 0x4000 -a arm -b 16 -d 80f018ea
TOOL=rz-asm
ARGS=-o 0x4000 -a arm -b 16 -d 80f018ea
EXPECT=<<EOF
blx 0x84434
EOF
RUN
NAME=rz-asm blx arm/thumb 2
FILE==
CMDS=!rz-asm -o 0x4000 -a arm -b 16 -d 80f018ea
TOOL=rz-asm
ARGS=-o 0x4000 -a arm -b 16 -d 80f018ea
EXPECT=<<EOF
blx 0x84434
EOF
RUN
NAME=rz-asm arm/thumb branch errors
FILE==
CMDS=<<EOF
!rz-asm -a arm -b 16 'b.n 8'
!rz-asm -a arm -b 16 'b.w 8'
!rz-asm -a arm -b 16 'bl 8'
!rz-asm -a arm -b 16 'blx 8'
!rz-asm -a arm -b 16 'b.n 9'
!rz-asm -a arm -b 16 'b.w 9'
!rz-asm -a arm -b 16 'bl 9'
!rz-asm -a arm -b 16 'blx 9'
!rz-asm -a arm -b 16 'b.w 0x1000000'
!rz-asm -a arm -b 16 'bl 0x1000000'
!rz-asm -a arm -b 16 'blx 0x1000000'
!rz-asm -a arm -b 16 'b.w 0x1000004'
!rz-asm -a arm -b 16 'bl 0x1000004'
!rz-asm -a arm -b 16 'blx 0x1000004'
EOF
EXPECT=<<EOF
02e0
00f002b8
00f002f8
00f002e8
fff3fe97
fff3fed7
fff3fec7
EOF
RUN
NAME=2: rz-asm
FILE==
CMDS=!rz-asm -a x86 -b 64 -d "5589e583ec2083f8000f8507000000b800000000eb05b80100000083c4205dc3"
TOOL=rz-asm
ARGS=-a x86 -b 64 -d 5589e583ec2083f8000f8507000000b800000000eb05b80100000083c4205dc3
EXPECT=<<EOF
push rbp
mov ebp, esp
@ -96,38 +77,28 @@ EOF
RUN
NAME=rz-asm #1167
FILE==
CMDS=!rz-asm -a x86 -b 64 "cmp rax,rbx"
TOOL=rz-asm
FILE=cmp rax,rbx
ARGS=-a x86 -b 64
EXPECT=<<EOF
4839d8
EOF
RUN
NAME=rz-asm #1167 2
FILE==
CMDS=!rz-asm -a x86 -b 64 "test rax, rbx"
TOOL=rz-asm
FILE=test rax, rbx
ARGS=-a x86 -b 64
EXPECT=<<EOF
4885d8
EOF
RUN
NAME=rz-asm #1900
FILE==
CMDS=<<EOF
!rz-asm -a x86 -b 32 "mov [0x33], eax"
!rz-asm -a x86 -b 32 "mov eax, 33"
!rz-asm -a x86 -b 32 "mov eax, 0x33"
EOF
EXPECT=<<EOF
890533000000
b821000000
b833000000
EOF
RUN
NAME=rz-asm #1900 (detect syntax error - case 1)
FILE==
CMDS=!rz-asm -a x86 -b 32 "mov hello, eax"
TOOL=rz-asm
FILE=mov hello, eax
ARGS=-a x86 -b 32
EXIT_STATUS=1
EXPECT=
EXPECT_ERR=<<EOF
ERROR: Cannot assemble 'mov hello, eax' at line 3
@ -135,8 +106,10 @@ EOF
RUN
NAME=rz-asm #1900 (detect syntax error - case 2)
FILE==
CMDS=!rz-asm -a x86 -b 32 "mov 33, eax"
TOOL=rz-asm
FILE=mov 33, eax
ARGS=-a x86 -b 32
EXIT_STATUS=1
EXPECT=
EXPECT_ERR=<<EOF
ERROR: Cannot assemble 'mov 33, eax' at line 3
@ -144,8 +117,10 @@ EOF
RUN
NAME=rz-asm #1900 (detect syntax error - case 3)
FILE==
CMDS=!rz-asm -a x86 -b 32 "mov eax, hello"
TOOL=rz-asm
FILE=mov eax, hello
ARGS=-a x86 -b 32
EXIT_STATUS=1
EXPECT=
EXPECT_ERR=<<EOF
ERROR: Cannot assemble 'mov eax, hello' at line 3
@ -153,132 +128,109 @@ EOF
RUN
NAME=rz-asm x86_32 overlarge operand
FILE==
CMDS=!rz-asm -a x86 -b 32 "mov eax, 0x1122334455"
TOOL=rz-asm
FILE=mov eax, 0x1122334455
ARGS=-a x86 -b 32
EXIT_STATUS=1
EXPECT=
EXPECT_ERR=<<EOF
ERROR: Cannot assemble 'mov eax, 0x1122334455' at line 3
EOF
RUN
NAME=rz-asm x86_64 overlarge operand
FILE==
CMDS=<<EOF
!rz-asm -a x86 -b 64 "mov rax, 0x112233445566778899"
!rz-asm -a x86 -b 64 "mov eax, 0x1122334455"
EOF
EXPECT=
EXPECT_ERR=<<EOF
ERROR: Cannot assemble 'mov rax, 0x112233445566778899' at line 3
ERROR: Cannot assemble 'mov eax, 0x1122334455' at line 3
EOF
RUN
NAME=rz-asm #9197
FILE==
CMDS=!rz-asm -a arm -b 64 "ldur x1, [x29, -8]"
TOOL=rz-asm
FILE=ldur x1, [x29, -8]
ARGS=-a arm -b 64
EXPECT=<<EOF
a1835ff8
EOF
RUN
NAME=rz-asm -h~Usage?"
FILE==
CMDS=!rz-asm -h~Usage?
EXPECT=<<EOF
1
EOF
RUN
NAME=rz-asm -C
FILE==
CMDS=!rz-asm -C -a x86 -b 32 "mov eax, 33"
TOOL=rz-asm
FILE=mov eax, 33
ARGS=-C -a x86 -b 32
EXPECT=<<EOF
"\xb8\x21\x00\x00\x00"
EOF
RUN
NAME=rz-asm -d
FILE==
CMDS=!rz-asm -d -a x86 -b 32 "b821000000"
TOOL=rz-asm
ARGS=-d -a x86 -b 32 b821000000
EXPECT=<<EOF
mov eax, 0x21
EOF
RUN
NAME=rz-asm -D
FILE==
CMDS=!rz-asm -D -a x86 -b 32 "b821000000"
TOOL=rz-asm
ARGS=-D -a x86 -b 32 b821000000
EXPECT=<<EOF
0x00000000 5 b821000000 mov eax, 0x21
EOF
RUN
NAME=rz-asm -s
FILE==
CMDS=!rz-asm -s att -a x86 -b 32 -D "31ed"
TOOL=rz-asm
ARGS=-s att -a x86 -b 32 -D 31ed
EXPECT=<<EOF
0x00000000 2 31ed xor %ebp, %ebp
EOF
RUN
NAME=rz-asm -o
FILE==
CMDS=!rz-asm -s att -o 0xa -a x86 -b 32 -D "31ed"
TOOL=rz-asm
ARGS=-s att -o 0xa -a x86 -b 32 -D 31ed
EXPECT=<<EOF
0x0000000a 2 31ed xor %ebp, %ebp
EOF
RUN
NAME=rz-asm -F pseudo
FILE==
CMDS=!rz-asm -a x86 -b 32 -o 0xa -F x86.pseudo -D 31ed
TOOL=rz-asm
ARGS=-a x86 -b 32 -o 0xa -F x86.pseudo -D 31ed
EXPECT=<<EOF
0x0000000a 2 31ed ebp = 0
EOF
RUN
NAME=rz-asm -F
FILE==
CMDS=!rz-asm -o 0xa -a x86 -b 32 -D 31ed
TOOL=rz-asm
ARGS=-o 0xa -a x86 -b 32 -D 31ed
EXPECT=<<EOF
0x0000000a 2 31ed xor ebp, ebp
EOF
RUN
NAME=rz-asm -F -o order bug
FILE==
CMDS=!rz-asm -a x86 -b 32 -o 0xa -D 31ed
TOOL=rz-asm
ARGS=-a x86 -b 32 -o 0xa -D 31ed
EXPECT=<<EOF
0x0000000a 2 31ed xor ebp, ebp
EOF
RUN
NAME=rz-asm -B
FILE==
CMDS=!rz-asm -a x86 -b16 -B "xor al, 0x34";ps
TOOL=rz-asm
FILE=xor al, 0x34
ARGS=-a x86 -b16 -B
EXPECT=44
RUN
NAME=rz-asm -v~commit?"
FILE==
CMDS=!rz-asm -v~commit?
EXPECT=<<EOF
1
EOF
RUN
NAME=rz-asm -w
FILE==
CMDS=!rz-asm -w -a x86 -b 32 "mov"
TOOL=rz-asm
ARGS=-w -a x86 -b 32 mov
EXPECT=<<EOF
moves data from src to dst
EOF
RUN
NAME=rz-asm dissassemble ARM32 binary file
FILE==
CMDS=!rz-asm -DB -a arm -o 0x200 -b 32 -f bins/other/rz-asm/testARM32.bin
TOOL=rz-asm
FILE=bins/other/rz-asm/testARM32.bin
ARGS=-DB -a arm -o 0x200 -b 32 -f
EXPECT=<<EOF
0x00000200 4 4661b0e1 asrs r6, r6, 2
0x00000204 4 f087bd08 popeq {r4, r5, r6, r7, r8, sb, sl, pc}
@ -294,8 +246,8 @@ EOF
RUN
NAME=rz-asm dissassemble ARM32 binary file with skip
FILE==
CMDS=!rz-asm -DB -a arm -o 0x200 -b 32 -f bins/other/rz-asm/testARM32.bin -i 4
TOOL=rz-asm
ARGS=-DB -a arm -o 0x200 -b 32 -f bins/other/rz-asm/testARM32.bin -i 4
EXPECT=<<EOF
0x00000200 4 f087bd08 popeq {r4, r5, r6, r7, r8, sb, sl, pc}
0x00000204 4 0040a0e3 mov r4, 0
@ -310,32 +262,32 @@ EOF
RUN
NAME=rz-asm endian test 1
FILE==
CMDS=!rz-asm -e -a arm -b 32 -d 0ad0a0e1
TOOL=rz-asm
ARGS=-e -a arm -b 32 -d 0ad0a0e1
EXPECT=<<EOF
beq 0xff42838c
EOF
RUN
NAME=rz-asm endian test 2
FILE==
CMDS=!rz-asm -e -a arm -b 32 -d fff0a0e3
TOOL=rz-asm
ARGS=-e -a arm -b 32 -d fff0a0e3
EXPECT=<<EOF
invalid
EOF
RUN
NAME=rz-asm SPP include directive
FILE==
CMDS=!rz-asm -a x86 -b 32 -p -f bins/other/rz-asm/asm/include.asm
TOOL=rz-asm
ARGS=-a x86 -b 32 -p -f bins/other/rz-asm/asm/include.asm
EXPECT=<<EOF
9083e803bb00000000cd80c3
EOF
RUN
NAME=rz-asm SPP nested conditionals
FILE==
CMDS=!rz-asm -a x86 -b 32 -p -f bins/other/rz-asm/asm/nest.asm
TOOL=rz-asm
ARGS=-a x86 -b 32 -p -f bins/other/rz-asm/asm/nest.asm
EXPECT=<<EOF
83c10283e90583c301b90200000090
EOF
@ -346,32 +298,34 @@ EOF
RUN
NAME=rz-asm x86.asm.32
FILE==
CMDS=!rz-asm -f bins/elf/analysis/hello.asm
TOOL=rz-asm
ARGS=-f bins/elf/analysis/hello.asm
EXPECT=<<EOF
ba0e000000b91d000000bb01000000b804000000cd80b801000000cd8048656c6c6f2c20776f726c64210a00
EOF
RUN
NAME=rz-asm bswap x64 #8095
FILE==
CMDS=!rz-asm -a x86 -b 64 "bswap rax;bswap rbx;bswap rcx;bswap rdx"
TOOL=rz-asm
FILE=bswap rax;bswap rbx;bswap rcx;bswap rdx
ARGS=-a x86 -b 64
EXPECT=<<EOF
480fc8480fcb480fc9480fca
EOF
RUN
NAME=rz-asm mov eax, [eax * 2 + 8]
FILE==
CMDS=!rz-asm -a x86 -b 32 "mov eax, [eax * 2 + 8]"
TOOL=rz-asm
FILE=mov eax, [eax * 2 + 8]
ARGS=-a x86 -b 32
EXPECT=<<EOF
8b044508000000
EOF
RUN
NAME=rz-asm -a x86 -b 64 -A 0x55
FILE==
CMDS=!rz-asm -a x86 -b 64 -A 0x55
TOOL=rz-asm
ARGS=-a x86 -b 64 -A 0x55
EXPECT=<<EOF
offset: 0x00000000
bytes: 55
@ -384,55 +338,32 @@ EOF
RUN
NAME=rz-asm -c
FILE==
CMDS=!rz-asm -a arm -b 16 -d -c cortexm 0x80f30988
TOOL=rz-asm
ARGS=-a arm -b 16 -d -c cortexm 0x80f30988
EXPECT=<<EOF
msr psp, r0
EOF
RUN
NAME=rz-asm -A with -c and -o
BROKEN=1 # See: https://github.com/rizinorg/rizin/issues/3694
FILE==
CMDS=!rz-asm -a arm -b 16 -A -o 0x1000 -c cortexm 0x80f30988
EXPECT=<<EOF
offset: 0x00001000
bytes: 80f30988
type: mov
stackop: null
esil: 0,0xFF,|,DUP,!,SWAP,&,r0,SWAP,cpsr,&,|,cpsr,=
stackptr: 0
EOF
RUN
NAME=rz-asm -a x86 -b 64 -E 0x55
FILE==
CMDS=!rz-asm -a x86 -b 64 -E 0x55
TOOL=rz-asm
ARGS=-a x86 -b 64 -E 0x55
EXPECT=<<EOF
rbp,8,rsp,-,=[8],8,rsp,-=
EOF
RUN
NAME=rz-asm -a x86 -b 64 -Aj 0x55
FILE==
CMDS=!rz-asm -a x86 -b 64 -Aj 0x55
TOOL=rz-asm
ARGS=-a x86 -b 64 -Aj 0x55
EXPECT=<<EOF
[{"opcode":0,"bytes":"55","type":"rpush","stackop":"unknown","esil":"rbp,8,rsp,-,=[8],8,rsp,-=","stackptr":8}]
EOF
RUN
NAME=rz-asm -v
FILE==
CMDS=!rz-asm -v | grep -c commit
EXPECT=<<EOF
1
EOF
RUN
NAME=rz-asm -a x86 -b 64 -r push ebp
FILE==
CMDS=!rz-asm -a x86 -b 64 -r push ebp
TOOL=rz-asm
ARGS=-a x86 -b 64 -r push ebp
EXPECT=<<EOF
e asm.arch=x86
e asm.bits=64
@ -443,8 +374,9 @@ EOF
RUN
NAME=rz-asm -a sh -e -d
FILE==
CMDS=!rz-asm -a sh -e -d "8d00 000b 2029 8ffb 0009 420b 31e0"
TOOL=rz-asm
FILE=8d00 000b 2029 8ffb 0009 420b 31e0
ARGS=-a sh -e -d
EXPECT=<<EOF
bt/s 0x00000004
rts
@ -457,8 +389,9 @@ EOF
RUN
NAME=rz-asm -a sh -e -D
FILE==
CMDS=!rz-asm -a sh -e -D "8d00 000b 2029 8ffb 0009 420b 31e0"
TOOL=rz-asm
FILE=8d00 000b 2029 8ffb 0009 420b 31e0
ARGS=-a sh -e -D
EXPECT=<<EOF
0x00000000 2 8d00 bt/s 0x00000004
0x00000002 2 000b rts
@ -471,8 +404,9 @@ EOF
RUN
NAME=rz-asm -a sh -d
FILE==
CMDS=!rz-asm -a sh -d "008d 0b00 2920 fb8f 0900 0b42 e031"
TOOL=rz-asm
FILE=008d 0b00 2920 fb8f 0900 0b42 e031
ARGS=-a sh -d
EXPECT=<<EOF
bt/s 0x00000004
rts
@ -485,8 +419,9 @@ EOF
RUN
NAME=rz-asm -a sh -D
FILE==
CMDS=!rz-asm -a sh -D "008d 0b00 2920 fb8f 0900 0b42 e031"
TOOL=rz-asm
FILE=008d 0b00 2920 fb8f 0900 0b42 e031
ARGS=-a sh -D
EXPECT=<<EOF
0x00000000 2 008d bt/s 0x00000004
0x00000002 2 0b00 rts
@ -498,118 +433,142 @@ EXPECT=<<EOF
EOF
RUN
NAME=rz-asm -a ppc.as -b 64 "std r31, -8(r1)"
FILE==
BROKEN=1
CMDS=!rz-asm -a ppc.as -b 64 "std r31, -8(r1)"
EXPECT=<<EOF
f8ffe1fb
EOF
RUN
NAME=rz-asm -a ppc -b 64 -d f8ffe1fb
FILE==
CMDS=!rz-asm -a ppc -b 64 -d f8ffe1fb
TOOL=rz-asm
ARGS=-a ppc -b 64 -d f8ffe1fb
EXPECT=<<EOF
std r31, -8(r1)
EOF
RUN
NAME=rz-asm -a ppc.as -b 32 -e "mr r10, r4"
FILE==
BROKEN=1
CMDS=!rz-asm -a ppc.as -b 32 -e "mr r10, r4"
TOOL=rz-asm
FILE=mr r10, r4
ARGS=-a ppc.as -b 32 -e
EXPECT=<<EOF
7c8a2378
EOF
RUN
NAME=rz-asm -a ppc -b 32 -d 78238a7c
FILE==
CMDS=!rz-asm -a ppc -b 32 -d 78238a7c
TOOL=rz-asm
ARGS=-a ppc -b 32 -d 78238a7c
EXPECT=<<EOF
mr r10, r4
EOF
RUN
NAME=rz-asm -a arm.as -b 16 "wfe"
FILE==
NAME=rz-asm #1900
TOOL=rz-asm
FILE=mov [0x33], eax
ARGS=-a x86 -b 32
EXPECT=<<EOF
890533000000
EOF
RUN
NAME=rz-asm #1900
TOOL=rz-asm
FILE=mov eax, 33
ARGS=-a x86 -b 32
EXPECT=<<EOF
b821000000
EOF
RUN
NAME=rz-asm #1900
TOOL=rz-asm
FILE=mov eax, 0x33
ARGS=-a x86 -b 32
EXPECT=<<EOF
b833000000
EOF
RUN
NAME=rz-asm x86_64 overlarge operand
TOOL=rz-asm
FILE=mov rax, 0x112233445566778899
ARGS=-a x86 -b 64
EXIT_STATUS=1
EXPECT=
EXPECT_ERR=<<EOF
ERROR: Cannot assemble 'mov rax, 0x112233445566778899' at line 3
EOF
RUN
NAME=rz-asm -a ppc.as -b 64 "std r31, -8(r1)"
BROKEN=1
CMDS=!rz-asm -a arm.as -b 16 "wfe"
TOOL=rz-asm
FILE=std r31, -8(r1)
ARGS=-a ppc.as -b 64
EXPECT=<<EOF
f8ffe1fb
EOF
RUN
NAME=rz-asm -a arm.as -b 16 "wfe"
BROKEN=1
TOOL=rz-asm
FILE=wfe
ARGS=-a arm.as -b 16
EXPECT=<<EOF
20bf
EOF
RUN
NAME=rz-asm -a arm.as -b 32 "add fp, sp, 0"
FILE==
BROKEN=1
CMDS=!rz-asm -a arm.as -b 32 "add fp, sp, 0"
TOOL=rz-asm
FILE=add fp, sp, 0
ARGS=-a arm.as -b 32
EXPECT=<<EOF
00b08de2
EOF
RUN
NAME=rz-asm -a arm.as -b 32 -e "ldr fp, [sp], 4"
FILE==
BROKEN=1
CMDS=!rz-asm -a arm.as -b 32 -e "ldr fp, [sp], 4"
TOOL=rz-asm
FILE=ldr fp, [sp], 4
ARGS=-a arm.as -b 32 -e
EXPECT=<<EOF
e49db004
EOF
RUN
NAME=rz-asm -a arm.as -b 64 "sub sp, sp, 16"
FILE==
BROKEN=1
CMDS=!rz-asm -a arm.as -b 64 "sub sp, sp, 16"
TOOL=rz-asm
FILE=sub sp, sp, 16
ARGS=-a arm.as -b 64
EXPECT=<<EOF
ff4300d1
EOF
RUN
NAME=rz-asm RzIL
FILE=
CMDS=<<EOF
!rz-asm -a bf -I 3e
%v $?
EOF
TOOL=rz-asm
ARGS=-a bf -I 3e
EXPECT=<<EOF
(set ptr (+ (var ptr) (bv 64 0x1)))
0x0
EOF
EXPECT_ERR=
RUN
NAME=rz-asm RzIL failure
FILE=
CMDS=<<EOF
!rz-asm -a bf -I 00
%v $?
EOF
EXPECT=<<EOF
0x1
EOF
TOOL=rz-asm
ARGS=-a bf -I 00
EXIT_STATUS=1
EXPECT=
EXPECT_ERR=<<EOF
Invalid instruction of lifting not implemented.
EOF
RUN
NAME=rz-asm print cpus
FILE=
CMDS=<<EOF
!rz-asm -m mips
!rz-asm -m xtensa
!rz-asm -m arm
!rz-asm -m avr
!rz-asm -m m680x
!rz-asm -m m68k
!rz-asm -m pic
!rz-asm -m ppc
!rz-asm -m sparc
!rz-asm -m tms320
!rz-asm -m tricore
EOF
NAME=rz-asm cpu mips
TOOL=rz-asm
ARGS=-m mips
EXPECT=<<EOF
mips3 MIPS III architecture.
mips1 MIPS I architecture
@ -642,14 +601,35 @@ r3000 R3000 MIPS cpu
r10000 R10000 MIPS cpu
noptr64 Special MIPS configuration to disable support for 64-bit pointers
nofloat Special MIPS configuration to disable support for floating-points
EOF
RUN
NAME=rz-asm cpu xtensa
TOOL=rz-asm
ARGS=-m xtensa
EXPECT=<<EOF
esp32 Xtensa microcontroller with Wi-Fi and Bluetooth capabilities
esp32s2 Xtensa microcontroller with Wi-Fi and USB OTG support
esp8266 Xtensa microcontroller with Wi-Fi support
EOF
RUN
NAME=rz-asm cpu arm
TOOL=rz-asm
ARGS=-m arm
EXPECT=<<EOF
v8 ARMv8 version
cortexm ARM Cortex-M family
arm1176 ARM1176JZ(F)-S processor, ARMv6 version
cortexA72 ARM Cortex-A72 processor, ARMv8-A version
cortexA8 ARM Cortex-A8, ARMv7-A version
EOF
RUN
NAME=rz-asm cpu avr
TOOL=rz-asm
ARGS=-m avr
EXPECT=<<EOF
ATmega8 8-bit AVR microcontroller with 8KB Flash, 1KB SRAM
ATmega1280 8-bit AVR microcontroller with 128KB Flash, 8KB SRAM
ATmega1281 8-bit AVR microcontroller with 128KB Flash, 8KB SRAM
@ -665,6 +645,13 @@ ATmega88 8-bit AVR microcontroller with 8KB Flash, 1KB SRAM
ATxmega128a4u 8-bit AVR microcontroller with 128KB Flash, 8KB SRAM
ATTiny48 8-bit AVR microcontroller with 4KB Flash, 256B SRAM
ATTiny88 8-bit AVR microcontroller with 8KB Flash, 512B SRAM
EOF
RUN
NAME=rz-asm cpu m680x
TOOL=rz-asm
ARGS=-m m680x
EXPECT=<<EOF
6800 Motorola 6800: 8-bit microprocessor launched in 1974
6801 Motorola 6801: Enhanced version of the 6800 with additional features like on-chip RAM and timers.
6802 Motorola 6802: Enhanced version of the 6800 with 128 bytes of on-chip RAM and internal clock
@ -678,37 +665,67 @@ cpu12 Motorola 68HC12: 16-bit microcontroller (also abbreviated as 681
6301 Hitachi 6301: 8-bit microcontroller, CMOS version of 6800
6309 Hitachi 6309: CMOS version of 6809
hcs08 Freescale HCS08: 8-bit microcontroller family
EOF
RUN
NAME=rz-asm cpu m68k
TOOL=rz-asm
ARGS=-m m68k
EXPECT=<<EOF
68000 Motorola 68000: 16/32-bit CISC microprocessor
68010 Motorola 68010: 16/32-bit microprocessors. Successor to Motoroloa 68000
68020 Motorola 68020: 32-bit microprocessor with added instructions and additional addressing modes
68030 Motorola 68030: Enhanced 32-bit microprocessor with integrated MMU
68040 Motorola 68040: High-performance 32-bit microprocessor with integrated FPU
68060 Motorola 68060: 32-bit microprocessor, highest performer in m68k series
EOF
RUN
NAME=rz-asm cpu pic
TOOL=rz-asm
ARGS=-m pic
EXPECT=<<EOF
baseline Baseline 12-bit instruction set microcontrollers: PIC10Fxxx, PIC12Fxxx, and PIC16Fxxx
midrange Mid-Range 14-bit instruction set microcontrollers: PIC10Fxxx, PIC12Fxxx, and PIC16Fxxx
highend High-End 16-bit instruction set microcontrollers: PIC18Fxxxx, PIC18FxxJxx, and PIC18FxxKxx
pic18 alias for highend
EOF
RUN
NAME=rz-asm cpu ppc
TOOL=rz-asm
ARGS=-m ppc
EXPECT=<<EOF
ppc Generic PowerPC CPU
vle PowerPC with Variable Length Encoding extension
ps PowerPC with Paired Single SIMD extension
qpx PowerPC with Quad Processing eXtensions
EOF
RUN
NAME=rz-asm cpu sparc
TOOL=rz-asm
ARGS=-m sparc
EXPECT=<<EOF
v9 SPARC V9: 64-bit RISC architecture specification
EOF
RUN
NAME=rz-asm cpu tms320
TOOL=rz-asm
ARGS=-m tms320
EXPECT=<<EOF
c54x Texas Instruments TMS320C54x DSP family
c55x Texas Instruments TMS320C55x DSP family
c55x+ Texas Instruments TMS320C55x+ DSP family
c64x Texas Instruments TMS320C64x DSP family
tricore Generic TriCore CPU family by Infineon
EOF
RUN
NAME=rz-asm invalid skip
FILE=
CMDS=<<EOF
!rz-asm -i 6 -E 'mov eax, 30'
EOF
NAME=rz-asm cpu tricore
TOOL=rz-asm
ARGS=-m tricore
EXPECT=<<EOF
EOF
EXPECT_ERR=<<EOF
rz-asm: invalid skip value (skip 12 > 11 len).
tricore Generic TriCore CPU family by Infineon
EOF
RUN

View file

@ -1,30 +1,30 @@
NAME=rz-ax -I 3530468537
FILE==
CMDS=!rz-ax -I 3530468537
TOOL=rz-ax
ARGS=-I 3530468537
EXPECT=<<EOF
185.172.110.210
EOF
RUN
NAME=rz-ax -I 185.172.110.210
FILE==
CMDS=!rz-ax -I 185.172.110.210
TOOL=rz-ax
ARGS=-I 185.172.110.210
EXPECT=<<EOF
0xd26eacb9
EOF
RUN
NAME=rz-ax =10 0x46
FILE==
CMDS=!rz-ax =10 0x46
TOOL=rz-ax
ARGS==10 0x46
EXPECT=<<EOF
70
EOF
RUN
NAME=rz-ax =16 0x3+0x3
FILE==
CMDS=!rz-ax =16 0x3+0x3
TOOL=rz-ax
ARGS==16 0x3+0x3
EXPECT=<<EOF
0x6
EOF
@ -81,148 +81,148 @@ EOF
RUN
NAME=rz-ax -b 01101000011001010110110001101100011011110111011101101111011100100110110001100100
FILE==
CMDS=!rz-ax -b 01101000011001010110110001101100011011110111011101101111011100100110110001100100
TOOL=rz-ax
ARGS=-b 01101000011001010110110001101100011011110111011101101111011100100110110001100100
EXPECT=helloworld
RUN
NAME=rz-ax -B hello world
FILE==
CMDS=!rz-ax -B hello world
TOOL=rz-ax
ARGS=-B hello world
EXPECT=01101000011001010110110001101100011011110111011101101111011100100110110001100100
RUN
NAME=rz-ax 10
FILE==
CMDS=!rz-ax 10
TOOL=rz-ax
ARGS=10
EXPECT=<<EOF
0xa
EOF
RUN
NAME=rz-ax 0xa
FILE==
CMDS=!rz-ax 0xa
TOOL=rz-ax
ARGS=0xa
EXPECT=<<EOF
10
EOF
RUN
NAME=rz-ax -1
FILE==
CMDS=!rz-ax -1
TOOL=rz-ax
ARGS=-1
EXPECT=<<EOF
0xffffffffffffffff
EOF
RUN
NAME=rz-ax 0xffffffffffffffff
FILE==
CMDS=!rz-ax 0xffffffffffffffff
TOOL=rz-ax
ARGS=0xffffffffffffffff
EXPECT=<<EOF
-1
EOF
RUN
NAME=rz-ax b30
FILE==
CMDS=!rz-ax b3
TOOL=rz-ax
ARGS=b3
EXPECT=<<EOF
11b
EOF
RUN
NAME=rz-ax t42
FILE==
CMDS=!rz-ax t42
TOOL=rz-ax
ARGS=t42
EXPECT=<<EOF
1120t
EOF
RUN
NAME=rz-ax 1010d
FILE==
CMDS=!rz-ax 1010d
TOOL=rz-ax
ARGS=1010d
EXPECT=<<EOF
10
EOF
RUN
NAME=rz-ax 3.33f
FILE==
CMDS=!rz-ax 3.33f
TOOL=rz-ax
ARGS=3.33f
EXPECT=<<EOF
Fx40551eb8
EOF
RUN
NAME=rz-ax Fx40551ed8
FILE==
CMDS=!rz-ax Fx40551ed8
TOOL=rz-ax
ARGS=Fx40551ed8
EXPECT=<<EOF
3.330008f
EOF
RUN
NAME=rz-ax 35o
FILE==
CMDS=!rz-ax 35o
TOOL=rz-ax
ARGS=35o
EXPECT=<<EOF
0x1d
EOF
RUN
NAME=rz-ax Ox12
FILE==
CMDS=!rz-ax Ox12
TOOL=rz-ax
ARGS=Ox12
EXPECT=<<EOF
022
EOF
RUN
NAME=rz-ax 1100011b
FILE==
CMDS=!rz-ax 1100011b
TOOL=rz-ax
ARGS=1100011b
EXPECT=<<EOF
0x63
EOF
RUN
NAME=rz-ax Bx63
FILE==
CMDS=!rz-ax Bx63
TOOL=rz-ax
ARGS=Bx63
EXPECT=<<EOF
1100011b
EOF
RUN
NAME=rz-ax Bxffff0000ffff0101
FILE==
CMDS=!rz-ax Bxffff0000ffff0101
TOOL=rz-ax
ARGS=Bxffff0000ffff0101
EXPECT=<<EOF
1111111111111111000000000000000011111111111111110000000100000001b
EOF
RUN
NAME=rz-ax 64bit binary number
FILE==
CMDS=!rz-ax 1111111111111111000000000000000011111111111111110000000100000001b
TOOL=rz-ax
ARGS=1111111111111111000000000000000011111111111111110000000100000001b
EXPECT=<<EOF
0xffff0000ffff0101
EOF
RUN
NAME=rz-ax Tx23
FILE==
CMDS=!rz-ax Tx23
TOOL=rz-ax
ARGS=Tx23
EXPECT=<<EOF
1022t
EOF
RUN
NAME=rz-ax Tx23
FILE==
CMDS=!rz-ax Tx23
TOOL=rz-ax
ARGS=Tx23
EXPECT=<<EOF
1022t
EOF
@ -243,70 +243,70 @@ EXPECT=AAA
RUN
NAME=rz-ax -b 01000101 01110110
FILE==
CMDS=!rz-ax -b 01000101 01110110
TOOL=rz-ax
ARGS=-b 01000101 01110110
EXPECT=Ev
RUN
NAME=rz-ax -k 33+3
FILE==
CMDS=!rz-ax -k 33+3
TOOL=rz-ax
ARGS=-k 33+3
EXPECT=<<EOF
36
EOF
RUN
NAME=rz-ax -e 0x00000401
FILE==
CMDS=!rz-ax -e 0x00000401
TOOL=rz-ax
ARGS=-e 0x00000401
EXPECT=<<EOF
17039360
EOF
RUN
NAME=rz-ax -f 6.3+2.1
FILE==
CMDS=!rz-ax -f 6.3+2.1
TOOL=rz-ax
ARGS=-f 6.3+2.1
EXPECT=<<EOF
8.4
EOF
RUN
NAME=rz-ax -n 0x1234
FILE==
CMDS=!rz-ax -n 0x1234
TOOL=rz-ax
ARGS=-n 0x1234
EXPECT=<<EOF
34120000
EOF
RUN
NAME=rz-ax -n 0xFEDCBA9876543210
FILE==
CMDS=!rz-ax -n 0xFEDCBA9876543210
TOOL=rz-ax
ARGS=-n 0xFEDCBA9876543210
EXPECT=<<EOF
1032547698badcfe
EOF
RUN
NAME=rz-ax -N 0xFEDCBA9876543210
FILE==
CMDS=!rz-ax -N 0xFEDCBA9876543210
TOOL=rz-ax
ARGS=-N 0xFEDCBA9876543210
EXPECT=<<EOF
\x10\x32\x54\x76\x98\xba\xdc\xfe
EOF
RUN
NAME=rz-ax -N 0x1234
FILE==
CMDS=!rz-ax -N 0x1234
TOOL=rz-ax
ARGS=-N 0x1234
EXPECT=<<EOF
\x34\x12\x00\x00
EOF
RUN
NAME=rz-ax -d 3
FILE==
CMDS=!rz-ax -d 3
TOOL=rz-ax
ARGS=-d 3
EXPECT=<<EOF
3
EOF
@ -369,28 +369,31 @@ EOF
RUN
NAME=rz-ax -s 43 4a 50
FILE==
CMDS=!rz-ax -s 43 4a 50
TOOL=rz-ax
ARGS=-s 43 4a 50
EXPECT=CJP
RUN
NAME=rz-ax -s 434a50
FILE==
CMDS=!rz-ax -s 434a50
TOOL=rz-ax
ARGS=-s 434a50
EXPECT=CJP
RUN
NAME=rz-ax -S "hello\x2Aworld ZYX\234abc\n"
FILE==
CMDS=!rz-ax -S "hello\x2Aworld ZYX\234abc\n"
TOOL=rz-ax
FILE=hello\x2Aworld ZYX\234abc\n
ARGS=-S
EXPECT=<<EOF
68656c6c6f2a776f726c64205a59589c6162630a
EOF
RUN
NAME=rz-ax -t "1234567890 GMT-1"
FILE==
CMDS=!rz-ax -t "1234567890 GMT-1" | cut -d " " -f 1,2
TOOL=rz-ax
FILE=1234567890 GMT-1
ARGS=-t
REGEXP_FILTER_OUT=Fri Feb
EXPECT=<<EOF
Fri Feb
EOF
@ -407,8 +410,8 @@ EOF
RUN
NAME=rz-ax -x linux osx
FILE==
CMDS=!rz-ax -x linux osx
TOOL=rz-ax
ARGS=-x linux osx
EXPECT=<<EOF
0x5ca62a43
0xad593a1
@ -416,24 +419,16 @@ EOF
RUN
NAME=rz-ax -u 3000
FILE==
CMDS=!rz-ax -u 3000
TOOL=rz-ax
ARGS=-u 3000
EXPECT=<<EOF
2.9K
EOF
RUN
NAME=rz-ax -h~Usage?"
FILE==
CMDS=!rz-ax -h~Usage?
EXPECT=<<EOF
1
EOF
RUN
NAME=long number conversion
FILE==
CMDS=!rz-ax 10000000000000000000000000000000000000000000000b
TOOL=rz-ax
ARGS=10000000000000000000000000000000000000000000000b
EXPECT=<<EOF
0x400000000000
EOF
@ -448,80 +443,147 @@ EOF
RUN
NAME=rz-ax -121.875f
FILE==
CMDS=!rz-ax -121.875f
TOOL=rz-ax
ARGS=-121.875f
EXPECT=<<EOF
Fxc2f3c000
EOF
RUN
NAME=rz-ax -0xf
FILE==
CMDS=!rz-ax -0xf
TOOL=rz-ax
ARGS=-0xf
EXPECT=<<EOF
-15
EOF
RUN
NAME=rz-ax -L 0
FILE==
CMDS=!rz-ax -L 0
TOOL=rz-ax
ARGS=-L 0
EXPECT=<<EOF
0x0
EOF
RUN
NAME=rz-ax -L 1
FILE==
CMDS=!rz-ax -L 1
TOOL=rz-ax
ARGS=-L 1
EXPECT=<<EOF
0x1
EOF
RUN
NAME=rz-ax -L 10000010100001001000011010001000100010101000110010001110100100001001001010010100100101101001100010011010100111001001111
FILE==
CMDS=!rz-ax -L 10000010100001001000011010001000100010101000110010001110100100001001001010010100100101101001100010011010100111001001111
TOOL=rz-ax
ARGS=-L 10000010100001001000011010001000100010101000110010001110100100001001001010010100100101101001100010011010100111001001111
EXPECT=<<EOF
0x4142434445464748494a4b4c4d4e4f
EOF
RUN
NAME=rz-ax -L 00000000000000000000000000000000000000000000000000000000000000000
FILE==
CMDS=!rz-ax -L 00000000000000000000000000000000000000000000000000000000000000000
TOOL=rz-ax
ARGS=-L 00000000000000000000000000000000000000000000000000000000000000000
EXPECT=<<EOF
0x0
EOF
RUN
NAME=rz-ax -L 11111111111111111111111111111111111111111111111111111111111111111
FILE==
CMDS=!rz-ax -L 11111111111111111111111111111111111111111111111111111111111111111
TOOL=rz-ax
ARGS=-L 11111111111111111111111111111111111111111111111111111111111111111
EXPECT=<<EOF
0x1ffffffffffffffff
EOF
RUN
NAME=rz-ax -ke 0xdeadbeef
FILE==
CMDS=!rz-ax -ke 0xdeadbeef
TOOL=rz-ax
ARGS=-ke 0xdeadbeef
EXPECT=<<EOF
0xefbeadde
EOF
RUN
NAME=rz-ax -a
FILE==
CMDS=!rz-ax -a | grep -c ASCII
TOOL=rz-ax
ARGS=-a
EXPECT=<<EOF
1
The following table contains the 128 ASCII characters.
Oct Dec Hex Char Oct Dec Hex Char
────────────────────────────────────────────────────────────────────────
000 0 00 NUL '\0' (null character) 100 64 40 @
001 1 01 SOH (start of heading) 101 65 41 A
002 2 02 STX (start of text) 102 66 42 B
003 3 03 ETX (end of text) 103 67 43 C
004 4 04 EOT (end of transmission) 104 68 44 D
005 5 05 ENQ (enquiry) 105 69 45 E
006 6 06 ACK (acknowledge) 106 70 46 F
007 7 07 BEL '\a' (bell) 107 71 47 G
010 8 08 BS '\b' (backspace) 110 72 48 H
011 9 09 HT '\t' (horizontal tab) 111 73 49 I
012 10 0A LF '\n' (new line) 112 74 4A J
013 11 0B VT '\v' (vertical tab) 113 75 4B K
014 12 0C FF '\f' (form feed) 114 76 4C L
015 13 0D CR '\r' (carriage ret) 115 77 4D M
016 14 0E SO (shift out) 116 78 4E N
017 15 0F SI (shift in) 117 79 4F O
020 16 10 DLE (data link escape) 120 80 50 P
021 17 11 DC1 (device control 1) 121 81 51 Q
022 18 12 DC2 (device control 2) 122 82 52 R
023 19 13 DC3 (device control 3) 123 83 53 S
024 20 14 DC4 (device control 4) 124 84 54 T
025 21 15 NAK (negative ack.) 125 85 55 U
026 22 16 SYN (synchronous idle) 126 86 56 V
027 23 17 ETB (end of trans. blk) 127 87 57 W
030 24 18 CAN (cancel) 130 88 58 X
031 25 19 EM (end of medium) 131 89 59 Y
032 26 1A SUB (substitute) 132 90 5A Z
033 27 1B ESC (escape) 133 91 5B [
034 28 1C FS (file separator) 134 92 5C \ '\\'
035 29 1D GS (group separator) 135 93 5D ]
036 30 1E RS (record separator) 136 94 5E ^
037 31 1F US (unit separator) 137 95 5F _
040 32 20 SPACE 140 96 60 `
041 33 21 ! 141 97 61 a
042 34 22 " 142 98 62 b
043 35 23 # 143 99 63 c
044 36 24 $ 144 100 64 d
045 37 25 % 145 101 65 e
046 38 26 & 146 102 66 f
047 39 27 ' 147 103 67 g
050 40 28 ( 150 104 68 h
051 41 29 ) 151 105 69 i
052 42 2A * 152 106 6A j
053 43 2B + 153 107 6B k
054 44 2C , 154 108 6C l
055 45 2D - 155 109 6D m
056 46 2E . 156 110 6E n
057 47 2F / 157 111 6F o
060 48 30 0 160 112 70 p
061 49 31 1 161 113 71 q
062 50 32 2 162 114 72 r
063 51 33 3 163 115 73 s
064 52 34 4 164 116 74 t
065 53 35 5 165 117 75 u
066 54 36 6 166 118 76 v
067 55 37 7 167 119 77 w
070 56 38 8 170 120 78 x
071 57 39 9 171 121 79 y
072 58 3A : 172 122 7A z
073 59 3B ; 173 123 7B {
074 60 3C < 174 124 7C |
075 61 3D = 175 125 7D }
076 62 3E > 176 126 7E ~
077 63 3F ? 177 127 7F DEL
EOF
RUN
NAME=rz-ax -w 16 0xffff
FILE==
CMDS=!rz-ax -w 16 0xffff
TOOL=rz-ax
ARGS=-w 16 0xffff
EXPECT=<<EOF
16
-1
@ -540,30 +602,23 @@ EOF
RUN
NAME=rz-ax -o
FILE==
CMDS=!rz-ax -o 162 62
TOOL=rz-ax
ARGS=-o 162 62
EXPECT=r2
RUN
NAME=rz-ax -r 0x1234
FILE==
CMDS=!rz-ax -r 0x1234 | grep -c octal
TOOL=rz-ax
ARGS=-r 0x1234
REGEXP_FILTER_OUT=octal.+
EXPECT=<<EOF
1
EOF
RUN
NAME=rz-ax -v
FILE==
CMDS=!rz-ax -v | grep -c commit
EXPECT=<<EOF
1
octal 011064
EOF
RUN
NAME=rz-ax -p
FILE==
CMDS=!rz-ax -p 0xb3
TOOL=rz-ax
ARGS=-p 0xb3
EXPECT=<<EOF
[0-1]: 1
[4-5]: 1
@ -572,8 +627,8 @@ EOF
RUN
NAME=rz-ax -p
FILE==
CMDS=!rz-ax -p 110
TOOL=rz-ax
ARGS=-p 110
EXPECT=<<EOF
[1-3]: 1
[5-6]: 1

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
NAME=rz-find -X -s
FILE==
CMDS=!rz-find -X -s 250382 bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-X -s 250382 bins/elf/ioli/crackme0x00
EXPECT=<<EOF
0x58f
- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
@ -13,46 +13,47 @@ EOF
RUN
NAME=rz-find -r -X -s
FILE==
CMDS=!rz-find -r -X -s 250382 bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-r -X -s 250382 bins/elf/ioli/crackme0x00
EXPECT=<<EOF
f hit0_0 @ 0x0000058f ; bins/elf/ioli/crackme0x00
EOF
RUN
NAME=rz-find -f 0x00000000 -t 0x00000590 -r -X -s
FILE==
CMDS=!rz-find -f 0x00000000 -t 0x00001000 -r -X -s 250382 bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-f 0x00000000 -t 0x00001000 -r -X -s 250382 bins/elf/ioli/crackme0x00
EXPECT=<<EOF
f hit0_0 @ 0x0000058f ; bins/elf/ioli/crackme0x00
EOF
RUN
NAME=rz-find -f 0x00010000 -t 0x00020000 -X -s
FILE==
CMDS=!rz-find -f 0x00010000 -t 0x00020000 -r -X -s 250382 bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-f 0x00010000 -t 0x00020000 -r -X -s 250382 bins/elf/ioli/crackme0x00
EXIT_STATUS=1
EXPECT=
RUN
NAME=rz-find -r -X -x
FILE==
CMDS=!rz-find -r -X -x 323530333832 bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-r -X -x 323530333832 bins/elf/ioli/crackme0x00
EXPECT=<<EOF
f hit0_0 @ 0x0000058f ; bins/elf/ioli/crackme0x00
EOF
RUN
NAME=rz-find -r -X -x with nibbles masked
FILE==
CMDS=!rz-find -r -X -x caf.bab. bins/java/Hello.class
TOOL=rz-find
ARGS=-r -X -x caf.bab. bins/java/Hello.class
EXPECT=<<EOF
f hit0_0 @ 0x00000000 ; bins/java/Hello.class
EOF
RUN
NAME=rz-find -r -X -x with bin mask
FILE==
CMDS=!rz-find -r -X -x caf3bab3 -M fff0fff0 bins/java/Hello.class
TOOL=rz-find
ARGS=-r -X -x caf3bab3 -M fff0fff0 bins/java/Hello.class
EXPECT=<<EOF
f hit0_0 @ 0x00000000 ; bins/java/Hello.class
EOF
@ -77,32 +78,33 @@ EOF
RUN
NAME=rz-find can't open
FILE==
CMDS=!rz-find -n -f 0x00010000 -t 0x00020000 -r -X -s 250382 incorrect_file
TOOL=rz-find
ARGS=-n -f 0x00010000 -t 0x00020000 -r -X -s 250382 incorrect_file
EXIT_STATUS=1
EXPECT_ERR=<<EOF
Cannot open file 'incorrect_file'
EOF
RUN
NAME=rz-find
FILE==
CMDS=!rz-find -s 250382 bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-s 250382 bins/elf/ioli/crackme0x00
EXPECT=<<EOF
0x58f
EOF
RUN
NAME=rz-find -i
FILE==
CMDS=!rz-find -i bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-i bins/elf/ioli/crackme0x00
EXPECT=<<EOF
0x00000000 ELF 32-bit LSB executable, Intel 80386, version 1
EOF
RUN
NAME=rz-find -m
FILE==
CMDS=!rz-find -m bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-m bins/elf/ioli/crackme0x00
EXPECT=<<EOF
0x00000000 0 hit.magic.0 ELF 32-bit LSB executable, Intel 80386, version 1
EOF
@ -133,38 +135,38 @@ EOF
RUN
NAME=rz-find -b 0xa
FILE==
CMDS=!rz-find -s 250382 -b 0xa bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-s 250382 -b 0xa bins/elf/ioli/crackme0x00
EXPECT=<<EOF
0x58f
EOF
RUN
NAME=rz-find -a 2 -b 0x3
FILE==
CMDS=!rz-find -a 2 -s 250382 -b 0x3 bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-a 2 -s 250382 -b 0x3 bins/elf/ioli/crackme0x00
EXPECT=
RUN
NAME=rz-find -q
FILE==
CMDS=!rz-find -q -s 250382 bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-q -s 250382 bins/elf/ioli/crackme0x00
EXPECT=<<EOF
0x58f
EOF
RUN
NAME=rz-find -z 250382
FILE==
CMDS=!rz-find -z -s 250382 bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-z -s 250382 bins/elf/ioli/crackme0x00
EXPECT=<<EOF
0x58f
EOF
RUN
NAME=rz-find -w ascii
FILE==
CMDS=!rz-find -w wide bins/pe/testapp-msvc64.exe
TOOL=rz-find
ARGS=-w wide bins/pe/testapp-msvc64.exe
EXPECT=<<EOF
0x1481a
0x14842
@ -172,56 +174,48 @@ EOF
RUN
NAME=rz-find -w U+00ff < utf8 < U+10000
FILE==
CMDS=!rz-find -w واسع bins/pe/testapp-msvc64.exe
TOOL=rz-find
ARGS=-w واسع bins/pe/testapp-msvc64.exe
EXPECT=<<EOF
0x14864
EOF
RUN
NAME=rz-find -w utf8 >= U+10000
FILE==
CMDS=!rz-find -w 𐍈 bins/elf/strenc
TOOL=rz-find
ARGS=-w 𐍈 bins/elf/strenc
EXPECT=<<EOF
0x22ac
EOF
RUN
NAME=rz-find -S ascii
FILE==
CMDS=!rz-find -S QueryPerformanceCounter bins/pe/testapp-msvc64.exe
TOOL=rz-find
ARGS=-S QueryPerformanceCounter bins/pe/testapp-msvc64.exe
EXPECT=<<EOF
paddr: 0x0000c000 vaddr: 0x14000d000 type: FUNC QueryPerformanceCounter
EOF
RUN
NAME=rz-find -I ascii
FILE==
CMDS=!rz-find -I QueryPerformanceCounter bins/pe/testapp-msvc64.exe
TOOL=rz-find
ARGS=-I QueryPerformanceCounter bins/pe/testapp-msvc64.exe
EXPECT=<<EOF
ordinal: 1 QueryPerformanceCounter
EOF
RUN
NAME=rz-find -Z
FILE==
CMDS=!rz-find -Z -s 250382 bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-Z -s 250382 bins/elf/ioli/crackme0x00
EXPECT=<<EOF
0x58f 250382
EOF
RUN
NAME=rz-find ""
FILE==
CMDS=!rz-find ""
EXPECT_ERR=<<EOF
Cannot open empty path
EOF
RUN
NAME=rz-find -F
FILE==
CMDS=!rz-find -F scripts/keyword bins/mach0/FileDP
TOOL=rz-find
ARGS=-F scripts/keyword bins/mach0/FileDP
EXPECT=<<EOF
0x4e9
0x6f5
@ -240,8 +234,8 @@ EOF
RUN
NAME=rz-find multiple files
FILE==
CMDS=!rz-find -s README bins/arm/README bins/arm/README
TOOL=rz-find
ARGS=-s README bins/arm/README bins/arm/README
EXPECT=<<EOF
File: bins/arm/README
0x0
@ -251,24 +245,25 @@ EOF
RUN
NAME=rz-find recursive
FILE==
CMDS=!rz-find -q -s README bins/arm
TOOL=rz-find
ARGS=-q -s README bins/arm
EXPECT=<<EOF
0x0
EOF
RUN
NAME=rz-find -E with echo as a command
FILE==
CMDS=!rz-find -s "README" -E "echo" bins/arm~README~?
TOOL=rz-find
ARGS=-s README -E echo bins/arm
REGEXP_FILTER_OUT=README
EXPECT=<<EOF
1
README
EOF
RUN
NAME=rz-find -V verbose flag single file
FILE==
CMDS=!rz-find -V -s 250382 bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-V -s 250382 bins/elf/ioli/crackme0x00
EXPECT=<<EOF
Scanning: bins/elf/ioli/crackme0x00
File: bins/elf/ioli/crackme0x00
@ -277,16 +272,16 @@ EOF
RUN
NAME=rz-find -V verbose flag with no match
FILE==
CMDS=!rz-find -V -s NOTFOUND bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-V -s NOTFOUND bins/elf/ioli/crackme0x00
EXPECT=<<EOF
Scanning: bins/elf/ioli/crackme0x00
EOF
RUN
NAME=rz-find -V verbose flag multiple files
FILE==
CMDS=!rz-find -V -s README bins/arm/README bins/arm/README
TOOL=rz-find
ARGS=-V -s README bins/arm/README bins/arm/README
EXPECT=<<EOF
Scanning: bins/arm/README
File: bins/arm/README
@ -298,8 +293,8 @@ EOF
RUN
NAME=rz-find -V with -q still shows scanning
FILE==
CMDS=!rz-find -V -q -s 250382 bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-V -q -s 250382 bins/elf/ioli/crackme0x00
EXPECT=<<EOF
Scanning: bins/elf/ioli/crackme0x00
0x58f
@ -323,8 +318,9 @@ EXPECT=
RUN
NAME=rz-find multi-file continues on error
FILE==
CMDS=!rz-find -s README nonexistent_file.bin bins/arm/README
TOOL=rz-find
ARGS=-s README nonexistent_file.bin bins/arm/README
EXIT_STATUS=1
EXPECT=<<EOF
File: bins/arm/README
0x0
@ -334,47 +330,27 @@ Cannot open file 'nonexistent_file.bin'
EOF
RUN
NAME=rz-find multi-file exit codes
FILE==
CMDS=<<EOF
!rz-find -s README nonexistent_file.bin bins/arm/README
%v $?
!echo ---
!rz-find -q -s README bins/arm/README bins/arm/README
%v $?
!echo ---
!rz-find -q -s README "" bins/arm/README
%v $?
EOF
NAME=rz-find multi-file quiet
TOOL=rz-find
ARGS=-q -s README bins/arm/README bins/arm/README
EXPECT=<<EOF
File: bins/arm/README
0x0
0x1
---
0x0
0x0
0x0
---
0x0
0x1
EOF
EXPECT_ERR=<<EOF
Cannot open file 'nonexistent_file.bin'
Cannot open empty path
EOF
EXPECT_ERR=
RUN
NAME=rz-find JSON multiple files keyword search
FILE==
CMDS=!rz-find -j -s 250382 bins/elf/ioli/crackme0x00 bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-j -s 250382 bins/elf/ioli/crackme0x00 bins/elf/ioli/crackme0x00
EXPECT=<<EOF
[{"offset":1423,"type":"string","data":"250382"},{"offset":1423,"type":"string","data":"250382"}]
EOF
RUN
NAME=rz-find verbose with JSON outputs scanning to stderr
FILE==
CMDS=!rz-find -V -j -s 250382 bins/elf/ioli/crackme0x00
TOOL=rz-find
ARGS=-V -j -s 250382 bins/elf/ioli/crackme0x00
EXPECT=<<EOF
[{"offset":1423,"type":"string","data":"250382"}]
EOF

View file

@ -1,22 +1,22 @@
NAME=rz-gg -a x86 -b 64 -p A200 -d 50:0xccccccb
FILE==
CMDS=!rz-gg -a x86 -b 64 -p A200 -d 50:0xccccccb
TOOL=rz-gg
ARGS=-a x86 -b 64 -p A200 -d 50:0xccccccb
EXPECT=<<EOF
4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141cbcccc0c4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141
EOF
RUN
NAME=rz-gg -a x86 -b 64 -p A200 -d 50:0xcb
FILE==
CMDS=!rz-gg -a x86 -b 64 -p A200 -d 50:0xcb
TOOL=rz-gg
ARGS=-a x86 -b 64 -p A200 -d 50:0xcb
EXPECT=<<EOF
4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141cb0000004141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141
EOF
RUN
NAME=rz-gg -a x86 -b 64 -p A10 -d 50:0xcb
FILE==
CMDS=!rz-gg -a x86 -b 64 -p A10 -d 50:0xcb
TOOL=rz-gg
ARGS=-a x86 -b 64 -p A10 -d 50:0xcb
EXPECT=<<EOF
41414141414141414141
EOF
@ -26,54 +26,56 @@ EOF
RUN
NAME=rz-gg -a x86 -b 64 -p A20 -w 10:cb
FILE==
CMDS=!rz-gg -a x86 -b 64 -p A20 -w 10:cb
TOOL=rz-gg
ARGS=-a x86 -b 64 -p A20 -w 10:cb
EXPECT=<<EOF
41414141414141414141cb414141414141414141
EOF
RUN
NAME=rz-gg -a x86 -b 64 -p A20 -D 10:33
FILE==
CMDS=!rz-gg -a x86 -b 64 -p A20 -D 10:33
TOOL=rz-gg
ARGS=-a x86 -b 64 -p A20 -D 10:33
EXPECT=<<EOF
4141414141414141414121000000000000004141
EOF
RUN
NAME=rz-gg -a x86 -b 64 -p n2t2a2s2
FILE==
CMDS=!rz-gg -a x86 -b 64 -p n2t2a2s2
TOOL=rz-gg
ARGS=-a x86 -b 64 -p n2t2a2s2
EXPECT=<<EOF
00004141cccc9090
EOF
RUN
NAME=rz-gg -i exec -z -a x86 -b32
FILE==
CMDS=!rz-gg -i exec -z -k linux -a x86 -b32
TOOL=rz-gg
ARGS=-i exec -z -k linux -a x86 -b32
EXPECT=<<EOF
"\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x99\xb0\x0b\xcd\x80"
EOF
RUN
NAME=rz-gg -k linux -i exec -a x86 -b32 -p n3N3
FILE==
CMDS=!rz-gg -k linux -i exec -a x86 -b32 -p n3N3
TOOL=rz-gg
ARGS=-k linux -i exec -a x86 -b32 -p n3N3
EXPECT=<<EOF
90909031c050682f2f7368682f62696e89e3505389e199b00bcd80909090
EOF
RUN
NAME=rz-gg -p n80 -w 79:c3 -x
FILE==
CMDS=!rz-gg -p n80 -w 79:c3 -x
EXPECT=
NAME=rz-gg -k linux -a x86 -b32 -p n80 -w 79:c3
TOOL=rz-gg
ARGS=-k linux -a x86 -b32 -p n80 -w 79:c3
EXPECT=<<EOF
90909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090c3
EOF
RUN
NAME=rz-gg -q 0x45414146
FILE==
CMDS=!rz-gg -q 0x45414146
TOOL=rz-gg
ARGS=-q 0x45414146
EXPECT=<<EOF
Little endian: -1
Big endian: 12
@ -81,65 +83,41 @@ EOF
RUN
NAME=rz-gg -q 45414146
FILE==
CMDS=!rz-gg -q 45414146
TOOL=rz-gg
ARGS=-q 45414146
EXIT_STATUS=1
EXPECT=
EXPECT_ERR=<<EOF
ERROR: rz-gg: need hex value with `0x' prefix e.g. 0x41414142
EOF
RUN
NAME=rz-gg -k linux -a x86 -b32 simple_cmp.r
BROKEN=1
FILE==
CMDS=!rz-gg -k linux -a x86 -b32 bins/other/rz-gg/simple_cmp.r
TOOL=rz-gg
ARGS=-k linux -a x86 -b32 bins/other/rz-gg/simple_cmp.r
EXPECT=<<EOF
5589e581ec80000000c745086869210ac7450c6e000000c74510000000008d4508898504000000c7450501000000c745060200000055583b45060f8f5a0000006a04546a018b1c248b8c24040000008b942408000000b804000000cd8083c40c6a008b1c24b801000000cd8083c40481c4800000005dc3
EOF
RUN
NAME=rz-gg bugg8.r
FILE==
CMDS=!rz-gg bins/other/rz-gg/bugg8.r > /dev/null
EXPECT=
RUN
#CLANG=e900000000488d3524000000bf01000000b80400000248c7c2070000000f05b80100000248c7c7000000000f0531c0c348656c6c6f210a00
NAME=rz-ggc bins/other/rz-gg/hi.c
BROKEN=1
FILE==
CMDS=!rz-gg bins/other/rz-gg/hi.c | grep e9
TOOL=rz-gg
ARGS=bins/other/rz-gg/hi.c
REGEXP_FILTER_OUT=e9.+
EXPECT=<<EOF
e90800000048656c6c6f210a00bf01000000488d35ecffffffba07000000b8010000000f05b83c0000004030ff0f05c3
EOF
RUN
NAME=rz-gg -v
FILE==
CMDS=!rz-gg -v | grep -c commit
EXPECT=<<EOF
1
EOF
RUN
NAME=rz-gg -h
FILE==
CMDS=!rz-gg -h | grep -c Usage
EXPECT=<<EOF
1
EOF
RUN
NAME=rz-gg -L
FILE==
CMDS=!rz-gg -L | grep -c encoders
TOOL=rz-gg
ARGS=-L
REGEXP_FILTER_OUT=encoders.+
EXPECT=<<EOF
1
EOF
RUN
NAME=rz-gg empty file
FILE==
CMDS=!rz-gg ""
EXPECT_ERR=<<EOF
ERROR: rz-gg: cannot open empty path
encoders:
EOF
RUN
@ -160,40 +138,36 @@ EOF
RUN
NAME=rz-gg debruijn sequence 1
FILE==
CMDS=!rz-gg -r -P 2; echo
EXPECT=<<EOF
AA
EOF
TOOL=rz-gg
ARGS=-r -P 2
EXPECT=AA
RUN
NAME=rz-gg debruijn sequence 2
FILE==
CMDS=!rz-gg -P 2 -r; echo
EXPECT=<<EOF
AA
EOF
TOOL=rz-gg
ARGS=-P 2 -r
EXPECT=AA
RUN
NAME=rz-gg -a x86 -b 32 -p A200 -d 50:0xccccccb
FILE==
CMDS=!rz-gg -a x86 -b 32 -p A200 -d 50:0xccccccb
TOOL=rz-gg
ARGS=-a x86 -b 32 -p A200 -d 50:0xccccccb
EXPECT=<<EOF
4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141cbcccc0c4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141
EOF
RUN
NAME=rz-gg -a x86 -b 32 -p A200 -d 50:0xcb
FILE==
CMDS=!rz-gg -a x86 -b 32 -p A200 -d 50:0xcb
TOOL=rz-gg
ARGS=-a x86 -b 32 -p A200 -d 50:0xcb
EXPECT=<<EOF
4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141cb0000004141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141
EOF
RUN
NAME=rz-gg -a x86 -b 32 -p A10 -d 50:0xcb
FILE==
CMDS=!rz-gg -a x86 -b 32 -p A10 -d 50:0xcb
TOOL=rz-gg
ARGS=-a x86 -b 32 -p A10 -d 50:0xcb
EXPECT=<<EOF
41414141414141414141
EOF
@ -203,40 +177,40 @@ EOF
RUN
NAME=rz-gg -a x86 -b 32 -p A20 -w 10:cb
FILE==
CMDS=!rz-gg -a x86 -b 32 -p A20 -w 10:cb
TOOL=rz-gg
ARGS=-a x86 -b 32 -p A20 -w 10:cb
EXPECT=<<EOF
41414141414141414141cb414141414141414141
EOF
RUN
NAME=rz-gg -a x86 -b 32 -p A20 -D 10:33
FILE==
CMDS=!rz-gg -a x86 -b 32 -p A20 -D 10:33
TOOL=rz-gg
ARGS=-a x86 -b 32 -p A20 -D 10:33
EXPECT=<<EOF
4141414141414141414121000000000000004141
EOF
RUN
NAME=rz-gg -a x86 -b 32 -p n2t2a2s2
FILE==
CMDS=!rz-gg -a x86 -b 32 -p n2t2a2s2
TOOL=rz-gg
ARGS=-a x86 -b 32 -p n2t2a2s2
EXPECT=<<EOF
00004141cccc9090
EOF
RUN
NAME=rz-gg -i exec -z -a x86 -b64
FILE==
CMDS=!rz-gg -i exec -z -k linux -a x86 -b64
TOOL=rz-gg
ARGS=-i exec -z -k linux -a x86 -b64
EXPECT=<<EOF
"\x31\xc0\x48\xbb\xd1\x9d\x96\x91\xd0\x8c\x97\xff\x48\xf7\xdb\x53\x54\x5f\x99\x52\x57\x54\x5e\xb0\x3b\x0f\x05"
EOF
RUN
NAME=rz-gg -k linux -i exec -a x86 -b64 -p n3N3
FILE==
CMDS=!rz-gg -k linux -i exec -a x86 -b64 -p n3N3
TOOL=rz-gg
ARGS=-k linux -i exec -a x86 -b64 -p n3N3
EXPECT=<<EOF
90909031c048bbd19d9691d08c97ff48f7db53545f995257545eb03b0f05909090
EOF
@ -244,8 +218,8 @@ RUN
NAME=rz-gg -k linux -a x86 -b64 simple_cmp.r
BROKEN=1
FILE==
CMDS=!rz-gg -k linux -a x86 -b64 bins/other/rz-gg/simple_cmp.r
TOOL=rz-gg
ARGS=-k linux -a x86 -b64 bins/other/rz-gg/simple_cmp.r
EXPECT=<<EOF
554889e54881ec80000000c745106869210ac7451400000000c7451800000000488d45104889850800000048c7c70000000048c7c7010000004889bd0900000048c7c70000000048c7c7020000004889bd0a000000488b45085058483b450a7f3248c7c00400000050488b45085048c7c00100000050488b3c24488b742408488b54241048c7c0040000000f054883c418eb2248c7c00000000050488b3c2448c7c0010000000f054883c4084881c4800000005dc3ebdc
EOF
@ -253,32 +227,33 @@ RUN
NAME=rz-gg -k linux -a x86 -b 64 bins/other/rz-gg/hi.c
BROKEN=1
FILE==
CMDS=!rz-gg -a x86 -b 64 bins/other/rz-gg/hi.c | grep e9
TOOL=rz-gg
ARGS=-a x86 -b 64 bins/other/rz-gg/hi.c
REGEXP_FILTER_OUT=e9.+
EXPECT=<<EOF
???
EOF
RUN
NAME=rz-gg -a arm -b 32 -p A200 -d 50:0xccccccb
FILE==
CMDS=!rz-gg -a arm -b 32 -p A200 -d 50:0xccccccb
TOOL=rz-gg
ARGS=-a arm -b 32 -p A200 -d 50:0xccccccb
EXPECT=<<EOF
4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141cbcccc0c4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141
EOF
RUN
NAME=rz-gg -a arm -b 32 -p A200 -d 50:0xcb
FILE==
CMDS=!rz-gg -a arm -b 32 -p A200 -d 50:0xcb
TOOL=rz-gg
ARGS=-a arm -b 32 -p A200 -d 50:0xcb
EXPECT=<<EOF
4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141cb0000004141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141
EOF
RUN
NAME=rz-gg -a arm -b 32 -p A10 -d 50:0xcb
FILE==
CMDS=!rz-gg -a arm -b 32 -p A10 -d 50:0xcb
TOOL=rz-gg
ARGS=-a arm -b 32 -p A10 -d 50:0xcb
EXPECT=<<EOF
41414141414141414141
EOF
@ -288,40 +263,40 @@ EOF
RUN
NAME=rz-gg -a arm -b 32 -p A20 -w 10:cb
FILE==
CMDS=!rz-gg -a arm -b 32 -p A20 -w 10:cb
TOOL=rz-gg
ARGS=-a arm -b 32 -p A20 -w 10:cb
EXPECT=<<EOF
41414141414141414141cb414141414141414141
EOF
RUN
NAME=rz-gg -a arm -b 32 -p A20 -D 10:33
FILE==
CMDS=!rz-gg -a arm -b 32 -p A20 -D 10:33
TOOL=rz-gg
ARGS=-a arm -b 32 -p A20 -D 10:33
EXPECT=<<EOF
4141414141414141414121000000000000004141
EOF
RUN
NAME=rz-gg -a arm -b 32 -p n2t2a2s2
FILE==
CMDS=!rz-gg -a arm -b 32 -p n2t2a2s2
TOOL=rz-gg
ARGS=-a arm -b 32 -p n2t2a2s2
EXPECT=<<EOF
00004141cccc9090
EOF
RUN
NAME=rz-gg -i exec -z -a arm -b 32
FILE==
CMDS=!rz-gg -i exec -z -k linux -a arm -b 32
TOOL=rz-gg
ARGS=-i exec -z -k linux -a arm -b 32
EXPECT=<<EOF
"\x02\x20\x42\xe0\x1c\x30\x8f\xe2\x04\x30\x8d\xe5\x08\x20\x8d\xe5\x13\x02\xa0\xe1\x07\x20\xc3\xe5\x04\x30\x8f\xe2\x04\x10\x8d\xe2\x01\x20\xc3\xe5\x0b\x0b\x90\xef\x2f\x62\x69\x6e\x2f\x73\x68"
EOF
RUN
NAME=rz-gg -k linux -i exec -a arm -b 32 -p n3N3
FILE==
CMDS=!rz-gg -k linux -i exec -a arm -b 32 -p n3N3
TOOL=rz-gg
ARGS=-k linux -i exec -a arm -b 32 -p n3N3
EXPECT=<<EOF
909090022042e01c308fe204308de508208de51302a0e10720c3e504308fe204108de20120c3e50b0b90ef2f62696e2f7368909090
EOF
@ -329,8 +304,8 @@ RUN
NAME=rz-gg -k linux -a arm -b 32 simple_cmp.r
BROKEN=1
FILE==
CMDS=!rz-gg -k linux -a arm -b 32 bins/other/rz-gg/simple_cmp.r
TOOL=rz-gg
ARGS=-k linux -a arm -b 32 bins/other/rz-gg/simple_cmp.r
EXPECT=<<EOF
00082de900402de904b08de280d04de204f08fe26869210a0000000000000000000000000010004fe207008de50010a0e30110a0e308d0a0e30010a0e30210a0e309d0a0e30000bde809005de3090000ca0400a0e30c008de50100a0e314008de508109de50c209de514309de50470a0e3000000ef060000ea0000a0e30c008de508109de50170a0e3000000ef80d08be20088bde8f7ffffea
EOF
@ -338,32 +313,33 @@ RUN
NAME=rz-gg -k linux -a arm -b 32 bins/other/rz-gg/hi.c
BROKEN=1
FILE==
CMDS=!rz-gg -a arm -b 32 bins/other/rz-gg/hi.c | grep e9
TOOL=rz-gg
ARGS=-a arm -b 32 bins/other/rz-gg/hi.c
REGEXP_FILTER_OUT=e9.+
EXPECT=<<EOF
???
EOF
RUN
NAME=rz-gg -a arm -b 64 -p A200 -d 50:0xccccccb
FILE==
CMDS=!rz-gg -a arm -b 64 -p A200 -d 50:0xccccccb
TOOL=rz-gg
ARGS=-a arm -b 64 -p A200 -d 50:0xccccccb
EXPECT=<<EOF
4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141cbcccc0c4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141
EOF
RUN
NAME=rz-gg -a arm -b 64 -p A200 -d 50:0xcb
FILE==
CMDS=!rz-gg -a arm -b 64 -p A200 -d 50:0xcb
TOOL=rz-gg
ARGS=-a arm -b 64 -p A200 -d 50:0xcb
EXPECT=<<EOF
4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141cb0000004141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141
EOF
RUN
NAME=rz-gg -a arm -b 64 -p A10 -d 50:0xcb
FILE==
CMDS=!rz-gg -a arm -b 64 -p A10 -d 50:0xcb
TOOL=rz-gg
ARGS=-a arm -b 64 -p A10 -d 50:0xcb
EXPECT=<<EOF
41414141414141414141
EOF
@ -373,24 +349,24 @@ EOF
RUN
NAME=rz-gg -a arm -b 64 -p A20 -w 10:cb
FILE==
CMDS=!rz-gg -a arm -b 64 -p A20 -w 10:cb
TOOL=rz-gg
ARGS=-a arm -b 64 -p A20 -w 10:cb
EXPECT=<<EOF
41414141414141414141cb414141414141414141
EOF
RUN
NAME=rz-gg -a arm -b 64 -p A20 -D 10:33
FILE==
CMDS=!rz-gg -a arm -b 64 -p A20 -D 10:33
TOOL=rz-gg
ARGS=-a arm -b 64 -p A20 -D 10:33
EXPECT=<<EOF
4141414141414141414121000000000000004141
EOF
RUN
NAME=rz-gg -a arm -b 64 -p n2t2a2s2
FILE==
CMDS=!rz-gg -a arm -b 64 -p n2t2a2s2
TOOL=rz-gg
ARGS=-a arm -b 64 -p n2t2a2s2
EXPECT=<<EOF
00004141cccc9090
EOF
@ -398,8 +374,8 @@ RUN
NAME=rz-gg -i exec -z -a arm -b 64
BROKEN=1
FILE==
CMDS=!rz-gg -i exec -z -k linux -a arm -b 64
TOOL=rz-gg
ARGS=-i exec -z -k linux -a arm -b 64
EXPECT=<<EOF
???
EOF
@ -407,8 +383,8 @@ RUN
NAME=rz-gg -k linux -i exec -a arm -b 64 -p n3N3
BROKEN=1
FILE==
CMDS=!rz-gg -k linux -i exec -a arm -b 64 -p n3N3
TOOL=rz-gg
ARGS=-k linux -i exec -a arm -b 64 -p n3N3
EXPECT=<<EOF
???
EOF
@ -416,8 +392,8 @@ RUN
NAME=rz-gg -k linux -a arm -b 64 simple_cmp.r
BROKEN=1
FILE==
CMDS=!rz-gg -k linux -a arm -b 64 bins/other/rz-gg/simple_cmp.r
TOOL=rz-gg
ARGS=-k linux -a arm -b 64 bins/other/rz-gg/simple_cmp.r
EXPECT=<<EOF
???
EOF
@ -425,32 +401,33 @@ RUN
NAME=rz-gg -k linux -a arm -b 64 bins/other/rz-gg/hi.c
BROKEN=1
FILE==
CMDS=!rz-gg -a arm -b 64 bins/other/rz-gg/hi.c | grep e9
TOOL=rz-gg
ARGS=-a arm -b 64 bins/other/rz-gg/hi.c
REGEXP_FILTER_OUT=e9.+
EXPECT=<<EOF
???
EOF
RUN
NAME=rz-gg -k darwin -a x86 -b 32 -p A200 -d 50:0xccccccb
FILE==
CMDS=!rz-gg -k darwin -a x86 -b 32 -p A200 -d 50:0xccccccb
TOOL=rz-gg
ARGS=-k darwin -a x86 -b 32 -p A200 -d 50:0xccccccb
EXPECT=<<EOF
4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141cbcccc0c4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141
EOF
RUN
NAME=rz-gg -k darwin -a x86 -b 32 -p A200 -d 50:0xcb
FILE==
CMDS=!rz-gg -k darwin -a x86 -b 32 -p A200 -d 50:0xcb
TOOL=rz-gg
ARGS=-k darwin -a x86 -b 32 -p A200 -d 50:0xcb
EXPECT=<<EOF
4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141cb0000004141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141
EOF
RUN
NAME=rz-gg -k darwin -a x86 -b 32 -p A10 -d 50:0xcb
FILE==
CMDS=!rz-gg -k darwin -a x86 -b 32 -p A10 -d 50:0xcb
TOOL=rz-gg
ARGS=-k darwin -a x86 -b 32 -p A10 -d 50:0xcb
EXPECT=<<EOF
41414141414141414141
EOF
@ -460,48 +437,48 @@ EOF
RUN
NAME=rz-gg -k darwin -a x86 -b 32 -p A20 -w 10:cb
FILE==
CMDS=!rz-gg -k darwin -a x86 -b 32 -p A20 -w 10:cb
TOOL=rz-gg
ARGS=-k darwin -a x86 -b 32 -p A20 -w 10:cb
EXPECT=<<EOF
41414141414141414141cb414141414141414141
EOF
RUN
NAME=rz-gg -k darwin -a x86 -b 32 -p A20 -D 10:33
FILE==
CMDS=!rz-gg -k darwin -a x86 -b 32 -p A20 -D 10:33
TOOL=rz-gg
ARGS=-k darwin -a x86 -b 32 -p A20 -D 10:33
EXPECT=<<EOF
4141414141414141414121000000000000004141
EOF
RUN
NAME=rz-gg -k darwin -a x86 -b 32 -p n2t2a2s2
FILE==
CMDS=!rz-gg -k darwin -a x86 -b 32 -p n2t2a2s2
TOOL=rz-gg
ARGS=-k darwin -a x86 -b 32 -p n2t2a2s2
EXPECT=<<EOF
00004141cccc9090
EOF
RUN
NAME=rz-gg -i exec -z -k darwin -a x86 -b 32
FILE==
CMDS=!rz-gg -i exec -z -k linux -k darwin -a x86 -b 32
TOOL=rz-gg
ARGS=-i exec -z -k linux -k darwin -a x86 -b 32
EXPECT=<<EOF
"\x41\xb0\x02\x49\xc1\xe0\x18\x49\x83\xc8\x17\xeb\x12\x5f\x49\x83\xc0\x24\x4c\x89\xc0\x48\x31\xd2\x52\x57\x48\x89\xe6\x0f\x05\xe8\xe9\xff\xff\xff\x2f\x62\x69\x6e\x2f\x73\x68"
EOF
RUN
NAME=rz-gg -i exec -k darwin -a x86 -b 32 -p n3N3
FILE==
CMDS=!rz-gg -i exec -k darwin -a x86 -b 32 -p n3N3
TOOL=rz-gg
ARGS=-i exec -k darwin -a x86 -b 32 -p n3N3
EXPECT=<<EOF
90909041b00249c1e0184983c817eb125f4983c0244c89c04831d252574889e60f05e8e9ffffff2f62696e2f7368909090
EOF
RUN
NAME=rz-gg -k darwin -a x86 -b 32 simple_cmp.r
FILE==
CMDS=!rz-gg -k darwin -a x86 -b 32 bins/other/rz-gg/simple_cmp.r
TOOL=rz-gg
ARGS=-k darwin -a x86 -b 32 bins/other/rz-gg/simple_cmp.r
BROKEN=1
EXPECT=<<EOF
5589e581ec80000000c745086869210ac7450c00000000c74510000000008d4508898504000000bb00000000bb01000000899d05000000bb00000000bb02000000899d06000000ff7504583b45067f226a04ff75046a018b1c248b4c24048b542408b80400000050cd8083c40483c40ceb1b6a008b1c24b80100000050cd8083c40483c40481c4800000005dc3ebe3
@ -521,32 +498,33 @@ RUN
NAME=rz-gg -k darwin -a x86 -b 32 bins/other/rz-gg/hi.c
BROKEN=1
FILE==
CMDS=!rz-gg -k darwin -a x86 -b 32 bins/other/rz-gg/hi.c | grep e9
TOOL=rz-gg
ARGS=-k darwin -a x86 -b 32 bins/other/rz-gg/hi.c
REGEXP_FILTER_OUT=e9.+
EXPECT=<<EOF
???
EOF
RUN
NAME=rz-gg -k darwin -a x86 -b 64 -p A200 -d 50:0xccccccb
FILE==
CMDS=!rz-gg -k darwin -a x86 -b 64 -p A200 -d 50:0xccccccb
TOOL=rz-gg
ARGS=-k darwin -a x86 -b 64 -p A200 -d 50:0xccccccb
EXPECT=<<EOF
4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141cbcccc0c4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141
EOF
RUN
NAME=rz-gg -k darwin -a x86 -b 64 -p A200 -d 50:0xcb
FILE==
CMDS=!rz-gg -k darwin -a x86 -b 64 -p A200 -d 50:0xcb
TOOL=rz-gg
ARGS=-k darwin -a x86 -b 64 -p A200 -d 50:0xcb
EXPECT=<<EOF
4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141cb0000004141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141
EOF
RUN
NAME=rz-gg -k darwin -a x86 -b 64 -p A10 -d 50:0xcb
FILE==
CMDS=!rz-gg -k darwin -a x86 -b 64 -p A10 -d 50:0xcb
TOOL=rz-gg
ARGS=-k darwin -a x86 -b 64 -p A10 -d 50:0xcb
EXPECT=<<EOF
41414141414141414141
EOF
@ -556,48 +534,48 @@ EOF
RUN
NAME=rz-gg -k darwin -a x86 -b 64 -p A20 -w 10:cb
FILE==
CMDS=!rz-gg -k darwin -a x86 -b 64 -p A20 -w 10:cb
TOOL=rz-gg
ARGS=-k darwin -a x86 -b 64 -p A20 -w 10:cb
EXPECT=<<EOF
41414141414141414141cb414141414141414141
EOF
RUN
NAME=rz-gg -k darwin -a x86 -b 64 -p A20 -D 10:33
FILE==
CMDS=!rz-gg -k darwin -a x86 -b 64 -p A20 -D 10:33
TOOL=rz-gg
ARGS=-k darwin -a x86 -b 64 -p A20 -D 10:33
EXPECT=<<EOF
4141414141414141414121000000000000004141
EOF
RUN
NAME=rz-gg -k darwin -a x86 -b 64 -p n2t2a2s2
FILE==
CMDS=!rz-gg -k darwin -a x86 -b 64 -p n2t2a2s2
TOOL=rz-gg
ARGS=-k darwin -a x86 -b 64 -p n2t2a2s2
EXPECT=<<EOF
00004141cccc9090
EOF
RUN
NAME=rz-gg -i exec -z -k darwin -a x86 -b 64
FILE==
CMDS=!rz-gg -i exec -z -k darwin -a x86 -b 64
TOOL=rz-gg
ARGS=-i exec -z -k darwin -a x86 -b 64
EXPECT=<<EOF
"\x41\xb0\x02\x49\xc1\xe0\x18\x49\x83\xc8\x17\xeb\x12\x5f\x49\x83\xc0\x24\x4c\x89\xc0\x48\x31\xd2\x52\x57\x48\x89\xe6\x0f\x05\xe8\xe9\xff\xff\xff\x2f\x62\x69\x6e\x2f\x73\x68"
EOF
RUN
NAME=rz-gg -k linux -i exec -a x86 -b 64 -p n3N3
FILE==
CMDS=!rz-gg -k linux -i exec -a x86 -b 64 -p n3N3
TOOL=rz-gg
ARGS=-k linux -i exec -a x86 -b 64 -p n3N3
EXPECT=<<EOF
90909031c048bbd19d9691d08c97ff48f7db53545f995257545eb03b0f05909090
EOF
RUN
NAME=rz-gg -k darwin -a x86 -b 64 simple_cmp.r
FILE==
CMDS=!rz-gg -k darwin -a x86 -b 64 bins/other/rz-gg/simple_cmp.r
TOOL=rz-gg
ARGS=-k darwin -a x86 -b 64 bins/other/rz-gg/simple_cmp.r
BROKEN=1
EXPECT=<<EOF
554889e54881ec80000000c745106869210ac7451400000000c7451800000000488d45104889850800000048c7c70000000048c7c7010000004889bd0900000048c7c70000000048c7c7020000004889bd0a000000488b45085058483b450a7f3248c7c00400000050488b45085048c7c00100000050488b3c24488b742408488b54241048c7c0040000000f054883c418eb2248c7c00000000050488b3c2448c7c0010000000f054883c4084881c4800000005dc3ebdc
@ -606,32 +584,33 @@ RUN
NAME=rz-gg -k darwin -a x86 -b 64 bins/other/rz-gg/hi.c
BROKEN=1
FILE==
CMDS=!rz-gg -k darwin -a x86 -b 64 bins/other/rz-gg/hi.c | grep e9
TOOL=rz-gg
ARGS=-k darwin -a x86 -b 64 bins/other/rz-gg/hi.c
REGEXP_FILTER_OUT=e9.+
EXPECT=<<EOF
???
EOF
RUN
NAME=rz-gg -k darwin -a arm -b 64 -p A200 -d 50:0xccccccb
FILE==
CMDS=!rz-gg -k darwin -a arm -b 64 -p A200 -d 50:0xccccccb
TOOL=rz-gg
ARGS=-k darwin -a arm -b 64 -p A200 -d 50:0xccccccb
EXPECT=<<EOF
4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141cbcccc0c4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141
EOF
RUN
NAME=rz-gg -k darwin -a arm -b 64 -p A200 -d 50:0xcb
FILE==
CMDS=!rz-gg -k darwin -a arm -b 64 -p A200 -d 50:0xcb
TOOL=rz-gg
ARGS=-k darwin -a arm -b 64 -p A200 -d 50:0xcb
EXPECT=<<EOF
4141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141cb0000004141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141
EOF
RUN
NAME=rz-gg -k darwin -a arm -b 64 -p A10 -d 50:0xcb
FILE==
CMDS=!rz-gg -k darwin -a arm -b 64 -p A10 -d 50:0xcb
TOOL=rz-gg
ARGS=-k darwin -a arm -b 64 -p A10 -d 50:0xcb
EXPECT=<<EOF
41414141414141414141
EOF
@ -641,24 +620,24 @@ EOF
RUN
NAME=rz-gg -k darwin -a arm -b 64 -p A20 -w 10:cb
FILE==
CMDS=!rz-gg -k darwin -a arm -b 64 -p A20 -w 10:cb
TOOL=rz-gg
ARGS=-k darwin -a arm -b 64 -p A20 -w 10:cb
EXPECT=<<EOF
41414141414141414141cb414141414141414141
EOF
RUN
NAME=rz-gg -k darwin -a arm -b 64 -p A20 -D 10:33
FILE==
CMDS=!rz-gg -k darwin -a arm -b 64 -p A20 -D 10:33
TOOL=rz-gg
ARGS=-k darwin -a arm -b 64 -p A20 -D 10:33
EXPECT=<<EOF
4141414141414141414121000000000000004141
EOF
RUN
NAME=rz-gg -k darwin -a arm -b 64 -p n2t2a2s2
FILE==
CMDS=!rz-gg -k darwin -a arm -b 64 -p n2t2a2s2
TOOL=rz-gg
ARGS=-k darwin -a arm -b 64 -p n2t2a2s2
EXPECT=<<EOF
00004141cccc9090
EOF
@ -666,8 +645,8 @@ RUN
NAME=rz-gg -i exec -z -k darwin -a arm -b 64
BROKEN=1
FILE==
CMDS=!rz-gg -i exec -z -k darwin -a arm -b 64
TOOL=rz-gg
ARGS=-i exec -z -k darwin -a arm -b 64
EXPECT=<<EOF
???
EOF
@ -675,8 +654,8 @@ RUN
NAME=rz-gg -i exec -k darwin -a arm -b 64 -p n3N3
BROKEN=1
FILE==
CMDS=!rz-gg -i exec -k darwin -a arm -b 64 -p n3N3
TOOL=rz-gg
ARGS=-i exec -k darwin -a arm -b 64 -p n3N3
EXPECT=<<EOF
???
EOF
@ -684,8 +663,8 @@ RUN
NAME=rz-gg -k darwin -a arm -b 64 simple_cmp.r
BROKEN=1
FILE==
CMDS=!rz-gg -k darwin -a arm -b 64 bins/other/rz-gg/simple_cmp.r
TOOL=rz-gg
ARGS=-k darwin -a arm -b 64 bins/other/rz-gg/simple_cmp.r
EXPECT=<<EOF
???
EOF
@ -693,8 +672,9 @@ RUN
NAME=rz-gg -k darwin -a arm -b 64 bins/other/rz-gg/hi.c
BROKEN=1
FILE==
CMDS=!rz-gg -k darwin -a arm -b 64 bins/other/rz-gg/hi.c | grep e9
TOOL=rz-gg
ARGS=-k darwin -a arm -b 64 bins/other/rz-gg/hi.c
REGEXP_FILTER_OUT=e9.+
EXPECT=<<EOF
???
EOF

File diff suppressed because it is too large Load diff

View file

@ -1,22 +1,7 @@
NAME=rz-run -v
FILE==
CMDS=!rz-run -v | grep -c commit
EXPECT=<<EOF
1
EOF
RUN
NAME=rz-run -h
FILE==
CMDS=!rz-run -h | grep -c Usage
EXPECT=<<EOF
1
EOF
RUN
NAME=rz-run repeat error
FILE==
CMDS=!rz-run arg1='@32@' -- echo
TOOL=rz-run
ARGS=arg1=@32@ -- echo
EXIT_STATUS=1
REGEXP_FILTER_ERR=(ERROR: rz-run:.+$)
EXPECT_ERR=<<EOF
ERROR: rz-run: invalid string after @<num>@ in `@32@`
@ -24,8 +9,9 @@ EOF
RUN
NAME=rz-run repeat error
FILE==
CMDS=!rz-run arg1='@32aaa' -- echo
TOOL=rz-run
ARGS=arg1=@32aaa -- echo
EXIT_STATUS=1
REGEXP_FILTER_ERR=(ERROR: rz-run:.+$)
EXPECT_ERR=<<EOF
ERROR: rz-run: invalid @<num>@ in `@32aaa`

View file

@ -1,22 +1,6 @@
NAME=rz-sign version
FILE==
CMDS=!!rz-sign -v~?
EXPECT=<<EOF
2
EOF
RUN
NAME=rz-sign help
FILE==
CMDS=!!rz-sign -h~Usage
EXPECT=<<EOF
Usage: rz-sign [-aqv] [-e k=v] (-c pat sig | -o sig bin | -d sig)
EOF
RUN
NAME=FLIRT dump libc-v7.sig
FILE==
CMDS=!rz-sign -d bins/other/sigs/libc-v7.sig
TOOL=rz-sign
ARGS=-d bins/other/sigs/libc-v7.sig
EXPECT=<<EOF
SIG format
Signature: , 1 modules
@ -28,8 +12,8 @@ EOF
RUN
NAME=FLIRT dump libc-v10.sig
FILE==
CMDS=!rz-sign -d bins/other/sigs/libc-v10.sig
TOOL=rz-sign
ARGS=-d bins/other/sigs/libc-v10.sig
EXPECT=<<EOF
SIG format
Signature: FLIRT v10, 1 modules