Skip to content

Commit

Permalink
Fix software single-stepping for ldr pc ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavoLCR committed Aug 23, 2021
1 parent 32f2207 commit 4e0297e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions librz/analysis/p/analysis_arm_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3494,6 +3494,9 @@ jmp $$ + 4 + ( [delta] * 2 )
case ARM_INS_LDRT:
op->cycles = 4;
// 0x000082a8 28301be5 ldr r3, [fp, -0x28]
op->scale = INSOP(1).mem.scale;
op->ireg = cs_reg_name(handle, REGBASE(1));
op->disp = MEMDISP(1);
if (REGID(0) == ARM_REG_PC) {
op->type = RZ_ANALYSIS_OP_TYPE_UJMP;
if (insn->detail->arm.cc != ARM_CC_AL) {
Expand Down
2 changes: 1 addition & 1 deletion librz/debug/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@ RZ_API int rz_debug_step_soft(RzDebug *dbg) {
}
br = 1;
break;
case RZ_ANALYSIS_OP_TYPE_UJMP:
case RZ_ANALYSIS_OP_TYPE_UCALL:
case RZ_ANALYSIS_OP_TYPE_MJMP:
if (op.ireg) {
Expand All @@ -882,7 +883,6 @@ RZ_API int rz_debug_step_soft(RzDebug *dbg) {
}
br = 1;
break;
case RZ_ANALYSIS_OP_TYPE_UJMP:
default:
next[0] = op.addr + op.size;
br = 1;
Expand Down

0 comments on commit 4e0297e

Please sign in to comment.