COM_CopyFile
0x001267b0 · 416 bytes · __cdecl
_Z12COM_CopyFilePKcS0_
Decompiled
undefined (2 params)
/* COM_CopyFile(char const*, char const*) */
undefined4 COM_CopyFile(char *param_1,char *param_2)
{
int iVar1;
int iVar2;
uint uVar3;
undefined4 uVar4;
int in_GS_OFFSET;
undefined1 local_1020 [4096];
int local_20;
uVar4 = 0;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar1 = (**(code **)(*(int *)(g_pFileSystem + 4) + 8))(g_pFileSystem + 4,param_1,&DAT_002a3e98,0);
if (iVar1 != 0) {
COM_CreatePath(param_2);
iVar2 = (**(code **)(*(int *)(g_pFileSystem + 4) + 8))
(g_pFileSystem + 4,param_2,&DAT_002a5c80,&DAT_002a0772);
if (iVar2 == 0) {
(**(code **)(*(int *)(g_pFileSystem + 4) + 0xc))(g_pFileSystem + 4,iVar1);
}
else {
for (uVar3 = (**(code **)(*(int *)(g_pFileSystem + 4) + 0x18))(g_pFileSystem + 4,iVar1);
0 < (int)uVar3; uVar3 = uVar3 - 0x1000) {
if (uVar3 < 0x1000) {
(*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,local_1020,uVar3,iVar1);
(**(code **)(*(int *)(g_pFileSystem + 4) + 4))(g_pFileSystem + 4,local_1020,uVar3,iVar2);
break;
}
(*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,local_1020,0x1000);
(**(code **)(*(int *)(g_pFileSystem + 4) + 4))(g_pFileSystem + 4,local_1020,0x1000,iVar2);
}
uVar4 = 1;
(**(code **)(*(int *)(g_pFileSystem + 4) + 0xc))(g_pFileSystem + 4,iVar1);
(**(code **)(*(int *)(g_pFileSystem + 4) + 0xc))(g_pFileSystem + 4,iVar2);
}
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar4;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.