Skip to content

Conversation

@yani
Copy link
Contributor

@yani yani commented May 28, 2025

This will:

  • Verify the steam_api.dll certificate using the Windows API (protect against malware)
  • Allow loading the DLL under Wine (in a very rare cases the user might have Steam running under Wine too)
  • Make steam_api_init() a void function

@yani yani requested a review from SimLV May 28, 2025 16:52
@yani yani marked this pull request as draft May 28, 2025 16:52
@yani yani marked this pull request as ready for review May 28, 2025 16:52
@SimLV
Copy link
Contributor

SimLV commented May 29, 2025

I am not sure what problem which this PR solves is exist at all.
Consider user wants to install fake steam_api.dll into KFX installation so what?

@yani
Copy link
Contributor Author

yani commented May 29, 2025

I am not sure what problem which this PR solves is exist at all. Consider user wants to install fake steam_api.dll into KFX installation so what?

Maybe a command line flag to disable the check would be better.

Normally you can not edit the DLLs of the application without admin rights (since Windows Vista), but because using the Steam API requires you to download and place a DLL, we can protect users against malicious DLLs from shady sources. Just google "steam_api.dll" and you will see a lot of download links. Who knows if all of those are safe.

@SimLV
Copy link
Contributor

SimLV commented May 29, 2025

Okay. I am a bit concerned about bloating dependencies but ok

@yani
Copy link
Contributor Author

yani commented May 29, 2025

Okay. I am a bit concerned about bloating dependencies but ok

It's the Windows API so I think that's not too much of a problem.

Binary file size change is also minimal: 9866KiB -> 9868KiB. That's a 0.02% increase.

@yani
Copy link
Contributor Author

yani commented May 29, 2025

Should I add a command line option to not verify the certificate?

@SimLV
Copy link
Contributor

SimLV commented Jun 1, 2025

Yes. Better to add it. I think you don't have to support it in your Qt Launcher. (I hope you have place for "other options" there)

@Loobinex Loobinex marked this pull request as draft June 22, 2025 17:53
@yani
Copy link
Contributor Author

yani commented Aug 26, 2025

I added the -nocertverify command line parameter and separated the certification verification code into its own source files.

@xtremeqg
Copy link
Contributor

Like @SimLV I don't see the point of checking whether the DLL is real or not. No game I know of does that.

Normally you can not edit the DLLs of the application without admin rights (since Windows Vista) ...

Depends on where and how the application is installed. Regardless, for compatibility reasons Windows will always load any DLL with the same name from the game folder first.

... Steam API requires you to download and place a DLL ...

All the games I know either ship with with a copy of this DLL and/or load the system one.

... we can protect users against malicious DLLs from shady sources. Just google "steam_api.dll" and you will see a lot of download links.

The same holds true for all other existing and non-existing DLLs. If this is the only reason for performing the validation, I'd just provide the DLL along with KFX.

I did have concerns as far as certificate expiration goes (I hate time bombs) but as long as WTD_LIFETIME_SIGNING_FLAG isn't set, expiration appears to be ignored.

@yani
Copy link
Contributor Author

yani commented Aug 26, 2025

No game I know of does that.

Depends on where and how the application is installed. Regardless, for compatibility reasons Windows will always load any DLL with the same name from the game folder first.

All the games I know either ship with with a copy of this DLL and/or load the system one.

We can not ship the official DLL ourselves because we are not an official mod on Steam. So people have to add their own one. I thought it would be good to protect users who do this.

I did have concerns as far as certificate expiration goes (I hate time bombs) but as long as WTD_LIFETIME_SIGNING_FLAG isn't set, expiration appears to be ignored.

Are you sure it's ignored? I think it's just handled by Windows and its root certificate store.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants