Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions libbs/decompilers/ida/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,12 @@ def local_var_changed(self, vdui, lvar, reset_type=False, reset_name=False, var_
#

if IDA_IS_INTERACTIVE:
from PyQt5 import QtCore
from PyQt5.QtGui import QKeyEvent
if idaapi.IDA_SDK_VERSION < 920:
from PyQt5 import QtCore
from PyQt5.QtGui import QKeyEvent
else:
from PySide6 import QtCore
from PySide6.QtGui import QKeyEvent

class IDAHotkeyHook(ida_kernwin.UI_Hooks):
def __init__(self, keys_to_pass, uiptr):
Expand Down
16 changes: 13 additions & 3 deletions libbs/decompilers/ida/ida_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
try:
import sip
except ImportError:
import PyQt5.sip as sip
if idaapi.IDA_SDK_VERSION < 920:
import PyQt5.sip as sip
else:
import PyQt6.sip as sip

from libbs.ui.version import set_ui_version
set_ui_version("PyQt5")
if idaapi.IDA_SDK_VERSION < 920:
set_ui_version("PyQt5")
else:
set_ui_version("PySide6")
from libbs.ui.qt_objects import QWidget, QVBoxLayout

_l = logging.getLogger(__name__)
Expand Down Expand Up @@ -39,7 +45,11 @@ def __init__(self, options):
class IDAWidgetWrapper(object):
def __init__(self, qt_cls, window_name: str, *args, **kwargs):
self.twidget = idaapi.create_empty_widget(window_name)
self.widget = sip.wrapinstance(int(self.twidget), QWidget)
if idaapi.IDA_SDK_VERSION < 920:
self.widget = sip.wrapinstance(int(self.twidget), QWidget)
else:
from shiboken6 import wrapInstance
self.widget = wrapInstance(int(self.twidget), QWidget)
self.name = window_name
self.widget.name = window_name
self.width_hint = 250
Expand Down
5 changes: 4 additions & 1 deletion libbs/decompilers/ida/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ def __init__(self, **kwargs):
self._deleted_artifacts = defaultdict(set)
self.cached_ord_to_type_names = {}

compatible_qt_version = "PySide6"
if idaapi.IDA_SDK_VERSION < 920:
compatible_qt_version = "PyQt5"
super().__init__(
name="ida", qt_version="PyQt5", artifact_lifter=IDAArtifactLifter(self),
name="ida", qt_version=compatible_qt_version, artifact_lifter=IDAArtifactLifter(self),
decompiler_available=compat.initialize_decompiler(), **kwargs
)

Expand Down