NOPsleds shift function begins (analysis enhacement test)

This commit is contained in:
pancake 2014-04-07 13:49:09 +02:00
parent 9715a9ee97
commit 52c41a12da
3 changed files with 10 additions and 3 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/r2 - -i
#!/usr/bin/r2 - -qi
# Usage:
# r2 -qi all68k - > all68k.txt
#

View File

@ -230,6 +230,12 @@ static int fcn_recurse(RAnal *anal, RAnalFunction *fcn, ut64 addr, ut8 *buf, ut6
}
}
switch (op.type) {
case R_ANAL_OP_TYPE_NOP:
if ((addr+idx-oplen) == fcn->addr) {
fcn->addr = bb->addr = addr + idx;
continue;
}
break;
case R_ANAL_OP_TYPE_JMP:
#if 1
if (!r_anal_fcn_xref_add (anal, fcn, op.addr, op.jump,
@ -290,10 +296,11 @@ static int fcn_recurse(RAnal *anal, RAnalFunction *fcn, ut64 addr, ut8 *buf, ut6
R_ANAL_REF_TYPE_CALL : R_ANAL_REF_TYPE_CODE)) {
r_anal_op_fini (&op);
//fcn->size = bbsum (fcn);
FITFCNSZ();
FITFCNSZ ();
return R_ANAL_RET_ERROR;
}
break;
//case R_ANAL_OP_TYPE_HLT:
case R_ANAL_OP_TYPE_TRAP:
case R_ANAL_OP_TYPE_UJMP:
case R_ANAL_OP_TYPE_RET:

View File

@ -394,7 +394,7 @@ default:
op->fail = addr + oplen;
break;
case UD_Ihlt:
//op->type = R_ANAL_OP_TYPE_HALT;
op->type = R_ANAL_OP_TYPE_TRAP; //HALT;
break;
case UD_Iret:
case UD_Iretf: