AddSurfacepropFile
0x00493060 · 251 bytes · __cdecl
_Z18AddSurfacepropFilePKcP20IPhysicsSurfacePropsP11IFileSystem
Decompiled
undefined (3 params)
/* AddSurfacepropFile(char const*, IPhysicsSurfaceProps*, IFileSystem*) */
void AddSurfacepropFile(char *param_1,IPhysicsSurfaceProps *param_2,IFileSystem *param_3)
{
IFileSystem *pIVar1;
int iVar2;
undefined1 *puVar3;
int iVar4;
code *pcVar5;
int iVar6;
IPhysicsSurfaceProps *pIVar7;
char *pcVar8;
IFileSystem **ppIVar9;
int in_GS_OFFSET;
undefined4 uStack_60;
IFileSystem *local_5c;
char *local_58 [3];
int aiStack_4c [3];
undefined1 auStack_40 [4];
int local_3c;
IFileSystem *local_38;
IPhysicsSurfaceProps *local_34;
char *local_30;
int local_20;
ppIVar9 = &local_5c;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_30 = param_1;
local_34 = param_2;
pIVar1 = param_3 + 4;
local_58[2] = "GAME";
local_58[1] = "rb";
local_58[0] = param_1;
uStack_60 = 0x4930a8;
local_5c = pIVar1;
pcVar8 = (char *)(**(code **)(*(int *)(param_3 + 4) + 8))();
if (pcVar8 == (char *)0x0) {
local_5c = (IFileSystem *)0xc18b68;
local_58[1] = SURFACEPROP_MANIFEST_FILE;
local_58[0] = local_30;
uStack_60 = 0x49315c;
Error();
}
else {
uStack_60 = 0x4930c2;
local_5c = pIVar1;
local_58[0] = pcVar8;
local_38 = pIVar1;
local_3c = (**(code **)(*(int *)(param_3 + 4) + 0x18))();
iVar2 = local_3c + 1;
iVar6 = -((local_3c + 0x10U & 0xfffffff0) + 0x10);
ppIVar9 = (IFileSystem **)((int)&local_5c + iVar6);
iVar4 = *(int *)param_3;
puVar3 = auStack_40 + iVar6;
*(int *)((int)local_58 + iVar6 + 8) = local_3c;
*(int *)((int)local_58 + iVar6 + 4) = iVar2;
*(char **)((int)aiStack_4c + iVar6) = pcVar8;
*(undefined1 **)((int)local_58 + iVar6) = puVar3;
*(IFileSystem **)((int)&local_5c + iVar6) = param_3;
pcVar5 = *(code **)(iVar4 + 0x118);
*(undefined4 *)((int)&uStack_60 + iVar6) = 0x4930f7;
(*pcVar5)();
iVar2 = *(int *)(param_3 + 4);
*(char **)((int)local_58 + iVar6) = pcVar8;
*(IFileSystem **)((int)&local_5c + iVar6) = local_38;
pcVar5 = *(code **)(iVar2 + 0xc);
*(undefined4 *)((int)&uStack_60 + iVar6) = 0x493107;
(*pcVar5)();
pcVar8 = local_30;
pIVar7 = local_34;
puVar3[local_3c] = 0;
iVar2 = *(int *)local_34;
*(undefined1 **)((int)local_58 + iVar6 + 4) = puVar3;
*(char **)((int)local_58 + iVar6) = pcVar8;
*(IPhysicsSurfaceProps **)((int)&local_5c + iVar6) = pIVar7;
pcVar5 = *(code **)(iVar2 + 8);
*(undefined4 *)((int)&uStack_60 + iVar6) = 0x493124;
(*pcVar5)();
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
*(undefined **)((int)ppIVar9 + -4) = &UNK_00493163;
__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.