Skip to content

Commit

Permalink
Added agw details and fixed memleak (#3378) (#3379)
Browse files Browse the repository at this point in the history
Co-authored-by: Giovanni <561184+wargio@users.noreply.github.com>
  • Loading branch information
XVilka and wargio authored Feb 18, 2023
1 parent e8501a1 commit a7d643a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions librz/core/cgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,5 +725,6 @@ RZ_API bool rz_core_graph_write(RZ_NONNULL RzCore *core, ut64 addr, RzCoreGraphT
return false;
}
rz_core_graph_write_graph(core, graph, path);
rz_graph_free(graph);
return true;
}
21 changes: 21 additions & 0 deletions librz/core/cmd_descs/cmd_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,27 @@ commands:
type: RZ_CMD_ARG_TYPE_OPTION
flags: RZ_CMD_ARG_FLAG_OPTION
optional: true
details:
- name: "Graph Type"
entries:
- text: "dataref"
comment: "Data reference graph"
- text: "funcall"
comment: "Function call graph"
- text: "diff"
comment: "Diff graph"
- text: "funblock"
comment: "Function basic block graph"
- text: "import"
comment: "Imports graph"
- text: "ref"
comment: "References graph"
- text: "line"
comment: "Line graph"
- text: "xref"
comment: "Cross references graph"
- text: "custom"
comment: "Custom made graph"
#####################################################
# Keep this in sync with dr in cmd_debug.yaml from here...
- name: ar
Expand Down
18 changes: 18 additions & 0 deletions librz/core/cmd_descs/cmd_descs.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ static const RzCmdDescDetail analysis_all_esil_details[2];
static const RzCmdDescDetail analyze_all_preludes_details[2];
static const RzCmdDescDetail analysis_functions_merge_details[2];
static const RzCmdDescDetail analysis_appcall_details[2];
static const RzCmdDescDetail analysis_graph_write_details[2];
static const RzCmdDescDetail ag_details[2];
static const RzCmdDescDetail analysis_reg_cond_details[4];
static const RzCmdDescDetail ar_details[2];
Expand Down Expand Up @@ -3431,6 +3432,22 @@ static const RzCmdDescHelp analysis_graph_custom_edge_remove_help = {
.args = analysis_graph_custom_edge_remove_args,
};

static const RzCmdDescDetailEntry analysis_graph_write_Graph_space_Type_detail_entries[] = {
{ .text = "dataref", .arg_str = NULL, .comment = "Data reference graph" },
{ .text = "funcall", .arg_str = NULL, .comment = "Function call graph" },
{ .text = "diff", .arg_str = NULL, .comment = "Diff graph" },
{ .text = "funblock", .arg_str = NULL, .comment = "Function basic block graph" },
{ .text = "import", .arg_str = NULL, .comment = "Imports graph" },
{ .text = "ref", .arg_str = NULL, .comment = "References graph" },
{ .text = "line", .arg_str = NULL, .comment = "Line graph" },
{ .text = "xref", .arg_str = NULL, .comment = "Cross references graph" },
{ .text = "custom", .arg_str = NULL, .comment = "Custom made graph" },
{ 0 },
};
static const RzCmdDescDetail analysis_graph_write_details[] = {
{ .name = "Graph Type", .entries = analysis_graph_write_Graph_space_Type_detail_entries },
{ 0 },
};
static const char *analysis_graph_write_graphtype_choices[] = { "dataref", "funcall", "diff", "funblock", "import", "ref", "line", "xref", "custom", NULL };
static const RzCmdDescArg analysis_graph_write_args[] = {
{
Expand All @@ -3456,6 +3473,7 @@ static const RzCmdDescArg analysis_graph_write_args[] = {
};
static const RzCmdDescHelp analysis_graph_write_help = {
.summary = "Write to path or display graph image (see graph.gv.format)",
.details = analysis_graph_write_details,
.args = analysis_graph_write_args,
};

Expand Down

0 comments on commit a7d643a

Please sign in to comment.