VOX_GetDirectory
0x000f04a0 · 163 bytes · __cdecl
_Z16VOX_GetDirectoryPciS_
Decompiled
undefined (3 params)
/* VOX_GetDirectory(char*, int, char*) */
char * VOX_GetDirectory(char *param_1,int param_2,char *param_3)
{
char cVar1;
int iVar2;
char *pcVar3;
int iVar4;
iVar4 = 0;
iVar2 = _V_strlen(param_3);
pcVar3 = param_3 + iVar2 + -1;
cVar1 = *pcVar3;
if ((cVar1 != '/') && (param_3 < pcVar3)) {
do {
pcVar3 = pcVar3 + -1;
iVar4 = iVar4 + 1;
cVar1 = *pcVar3;
if (pcVar3 <= param_3) break;
} while (cVar1 != '/');
}
if (cVar1 == '/') {
iVar2 = _V_strlen(param_3);
iVar2 = iVar2 - iVar4;
if (iVar2 < param_2) {
iVar4 = 0;
if (-1 < iVar2) {
iVar4 = iVar2;
}
}
else {
iVar4 = param_2 + -1;
}
_V_memcpy(param_1,param_3,iVar4);
param_1[iVar4] = '\0';
return pcVar3 + 1;
}
V_strncpy(param_1,"vox/",param_2);
return param_3;
}
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.