Skip to content

Commit

Permalink
IDA 9.0 support (#12)
Browse files Browse the repository at this point in the history
* IDA 9.0 support

* Update auto_re.py
  • Loading branch information
BowDown097 authored Sep 5, 2024
1 parent 5a4a21a commit 2ea88f0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions auto_re.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*
__author__ = 'Trafimchuk Aliaksandr'
__version__ = '1.8'
__version__ = '1.9'

from collections import defaultdict
import idaapi
Expand Down Expand Up @@ -88,9 +88,12 @@
('?', '')
]

def inf_is_64bit():
return (idaapi.inf_is_64bit if idaapi.IDA_SDK_VERSION >= 900 else idaapi.cvar.inf.is_64bit)()


def get_addr_width():
return '16' if idaapi.cvar.inf.is_64bit() else '8'
return '16' if inf_is_64bit() else '8'


def decode_insn(ea):
Expand Down Expand Up @@ -622,12 +625,12 @@ def _apply_tag_on_callee(cls, callee_ea, rv, is_call=False):
@classmethod
def __is_ptr_val(cls, flags):
if idaapi.IDA_SDK_VERSION >= 700:
return (idaapi.is_qword if idaapi.cvar.inf.is_64bit() else idaapi.is_dword)(flags)
return (idaapi.isQwrd if idaapi.cvar.inf.is_64bit() else idaapi.isDwrd)(flags)
return (idaapi.is_qword if inf_is_64bit() else idaapi.is_dword)(flags)
return (idaapi.isQwrd if inf_is_64bit() else idaapi.isDwrd)(flags)

@classmethod
def __get_ptr_val(cls, ea):
if idaapi.cvar.inf.is_64bit():
if inf_is_64bit():
return idaapi.get_qword(ea)

return (idaapi.get_dword if idaapi.IDA_SDK_VERSION >= 700 else idaapi.get_long)(ea)
Expand Down

0 comments on commit 2ea88f0

Please sign in to comment.