RestoreFilename
0x00bd6e80 · 185 bytes · __cdecl
_Z15RestoreFilenamePKcPci
Decompiled
undefined (3 params)
/* RestoreFilename(char const*, char*, int) */
char * RestoreFilename(char *param_1,char *param_2,int param_3)
{
char cVar1;
int iVar2;
int iVar3;
iVar2 = _V_strlen(param_1);
iVar3 = iVar2 + -1;
if (0 < iVar3) {
cVar1 = param_1[iVar2 + -1];
while ((1 < (byte)(cVar1 - 0x2eU) && (cVar1 != '\\'))) {
iVar3 = iVar3 + -1;
if (iVar3 == 0) {
return param_1;
}
cVar1 = param_1[iVar3];
}
if (((3 < iVar3) && (param_1[iVar3] == '.')) &&
(iVar2 = V_strncmp(param_1 + iVar3 + -4,".360",4), iVar2 == 0)) {
iVar2 = iVar3 + -3;
if (param_3 < iVar3 + -3) {
iVar2 = param_3;
}
V_strncpy(param_2,param_1,iVar2);
V_strncat(param_2,param_1 + iVar3,param_3,-1);
param_1 = param_2;
}
}
return param_1;
}
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.