Skip to content

Commit

Permalink
Review comment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
giridharprasath committed Jul 9, 2024
1 parent 583406e commit 5314e3f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion librz/arch/analysis.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ RZ_API char *rz_analysis_get_reg_profile(RzAnalysis *analysis) {
* in the register profile of the given RzAnalysis.
*/
RZ_API bool rz_analysis_is_reg_in_profile(RzAnalysis *analysis, const char *str) {
rz_return_val_if_fail(analysis, false);
rz_return_val_if_fail(analysis && str, false);

char *reg_prof = rz_analysis_get_reg_profile(analysis);
if (!reg_prof) {
Expand Down
6 changes: 2 additions & 4 deletions librz/core/cmd/cmd_search_rop.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2009-2016 Alexandru Caciulescu <alex.darredevil@gmail.com>
// SPDX-FileCopyrightText: 2024 z3phyr <giridh1337@gmail.com>
// SPDX-License-Identifier: LGPL-3.0-only

#include <stddef.h>
Expand Down Expand Up @@ -119,9 +119,7 @@ static bool parse_reg_to_const(const RzCore *core, const char *str, RzRopConstra
rop_constraint->type = MOV_CONST;
rop_constraint->args[DST_REG] = dst_reg;
rop_constraint->args[SRC_REG] = NULL;
char value_str[256];
rz_strf(value_str, "%" PFMT64u, const_value);
rop_constraint->args[SRC_CONST] = strdup(value_str);
rop_constraint->args[SRC_CONST] = rz_str_newf("%" PFMT64u, const_value);
return true;
}

Expand Down
7 changes: 6 additions & 1 deletion librz/include/rz_rop.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#define RZ_ROP_H

#include <rz_cmd.h>

#ifdef __cplusplus
extern "C" {
#endif
/**
* \file rz_rop.h
* \brief Return-Oriented Programming (ROP) related APIs and structures..
Expand Down Expand Up @@ -133,4 +135,7 @@ RZ_IPI void rz_core_rop_reg_info_free(RzRopRegInfo *reg_info);
RZ_IPI RzRopRegInfo *rz_core_rop_reg_info_new(const RzCore *core, const RzILEvent *evt, ut64 init_val, ut64 new_val);
RZ_BORROW RZ_API RzRopRegInfo *rz_core_rop_gadget_info_get_modified_register(const RZ_NONNULL RzRopGadgetInfo *gadget_info, RZ_NONNULL const char *name);

#ifdef __cplusplus
}
#endif
#endif // RZ_ROP_H

0 comments on commit 5314e3f

Please sign in to comment.