sourcemod
sourcemod copied to clipboard
[FEATURE REQUEST] SDKCall support for mapping parameters to registers
Help us help you
- [x] I have checked that my issue doesn't exist yet.
- [x] I have tried my absolute best to reduce the problem-space and have provided the absolute smallest test-case possible.
- [x] I can always reproduce the issue with the provided description below.
Description
Compilers do funny things. But unfortunately, this means that calling certain functions is the SDK is currently not viable with SDKCall. For example, in CS:GO CFlashbangProjectile::Create is optimized to a __fastcall automatically by the compiler. This means that the first two parameters are put into ECX and EDX instead of being pushed on to the stack.
I think that SDKCall should basically mimic DHook, where you can pass an argument to PrepSDKCall_AddParameter to express which register that the parameter will live in. Even better, maybe just make it so DHook has a method that allows you to invoke a function directly, and at that point honestly SDKCall could be deprecated over time.