ComputeModFilename
0x00bd6c00 · 256 bytes · __cdecl
_Z18ComputeModFilenamePKcPcj
Decompiled
undefined (3 params)
/* ComputeModFilename(char const*, char*, unsigned int) */
void ComputeModFilename(char *param_1,char *param_2,uint param_3)
{
int iVar1;
uint uVar2;
int iVar3;
uint uVar4;
size_t __n;
uint uVar5;
iVar1 = V_stristr(param_1,"\\content\\");
if (iVar1 == 0) {
V_strncpy(param_2,param_1,param_3);
return;
}
uVar2 = iVar1 - (int)param_1;
if (uVar2 < param_3) {
memcpy(param_2,param_1,uVar2);
__n = param_3 - uVar2;
if (6 < __n) {
__n = 6;
}
memcpy(param_2 + uVar2,"\\game\\",__n);
uVar5 = __n + uVar2;
if (uVar5 != param_3) {
iVar3 = _V_strlen(param_1);
uVar4 = (iVar3 - uVar2) - 8;
uVar2 = param_3 - uVar5;
if (uVar4 <= param_3 - uVar5) {
uVar2 = uVar4;
}
memcpy(param_2 + uVar5,(void *)(iVar1 + 9),uVar2);
return;
}
param_2[uVar5 - 1] = '\0';
return;
}
memcpy(param_2,param_1,param_3);
param_2[param_3 - 1] = '\0';
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.