leecher1337 / haspnt64

HASP / HARDLOCK Dongle driver for NTVDMx64
23 stars 6 forks source link

Windows 11 ARM support for userspace UCLHASP #2

Open andreigherghe opened 1 year ago

andreigherghe commented 1 year ago

Hi,

I'm running Windows 11 ARM in Parallels VM, on a M2 MacBook Pro. Do you think it's possible to run the userspace UCLHASP emulator on it? Perhaps I need to recompile? I already have a UTM (QEMU) Windows 7 image running MkBus just fine, but the performance is quite bad.

I couldn't get MkBus to work directly on Windows 11. Not sure if it's my fault or it's not possible at all.

According to Microsoft,

"All kernel-mode drivers, User-Mode Driver Framework (UMDF) drivers, and print drivers must be compiled to match the architecture of the OS. If an x86 app has a driver, then that driver must be recompiled for Arm64."

Thanks!

leecher1337 commented 1 year ago

So you are running a DOS-application on a Windows 11 ARM VM on a M2 MacBook Pro? I'd try to use the DOS-driver directly on a DOS-emulation of your choice that operates on your MacBook Pro directly then, it should be a lot faster without having to emulate Win 11.

Be aware that this driver only emulates the DOS-calls for HASP.

If you want to compile MkBus for ARM, you can try to do so by grabbing the Mkbus2017 source code and try to compile it for that target platform, I checked if my NTDDK has ARM support and it doesn't have, this must work with Visual Studio somehow nowadays, but I have no idea on how to compile it, you are on your own here.

andreigherghe commented 1 year ago

It's not a DOS-application, but I'm pretty sure it's using the Legacy Hardlock mode. The key itself is a Sentinel HL Basic (blue) type, but the password and .reg file correspond to the Hardlock protocol.

I just managed to compile and install Mkbus2017 for ARM, but it's still showing up as an Unknown Device in device manager. On my UTM (QEMU, x86) emulator I see that the Mkbus Sentinel Hardlock Key is using the akshasp service, which probably does not work on ARM at all.

My biggest challenge is that I'm not familiar with the Hardlock architecture. I don't know what depends on what. I'm hoping that there is a way to avoid the Thales HASP driver dependency altogether. These are my certainties so far:

Would your NTDDK Driver or UCLHASP implementation help in any part of the flow, assuming they are compiled for ARM?

leecher1337 commented 1 year ago

UCLHASP focuses on the DOS API of HASP, namely the functions listed in the docs. So I don't think that it may be of great use for Windows programs that are protected with a Sentinel HL Basic dongle. Iirc, the calling mechanism to the original Hardlock-driver is quite different between DOS and Windows applications. For that reason, the HASPNT.SYS driver also has a seperate call for DOS-applications to call in.

I'd focus my efforts on getting the Mkbus2017 driver working on ARM. You may want to use WinDbg to do some kernel debugging, mainly the PNP-calls, if your device doesn't show up correctly in device manager.