Skip to content

Commit

Permalink
Fixed 64-bit fixup issue
Browse files Browse the repository at this point in the history
idaapi.get_name_value returns only 32-bit addresses, and this is IDA.DLL limitation.
Because of that we have to use idaapi.get_name_ea.
  • Loading branch information
n-o-o-n authored Feb 16, 2018
1 parent eb27b3c commit b8b0f79
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions keypatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,12 @@ def _resolve(_op, ignore_kw=True):
if parts[2] != '':
sym = parts[2]

(t, v) = idaapi.get_name_value(address, sym)

# skip if name doesn't exist or segment / segment registers
if t in (idaapi.NT_SEG, idaapi.NT_NONE):
ea = idaapi.get_name_ea(address, sym)
# skip if name doesn't exist
if ea == idaapi.BADADDR:
continue

_op = _op.replace(sym, '0x{0:X}'.format(v))
_op = _op.replace(sym, '0x{0:X}'.format(ea))

return _op

Expand Down

0 comments on commit b8b0f79

Please sign in to comment.