Skip to content

Commit

Permalink
Fix null deref and output of aezsue (#4877)
Browse files Browse the repository at this point in the history
  • Loading branch information
wargio authored Feb 5, 2025
1 parent a5b348c commit 25690a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions librz/arch/il/analysis_il.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static void setup_vm_init_state(RzAnalysisILVM *vm, RZ_NULLABLE RzAnalysisILInit
* \return RzAnalysisRzil* a pointer to RzAnalysisILVM instance
*/
RZ_API RZ_OWN RzAnalysisILVM *rz_analysis_il_vm_new(RzAnalysis *a, RZ_NULLABLE RzReg *init_state_reg) {
rz_return_val_if_fail(a, NULL);
rz_return_val_if_fail(a && a->cur && a->cur->il_config, NULL);
RzAnalysisILConfig *config = a->cur->il_config(a);
if (!config) {
return false;
Expand Down Expand Up @@ -281,9 +281,9 @@ static RzAnalysisILStepResult analysis_il_vm_step_while(
rz_strbuf_append(&sb, "\n");
il_events(vm->vm, &sb);

rz_cons_printf("0x%llx [", addr);
rz_cons_printf("0x%08" PFMT64x " [", addr);
for (int i = 0; i < op.size; ++i) {
rz_cons_printf("%x", code[i]);
rz_cons_printf("%02x", code[i]);
}
rz_cons_printf("] %s\n%s\n", op.mnemonic, rz_strbuf_get(&sb));
rz_cons_flush();
Expand Down
7 changes: 4 additions & 3 deletions librz/core/cil.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,10 @@ static bool step_handle_result(RzCore *core, RzAnalysisILStepResult r) {
RZ_LOG_ERROR("RzIL: invalid instruction or lifting not implemented at address 0x%08" PFMT64x "\n",
rz_reg_get_value_by_role(core->analysis->reg, RZ_REG_NAME_PC));
break;
default:
RZ_LOG_ERROR("RzIL: stepping failed.\n");
break;
default: {
ut64 addr = rz_bv_to_ut64(core->analysis->il_vm->vm->pc);
RZ_LOG_ERROR("RzIL: stepping failed with PC at 0x%" PFMT64x ".\n", addr);
} break;
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion librz/include/rz_il/rz_il_opbuilder_begin.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
#define MSB(x) rz_il_op_new_msb(x)
#define LSB(x) rz_il_op_new_lsb(x)
#define EQ(x, y) rz_il_op_new_eq(x, y)
#define NE(x, y) rz_il_op_new_ne(x, y)
#define ULT(x, y) rz_il_op_new_ult(x, y)
#define ULE(x, y) rz_il_op_new_ule(x, y)
#define UGT(x, y) rz_il_op_new_ugt(x, y)
Expand Down Expand Up @@ -191,6 +192,5 @@
#define BSWAP16(t) rz_il_bswap16(t)
#define BSWAP32(t) rz_il_bswap32(t)
#define BSWAP64(t) rz_il_bswap64(t)
#define NE(x, y) rz_il_op_new_ne(x, y)

#endif

0 comments on commit 25690a9

Please sign in to comment.