atredispartners / aidapal

aiDAPal is an IDA Pro plugin that uses a locally running LLM that has been fine-tuned for Hex-Rays pseudocode to assist with code analysis.
148 stars 15 forks source link

DLL Load Failed for sip Module on Windows 10 (Version 22H2, OS Build 19045) #2

Closed etheaven closed 1 month ago

etheaven commented 3 months ago

Issue Description

When attempting to run the idapal.py script in IDA Pro 7.6 on Windows 10 (Version 22H2, OS Build 19045), the following error is encountered:

Autoanalysis subsystem has been initialized.
D:\Apps\RE\IDAPRO\IDA Pro 7.6\plugins\idapal.py: DLL load failed while importing sip: The specified module could not be found.
Traceback (most recent call last):
  File "D:\Apps\RE\IDAPRO\IDA Pro 7.6\python\3\ida_idaapi.py", line 616, in IDAPython_ExecScript
    exec(code, g)
  File "D:/Apps/RE/IDAPRO/IDA Pro 7.6/plugins/idapal.py", line 5, in <module>
    from idapal_qt_interface import *
  File "D:\Apps\RE\IDAPRO\IDA Pro 7.6/plugins\idapal_qt_interface.py", line 10, in <module>
    from PyQt5 import QtWidgets
ImportError: DLL load failed while importing sip: The specified module could not be found. 

Steps to Reproduce

  1. Install IDA Pro 7.6 on Windows 10 (Version 22H2, OS Build 19045).
  2. Ensure Python 3.11 is installed.
  3. Install sip and PyQt5:

    pip install sip==4.19.8 pip install PyQt5==5.15.4

Expected Behavior

The script should execute without errors, and the required modules should be imported successfully.

Additional Information

Workarounds Tried

  1. Verified the installation of sip and PyQt5.
  2. Confirmed the correct Python path and site-packages directory in ida.cfg.
  3. Attempted to import sip and PyQt5 directly in a Python script, which worked correctly outside of IDA Pro.

Proposed Solution

The issue may be related to IDA Pro not correctly recognizing the installed Python modules. Possible solutions include:

  1. Ensuring IDA Pro's Python environment is correctly set up.
  2. Providing additional documentation on configuring Python for use with IDA Pro plugins.

Any assistance or insights into resolving this issue would be greatly appreciated.

Thank you for your support!

AverageBusinessUser commented 2 months ago

Looks like this may be related to this - https://hex-rays.com/blog/ida-7-4-and-python-3-8/ ?

tomrus88 commented 2 months ago

IDA 7.6 only supports Python 3.4, 3.8, 3.9, 3.10, no? Python 3.11 only supported by IDA 8.2 or higher.

And you must run idapyswitch.exe after installing compatible python version to select which installed version IDA must use.

AverageBusinessUser commented 1 month ago

closing, believe this is resolved.