Fix aht cjmp and optimize assert in asm.emu when no regprofile is set ##anal

This commit is contained in:
pancake 2019-01-20 12:15:39 +01:00
parent 9cc31fbfc0
commit 6c2d945272
4 changed files with 10 additions and 11 deletions

View File

@ -263,7 +263,7 @@ R_API RAnalHint *r_anal_hint_from_string(RAnal *a, ut64 addr, const char *str) {
case 'B': hint->new_bits = sdb_atoi (nxt); break;
case 's': hint->size = sdb_atoi (nxt); break;
case 'S': hint->syntax = (char*)sdb_decode (nxt, 0); break;
case 't': hint->type = sdb_atoi (nxt); break;
case 't': hint->type = r_num_get (NULL, nxt); break;
case 'o': hint->opcode = (char*)sdb_decode (nxt, 0); break;
case 'O': hint->offset = (char*)sdb_decode (nxt, 0); break;
case 'e': hint->esil = (char*)sdb_decode (nxt, 0); break;

View File

@ -4268,11 +4268,13 @@ static void ds_print_esil_anal(RDisasmState *ds) {
}
esil = core->anal->esil;
pc = r_reg_get_name (core->anal->reg, R_REG_NAME_PC);
r_reg_setv (core->anal->reg, pc, at + ds->analop.size);
esil->cb.user = ds;
esil->cb.hook_reg_write = myregwrite;
esil->cb.hook_reg_read = myregread;
hook_mem_write = esil->cb.hook_mem_write;
if (pc) {
r_reg_setv (core->anal->reg, pc, at + ds->analop.size);
esil->cb.user = ds;
esil->cb.hook_reg_write = myregwrite;
esil->cb.hook_reg_read = myregread;
hook_mem_write = esil->cb.hook_mem_write;
}
if (ds->show_emu_stack) {
esil->cb.hook_mem_write = mymemwrite2;
} else {

View File

@ -728,7 +728,7 @@ typedef struct r_anal_hint_t {
char *syntax;
char *esil;
char *offset;
int type;
ut32 type;
int size;
int bits;
int new_bits; // change asm.bits after evaluating this instruction

View File

@ -127,11 +127,8 @@ R_API bool r_reg_set_value(RReg *reg, RRegItem *item, ut64 value) {
int fits_in_arena;
ut8 bytes[12];
ut8 *src = bytes;
r_return_val_if_fail (reg && item, false);
if (!item) {
eprintf ("r_reg_set_value: item is NULL\n");
return false;
}
switch (item->size) {
case 80:
case 96: // long floating value