trailofbits / uthenticode

A cross-platform library for verifying Authenticode signatures
https://trailofbits.github.io/uthenticode/
MIT License
136 stars 33 forks source link

Supports Windows XP #101

Closed zeze-zeze closed 1 month ago

zeze-zeze commented 1 month ago

I use this project in Windows XP SP3 and it makes an exception and outputs the error message "bcrypt.dll not found". After some surveys, it turned out that XP doesn't have bcrypt.dll in the system by default. But even if I copy a bcrypt.dll to the same directory, it still has the error message "InitializeSRWLock not found in Kernel32.dll". It seems there are some dependencies in this project that XP doesn't have.

Is there any solution or workaround for XP to use this project?

woodruffw commented 1 month ago

Is there any solution or workaround for XP to use this project?

None that I'm aware of; I've never tested this on any version of Windows below 10. I would be happy to consider a patch that supports XP, assuming it's not overly burdensome for versions of Windows (and other supported platforms) that are still supported by their companies/upstreams.

zeze-zeze commented 1 month ago

Looks like the dependency that makes an exception is OpenSSL. I used OpenSSL 3.0.2 in vcpkg to build uthenticode, but it uses some functions which don't work on XP.

According to "bcrypt.dll was not found" after compiling for Windows XP., we need to compile OpenSSL with an option -D_WIN32_WINNT=0x0501.

zeze-zeze commented 1 month ago

Finally, after some effort, I built OpenSSL by following Building OpenSSL on Windows, then imported libcrypto.lib and libssl.lib into the project and it worked on XP!

Note that to build 32bit OpenSSL library we need to create a "Developer Command Prompt" by using VsDevCmd.bat. The following command is how I configure:

perl Configure VC-WIN32 no-asm no-shared no-async -D_WIN32_WINNT=0x0501 -D_USING_V141_SDK71_
zeze-zeze commented 1 month ago

Not sure if this issue is still needed because it should not to be an issue for uthenticode. Maybe add some tutorials about how to make it work on XP, or just close the issue.

woodruffw commented 1 month ago

Yeah, IMO this is outside the scope of our documentation here — we don’t not support XP, but we don’t explicitly support it either. So I think this issue itself is sufficient for any future users who run into problems here 🙂Sent from mobile. Please excuse my brevity.On Jul 24, 2024, at 4:26 AM, Zeze @.***> wrote: Not sure if this issue is still needed because it seems not to be an issue for uthenticode. Maybe add some tutorials about how to make it work on XP, or just close the issue.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>