mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-11 09:05:33 +00:00
Fix #1031 - incorrect call offsets calculated in DOS EXEs
Also fix the incorrect MZ entrypoint calculation.
This commit is contained in:
parent
8d84f4b30f
commit
62b2c60031
@ -131,7 +131,7 @@ static st64 getval(ud_operand_t *op) {
|
||||
int bits = op->size;
|
||||
switch (op->type) {
|
||||
case UD_OP_PTR:
|
||||
return (op->lval.ptr.seg<<4) | (op->lval.ptr.off & 0xFFFF);
|
||||
return (op->lval.ptr.seg<<4) + (op->lval.ptr.off & 0xFFFF);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -385,9 +385,11 @@ default:
|
||||
op->type = R_ANAL_OP_TYPE_UCALL;
|
||||
op->jump = 0; // EAX, EBX, ... use anal->reg
|
||||
break;
|
||||
case UD_OP_PTR:
|
||||
op->jump = (int)getval (&u.operand[0]);
|
||||
break;
|
||||
case UD_OP_IMM:
|
||||
case UD_OP_MEM:
|
||||
case UD_OP_PTR:
|
||||
default:
|
||||
op->jump = addr + oplen + (int)getval (&u.operand[0]);
|
||||
}
|
||||
|
@ -71,8 +71,7 @@ static RList* entries(RBinFile *arch) {
|
||||
if (!(ret = r_list_new ()))
|
||||
return NULL;
|
||||
ret->free = free;
|
||||
off = exe->header_paragraphs * 16L;
|
||||
off += exe->ip; // XXX
|
||||
off = (exe->cs << 4) + exe->ip;
|
||||
if ((ptr = R_NEW (RBinAddr))) {
|
||||
ptr->paddr = off;
|
||||
ptr->vaddr = off;
|
||||
|
Loading…
x
Reference in New Issue
Block a user