CDemoFile::WriteCustomData
0x00130b30 · 505 bytes · __thiscall
_ZN9CDemoFile15WriteCustomDataEiPKvji
Decompiled
undefined (5 params)
/* CDemoFile::WriteCustomData(int, void const*, unsigned int, int) */
void __thiscall
CDemoFile::WriteCustomData(CDemoFile *this,int param_1,void *param_2,uint param_3,int param_4)
{
CUtlStreamBuffer *this_00;
char cVar1;
int iVar2;
void *pvVar3;
undefined1 local_18;
undefined1 uStack_17;
undefined1 uStack_16;
undefined1 uStack_15;
undefined1 local_14;
undefined1 uStack_13;
undefined1 uStack_12;
undefined1 uStack_11;
undefined1 local_10;
undefined1 local_f;
undefined1 local_e;
undefined1 local_d;
this_00 = (CUtlStreamBuffer *)(this + 0x534);
cVar1 = CUtlStreamBuffer::IsOpen(this_00);
if (cVar1 == '\0') {
return;
}
WriteCmdHeader(this,'\b',param_4,0);
if (((byte)this[0x549] & 1) == 0) {
cVar1 = CUtlBuffer::CheckPut((CUtlBuffer *)this_00,4);
if (cVar1 != '\0') {
if (((byte)this[0x568] & 1) == 0) {
*(int *)(*(int *)(this + 0x534) + (*(int *)(this + 0x544) - *(int *)(this + 0x554))) =
param_1;
iVar2 = *(int *)(this + 0x544);
}
else {
iVar2 = *(int *)(this + 0x544);
pvVar3 = (void *)((iVar2 - *(int *)(this + 0x554)) + *(int *)(this + 0x534));
if (pvVar3 != (void *)0x0) {
uStack_15 = (undefined1)((uint)param_1 >> 0x18);
local_10 = uStack_15;
uStack_16 = (undefined1)((uint)param_1 >> 0x10);
local_f = uStack_16;
uStack_17 = (undefined1)((uint)param_1 >> 8);
local_e = uStack_17;
local_18 = (undefined1)param_1;
local_d = local_18;
_V_memcpy(pvVar3,&local_10,4);
iVar2 = *(int *)(this + 0x544);
}
}
*(int *)(this + 0x544) = iVar2 + 4;
CUtlBuffer::AddNullTermination((CUtlBuffer *)this_00);
}
}
else {
CUtlBuffer::Printf((CUtlBuffer *)this_00,"%d",param_1);
}
if (((byte)this[0x549] & 1) == 0) {
cVar1 = CUtlBuffer::CheckPut((CUtlBuffer *)this_00,4);
if (cVar1 != '\0') {
if (((byte)this[0x568] & 1) == 0) {
*(uint *)(*(int *)(this + 0x534) + (*(int *)(this + 0x544) - *(int *)(this + 0x554))) =
param_3;
iVar2 = *(int *)(this + 0x544);
}
else {
iVar2 = *(int *)(this + 0x544);
pvVar3 = (void *)((iVar2 - *(int *)(this + 0x554)) + *(int *)(this + 0x534));
if (pvVar3 != (void *)0x0) {
uStack_11 = (undefined1)(param_3 >> 0x18);
local_10 = uStack_11;
uStack_12 = (undefined1)(param_3 >> 0x10);
local_f = uStack_12;
uStack_13 = (undefined1)(param_3 >> 8);
local_e = uStack_13;
local_14 = (undefined1)param_3;
local_d = local_14;
_V_memcpy(pvVar3,&local_10,4);
iVar2 = *(int *)(this + 0x544);
}
}
*(int *)(this + 0x544) = iVar2 + 4;
CUtlBuffer::AddNullTermination((CUtlBuffer *)this_00);
}
}
else {
CUtlBuffer::Printf((CUtlBuffer *)this_00,"%d",param_3);
}
CUtlBuffer::Put((CUtlBuffer *)this_00,param_2,param_3);
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.