CSentence::SaveToBuffer
0x000dd280 · 664 bytes · __thiscall
_ZN9CSentence12SaveToBufferER10CUtlBuffer
Decompiled
undefined (2 params)
/* CSentence::SaveToBuffer(CUtlBuffer&) */
void __thiscall CSentence::SaveToBuffer(CSentence *this,CUtlBuffer *param_1)
{
float *pfVar1;
float *pfVar2;
undefined1 *puVar3;
undefined1 *puVar4;
int iVar5;
int iVar6;
int iVar7;
double dVar8;
double dVar9;
int local_20;
CUtlBuffer::Printf(param_1,"VERSION 1.0\n");
CUtlBuffer::Printf(param_1,"PLAINTEXT\n");
CUtlBuffer::Printf(param_1,"{\n");
puVar3 = &DAT_002c79d4;
if (*(undefined1 **)this != (undefined1 *)0x0) {
puVar3 = *(undefined1 **)this;
}
CUtlBuffer::Printf(param_1,"%s\n",puVar3);
CUtlBuffer::Printf(param_1,"}\n");
CUtlBuffer::Printf(param_1,"WORDS\n");
CUtlBuffer::Printf(param_1,"{\n");
local_20 = 0;
if (0 < *(int *)(this + 0x10)) {
do {
pfVar1 = *(float **)(*(int *)(this + 4) + local_20 * 4);
puVar3 = (undefined1 *)pfVar1[10];
dVar8 = (double)*pfVar1;
dVar9 = (double)pfVar1[1];
if (puVar3 == (undefined1 *)0x0) {
puVar3 = &DAT_002c79d4;
}
iVar7 = 0;
CUtlBuffer::Printf(param_1,"WORD %s %.3f %.3f\n",puVar3,SUB84(dVar8,0),
(int)((ulonglong)dVar8 >> 0x20),SUB84(dVar9,0),
(int)((ulonglong)dVar9 >> 0x20));
CUtlBuffer::Printf(param_1,"{\n");
if (0 < (int)pfVar1[5]) {
do {
pfVar2 = *(float **)((int)pfVar1[2] + iVar7 * 4);
puVar4 = (undefined1 *)pfVar2[5];
dVar8 = (double)*pfVar2;
dVar9 = (double)pfVar2[1];
if (puVar4 == (undefined1 *)0x0) {
puVar4 = &DAT_002c79d4;
}
iVar7 = iVar7 + 1;
puVar3 = (undefined1 *)(uint)*(ushort *)(pfVar2 + 2);
CUtlBuffer::Printf(param_1,"%i %s %.3f %.3f 1\n",puVar3,puVar4,SUB84(dVar8,0),
(int)((ulonglong)dVar8 >> 0x20),SUB84(dVar9,0),
(int)((ulonglong)dVar9 >> 0x20));
dVar9 = (double)CONCAT44(SUB84(dVar9,0),(int)((ulonglong)dVar8 >> 0x20));
dVar8 = (double)CONCAT44(SUB84(dVar8,0),puVar4);
} while (iVar7 < (int)pfVar1[5]);
}
CUtlBuffer::Printf(param_1,"}\n",puVar3,SUB84(dVar8,0),(int)((ulonglong)dVar8 >> 0x20),
SUB84(dVar9,0),(int)((ulonglong)dVar9 >> 0x20));
local_20 = local_20 + 1;
} while (local_20 < *(int *)(this + 0x10));
}
CUtlBuffer::Printf(param_1,"}\n",puVar3);
CUtlBuffer::Printf(param_1,"EMPHASIS\n");
CUtlBuffer::Printf(param_1,"{\n");
iVar7 = *(int *)(this + 0x3c);
if (0 < iVar7) {
iVar5 = 0;
do {
iVar6 = iVar5 + 1;
pfVar1 = (float *)(*(int *)(this + 0x30) + iVar5 * 0xc);
dVar8 = (double)pfVar1[1];
dVar9 = (double)*pfVar1;
CUtlBuffer::Printf(param_1,"%f %f\n",SUB84(dVar9,0),(int)((ulonglong)dVar9 >> 0x20),
SUB84(dVar8,0),(int)((ulonglong)dVar8 >> 0x20));
puVar3 = SUB84(dVar9,0);
iVar5 = iVar6;
} while (iVar6 != iVar7);
}
CUtlBuffer::Printf(param_1,"}\n",puVar3);
CUtlBuffer::Printf(param_1,"OPTIONS\n");
CUtlBuffer::Printf(param_1,"{\n");
CUtlBuffer::Printf(param_1,"voice_duck %d\n",(byte)this[0x4a] & 1);
if (((byte)this[0x49] & 1) != 0) {
CUtlBuffer::Printf(param_1,"checksum %d\n",*(undefined4 *)(this + 0x44));
}
CUtlBuffer::Printf(param_1,"}\n");
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.