Skip to content

Commit

Permalink
Fix #15235 - push [mem] not handled in /r ##anal
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Oct 10, 2019
1 parent 32dafd2 commit d2d95f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 9 additions & 0 deletions libr/anal/p/anal_x86_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2458,6 +2458,15 @@ static void anop(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len, csh
case X86_INS_PUSHFD:
case X86_INS_PUSHFQ:
switch (INSOP(0).type) {
case X86_OP_MEM:
if (INSOP(0).mem.disp) {
op->val = op->ptr = INSOP(0).mem.disp;
op->type = R_ANAL_OP_TYPE_PUSH;
} else {
op->type = R_ANAL_OP_TYPE_UPUSH;
}
op->cycles = CYCLE_REG + CYCLE_MEM;
break;
case X86_OP_IMM:
op->val = op->ptr = INSOP(0).imm;
op->type = R_ANAL_OP_TYPE_PUSH;
Expand Down
4 changes: 1 addition & 3 deletions libr/asm/arch/8051/8051_ass.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,17 +347,15 @@ static bool address_bit(char const* addr_str, ut8* addr_out) {
char const *separator = r_str_lchr (addr_str, '.');
ut8 byte;
int bit;
bool ret;
bool ret = false;
if (!separator) {
// FIXME: accept symbols as well as dot-notation
ret = false;
goto end;
}
r_str_ncpy (bytepart, addr_str, separator - addr_str + 1);
bytepart[separator - addr_str + 1] = '\0';
r_str_ncpy (bitpart, separator + 1, strlen(separator));
if (!address_direct (bytepart, &byte)) {
ret = false;
goto end;
}
if (1 < strlen (bitpart)
Expand Down

0 comments on commit d2d95f6

Please sign in to comment.