Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Check and early fail if symbol existance in radiff2-g ##diff #23056

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions libr/main/radiff2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1288,11 +1288,27 @@ R_API int r_main_radiff2(int argc, const char **argv) {
r_config_set_i (c2->config, "diff.bare", ro.showbare);
r_anal_diff_setup_i (c->anal, ro.diffops, ro.threshold, ro.threshold);
r_anal_diff_setup_i (c2->anal, ro.diffops, ro.threshold, ro.threshold);
if (ro.pdc) {
if (!addr) {
//addr = "entry0";
if (addr) {
bool err = false;
if (r_num_math (c->num, addr) == 0) {
err = true;
} else if (r_num_math (c2->num, addr) == 0) {
err = true;
}
if (err) {
R_LOG_ERROR ("Unknown symbol name '%s'", addr);
return -1;
}
} else {
if (r_num_math (c->num, "main")) {
addr = "main";
} else if (r_num_math (c->num, "entry0")) {
addr = "entry0";
} else {
R_LOG_WARN ("Cannot find entrypoint");
}
}
if (ro.pdc) {
/* should be in mode not in bool pdc */
r_config_set_i (c->config, "scr.color", COLOR_MODE_DISABLED);
r_config_set_i (c2->config, "scr.color", COLOR_MODE_DISABLED);
Expand Down
Loading