Skip to content

Commit

Permalink
fix: ida 9.0 replace deprecated functions (#106)
Browse files Browse the repository at this point in the history
Added backwards compatibility for versions below 9.0

Signed-off-by: Platy <[email protected]>
  • Loading branch information
PlatyPew authored Sep 8, 2024
1 parent 06d35cf commit 13f2a95
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions decompilers/d2d_ida/d2d_ida/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
from PyQt5.QtCore import QObject
from PyQt5.QtWidgets import QDialog, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QLineEdit, QMessageBox, QGridLayout

import idaapi, ida_idp, ida_struct, idc, ida_enum
import idaapi, ida_idp, idc

IDA_VERSION = idaapi.get_kernel_version()

from .server import IDADecompilerServer

Expand All @@ -29,8 +31,13 @@ def __init__(self):
ida_idp.IDB_Hooks.__init__(self)

def renamed(self, ea, new_name, local_name):
if ida_struct.is_member_id(ea) or ida_struct.get_struc(ea) or ida_enum.get_enum_name(ea):
return 0
if IDA_VERSION == "9.0":
if idc.is_member_id(ea) or idc.get_struc(ea) or idc.get_enum_name(ea):
return 0
else:
import ida_struct, ida_enum
if ida_struct.is_member_id(ea) or ida_struct.get_struc(ea) or ida_enum.get_enum_name(ea):
return 0

# renaming a function header
ida_func = idaapi.get_func(ea)
Expand Down

0 comments on commit 13f2a95

Please sign in to comment.