V_ExtractFilePath
0x00b7c840 · 120 bytes · __cdecl
_Z17V_ExtractFilePathPKcPci
Decompiled
undefined (3 params)
/* V_ExtractFilePath(char const*, char*, int) */
bool V_ExtractFilePath(char *param_1,char *param_2,int param_3)
{
size_t sVar1;
char *pcVar2;
size_t sVar3;
if (param_3 < 1) {
return false;
}
if (param_1 != (char *)0x0) {
sVar1 = strlen(param_1);
sVar3 = 0;
if (sVar1 == 0) goto LAB_00b7c887;
for (pcVar2 = param_1 + (sVar1 - 1); param_1 != pcVar2; pcVar2 = pcVar2 + -1) {
if (pcVar2[-1] == '/') {
sVar3 = (int)pcVar2 - (int)param_1;
goto LAB_00b7c887;
}
}
}
sVar3 = 0;
LAB_00b7c887:
sVar1 = param_3 - 1U;
if ((int)sVar3 <= (int)(param_3 - 1U)) {
sVar1 = sVar3;
}
memcpy(param_2,param_1,sVar1);
param_2[sVar1] = '\0';
return sVar1 != 0;
}
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.