Open
Description
Prerequisites
- I have checked that my issue doesn't exist yet in the issue tracker
Operating System and Version
Windows 10
Game / AppID and Version
CS:S (240)
SourceMod Version
1.12.0.1287
Metamod:Source Version
master branch
Version Verification
- I have updated SourceMod to the latest version and the issue persists
- I have updated SourceMod to the latest snapshot and the issue persists
- I have updated Metamod:Source to the latest snapshot and the issue persists
Updated SourceMod Version
No response
Updated Metamod:Source Version
No response
Description
If you construct a thiscall DynamicDetour
and don't add any parameters then ConstructCallingConvention()
will prepend the this
arg/register to vecArgTypes
and UpdateRegisterArgumentSizes()
will try to index through (an empty) setup->params
for the size of vecArgTypes
.
sourcemod/extensions/dhooks/dynhooks_sourcepawn.cpp
Lines 236 to 267 in b71d3c0
sourcemod/extensions/dhooks/dynhooks_sourcepawn.cpp
Lines 303 to 328 in b71d3c0
Steps to Reproduce
#include <dhooks>
public void OnPluginStart()
{
GameData gamedata = new GameData("maintainbotquota");
DynamicDetour hMaintainBotQuota = DHookCreateDetour(Address_Null, CallConv_THISCALL, ReturnType_Void, ThisPointer_Ignore);
DHookSetFromConf(hMaintainBotQuota, gamedata, SDKConf_Signature, "BotManager::MaintainBotQuota");
hMaintainBotQuota.Enable(Hook_Pre, Detour_MaintainBotQuota);
}
public MRESReturn Detour_MaintainBotQuota()
{
return MRES_Supercede;
}
"Games"
{
"cstrike"
{
"Signatures"
{
"BotManager::MaintainBotQuota"
{
"windows" "\x55\x8B\xEC\x83\xEC\x14\xFF\x15"
"windows64" "\x48\x83\xEC\x78\xFF\x15"
}
}
}
}