Skip to content

Commit

Permalink
Add details for cx command regarding ignoring bytes while comparing
Browse files Browse the repository at this point in the history
  • Loading branch information
DMaroo committed Feb 9, 2022
1 parent bbfc5f9 commit 5a5bdec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions librz/core/cmd_descs/cmd_cmp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ commands:
args:
- name: hexpair
type: RZ_CMD_ARG_TYPE_STRING
details:
- name: Ignoring bytes
entries:
- text: "Ignore specific bytes while comparing by using '.'"
comment: "cx 1ee7..0f....d34d"
- name: cX
summary: Compare hexdump of data of block size at <addr> with the data at current offset using hexdiff output
cname: cmd_cmp_hex_block_hexdiff
Expand Down
10 changes: 10 additions & 0 deletions librz/core/cmd_descs/cmd_descs.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ static const RzCmdDescDetail analysis_hint_set_optype_details[2];
static const RzCmdDescDetail analysis_hint_set_immbase_details[3];
static const RzCmdDescDetail analysis_hint_set_offset_details[2];
static const RzCmdDescDetail cmd_cmp_unified_details[2];
static const RzCmdDescDetail cmd_cmp_hexpair_string_details[2];
static const RzCmdDescDetail cmd_debug_list_bp_details[2];
static const RzCmdDescDetail cmd_debug_add_cond_bp_details[2];
static const RzCmdDescDetail cmd_debug_add_watchpoint_details[2];
Expand Down Expand Up @@ -3931,6 +3932,14 @@ static const RzCmdDescHelp cmd_cmp_remove_watcher_help = {
.args = cmd_cmp_remove_watcher_args,
};

static const RzCmdDescDetailEntry cmd_cmp_hexpair_string_Ignoring_space_bytes_detail_entries[] = {
{ .text = "Ignore specific bytes while comparing by using '.'", .arg_str = NULL, .comment = "cx 1ee7..0f....d34d" },
{ 0 },
};
static const RzCmdDescDetail cmd_cmp_hexpair_string_details[] = {
{ .name = "Ignoring bytes", .entries = cmd_cmp_hexpair_string_Ignoring_space_bytes_detail_entries },
{ 0 },
};
static const RzCmdDescArg cmd_cmp_hexpair_string_args[] = {
{
.name = "hexpair",
Expand All @@ -3942,6 +3951,7 @@ static const RzCmdDescArg cmd_cmp_hexpair_string_args[] = {
};
static const RzCmdDescHelp cmd_cmp_hexpair_string_help = {
.summary = "Compare data at current offset with a hexpair string <hexpair> (also return in $?)",
.details = cmd_cmp_hexpair_string_details,
.args = cmd_cmp_hexpair_string_args,
};

Expand Down

0 comments on commit 5a5bdec

Please sign in to comment.