V_FileBase
0x0025e3d0 · 234 bytes · __cdecl
_Z10V_FileBasePKcPci
Decompiled
undefined (3 params)
/* V_FileBase(char const*, char*, int) */
void V_FileBase(char *param_1,char *param_2,int param_3)
{
char cVar1;
char cVar2;
size_t sVar3;
int iVar4;
int iVar5;
int iVar6;
if ((param_1 == (char *)0x0) || (cVar1 = *param_1, cVar1 == '\0')) {
*param_2 = '\0';
return;
}
sVar3 = strlen(param_1);
iVar5 = sVar3 - 1;
iVar6 = iVar5;
if (iVar5 == 0) {
LAB_0025e437:
if (cVar1 != '.') goto LAB_0025e444;
iVar4 = 0;
}
else {
cVar2 = param_1[sVar3 - 1];
iVar4 = iVar5;
while (cVar2 != '.') {
if (cVar2 == '/') goto LAB_0025e444;
iVar4 = iVar4 + -1;
if (iVar4 == 0) goto LAB_0025e437;
cVar2 = param_1[iVar4];
}
}
iVar6 = iVar4 + -1;
LAB_0025e444:
if (iVar5 < 0) {
LAB_0025e466:
iVar5 = 0;
}
else {
cVar1 = param_1[sVar3 - 1];
while (cVar1 != '/') {
iVar5 = iVar5 + -1;
if (iVar5 == -1) goto LAB_0025e466;
cVar1 = param_1[iVar5];
}
iVar5 = iVar5 + 1;
}
sVar3 = (iVar6 - iVar5) + 2;
if (param_3 < (int)sVar3) {
sVar3 = param_3;
}
strncpy(param_2,param_1 + iVar5,sVar3);
if ((int)sVar3 < 1) {
return;
}
param_2[sVar3 - 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.