evilrdp
evilrdp copied to clipboard
PyQt6 in build.bat
Hi there!
I have some struggles to run the generated .exe
in Windows that I wanted to share. I am using Python 3.12.2.
First, I run the build.bat
file to generate the .exe
. This command finishes without errors, but when I then try to run evilrdp.exe
, I receive the following error:
C:\Users\XXX\evilrdp-main\evilrdp-main\builder\pyinstaller>evilrdp.exe
Traceback (most recent call last):
File "evilrdp\__main__.py", line 9, in <module>
File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
File "evilrdp\gui.py", line 21, in <module>
ImportError: cannot import name 'ImageQt' from 'PIL.ImageQt' (C:\Users\XXX\AppData\Local\Temp\_MEI87202\PIL\ImageQt.pyc). Did you mean: 'Image'?
[2864] Failed to execute script '__main__' due to unhandled exception!
However, if I activate the generated virtual environment and install PyQt6 additionally, I can run the Python script successfully:
(env) C:\Users\XXX\evilrdp-main\evilrdp-main\evilrdp>python __main__.py --help
usage: __main__.py [-h] [-v] [--no-mouse-hover] [--no-keyboard] [--res RES] [--keyboard KEYBOARD] url
Async RDP Client. Duckyscript will be executed by pressing ESC 3 times
positional arguments:
url RDP connection url
options:
-h, --help show this help message and exit
-v, --verbose Verbosity, can be stacked
--no-mouse-hover Disables sending mouse hovering data. (saves bandwith)
--no-keyboard Disables keyboard input. (whatever)
--res RES Resolution in "WIDTHxHEIGHT" format. Default: "1024x768"
--keyboard KEYBOARD Keyboard on the client side. Used for VNC and duckyscript
So it might be that PyQt6 would need to be installed with the build.bat script as well? Does anyone have some thoughts on this?
All the best!
EDIT: Sadly, this does not fully fix the issue, as soon as I want to run evilrdp, I receive the following runtime error:
Traceback (most recent call last):
File "C:\Users\XXX\evilrdrp-main\evilrdp-main\builder\pyinstaller\env\Lib\site-packages\evilrdpgui.py", line 312, in updateImage
qp.drawImage(event.x, event.y, rect, 0, 0, event.width, event.height)
TypeError: arguments did not match any overloaded call:
drawImage(self, QRect, QImage, QRect): argument 1 has unexpected type 'int'
drawImage(self, QPoint, QImage): argument 1 has unexpected type 'int'
drawImage(self, QPointF, QImage): argument 1 has unexpected type 'int'
drawImage(self, QPoint, image: QImage): argument 1 has unexpected type 'int'
drawImage(self, int, y: int, image: QImage, sx: int = 0, sy: int = 0, sw: int = -1, sh: int = -1, flags: Union[Qt.ImageConversionFlags, Qt.ImageConversionFlag] = Qt.ImageConversionFlag.AutoColor): argument 3 has unexpected type 'QRect'
drawImage(self, QRect, image: QImage, sourceRect: QRect, flags: Union[Qt.ImageConversionFlags, Qt.ImageConversionFlag] = Qt.ImageConversionFlag.AutoColor): argument 1 has unexpected type 'int'
drawImage(self, x: int, y: int, image: QImage, sx: int = 0, sy: int = 0, sw: int = -1, sh: int = -1, flags: Union[Qt.ImageConversionFlags, Qt.ImageConversionFlag] = Qt.ImageConversionFlag.AutoColor): argument 1 has unexpected type 'int'