Skip to content

Fix callbacks for pre-1.02x SDKs#447

Merged
Detanup01 merged 1 commit intoDetanup01:devfrom
NicknineTheEagle:nn/callbacks
Mar 8, 2026
Merged

Fix callbacks for pre-1.02x SDKs#447
Detanup01 merged 1 commit intoDetanup01:devfrom
NicknineTheEagle:nn/callbacks

Conversation

@NicknineTheEagle
Copy link
Contributor

@NicknineTheEagle NicknineTheEagle commented Mar 4, 2026

SDK version 1.02x added an overload for CCallbackBase::Run. Because of how MSVC handles virtual function overloads, this changed the order of functions in vtable from 1.02, which breaks old games. This PR adds a workaround for this issue that uses a wrapper for the old CCallbackBase variant.

Note that this only affects steam_api.dll replacement, loader + steamclient.dll setup already works fine as is.

More about this problem with vtables and overloads:
https://stackoverflow.com/questions/61542063/inversion-of-generated-vtable-functions-order-for-functions-with-the-same-name
https://stackoverflow.com/questions/22059092/visual-c-methods-in-vfptr-in-reverse-order

@Detanup01
Copy link
Owner

Lmao, ms..

@camerasfirmwares
Copy link

Don't do that, instead rename the functions in the way they are in memory layout. So you don't have an overload or wrapper.

@NicknineTheEagle
Copy link
Contributor Author

NicknineTheEagle commented Mar 5, 2026

Tell that to Valve, not us. :P We're stuck with their mess.

@camerasfirmwares
Copy link

camerasfirmwares commented Mar 5, 2026

There was a reason why I said it here and not to Valve but, ok, then just ignore my comment.

@Detanup01
Copy link
Owner

Propose the change then I dont know much C++ to do anything either so

@NicknineTheEagle
Copy link
Contributor Author

NicknineTheEagle commented Mar 5, 2026

The issue isn't that our vtable order doesn't match Valve's, the issue is that Valve's own vtable order is inconsistent between old and new SDKs on Windows because they added an overload. Renaming the overload on our end wouldn't solve anything. Like I said, this is Valve's mess that we're stuck with.

@Detanup01 Detanup01 requested a review from universal963 March 8, 2026 10:17
@Detanup01 Detanup01 merged commit 7bb2d11 into Detanup01:dev Mar 8, 2026
64 checks passed
@NicknineTheEagle NicknineTheEagle deleted the nn/callbacks branch March 8, 2026 15:22
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.

4 participants