CNetworkStringTable::WriteStringTable
0x001a4500 · 696 bytes · __thiscall
_ZN19CNetworkStringTable16WriteStringTableER8bf_write
Decompiled
undefined (2 params)
/* CNetworkStringTable::WriteStringTable(bf_write&) */
void __thiscall CNetworkStringTable::WriteStringTable(CNetworkStringTable *this,bf_write *param_1)
{
int iVar1;
uint uVar2;
byte *pbVar3;
char *pcVar4;
CNetworkStringTableItem *this_00;
void *pvVar5;
uint uVar6;
int local_20 [4];
uVar6 = 0;
uVar2 = (**(code **)(**(int **)(this + 0x38) + 8))(*(int **)(this + 0x38));
bf_write::WriteWord(param_1,uVar2);
if (0 < (int)uVar2) {
do {
while( true ) {
pcVar4 = (char *)(**(code **)(*(int *)this + 0x28))(this,uVar6);
bf_write::WriteString(param_1,pcVar4);
pvVar5 = (void *)(**(code **)(*(int *)this + 0x30))(this,uVar6,local_20);
iVar1 = *(int *)(param_1 + 0xc);
if (local_20[0] < 1) break;
if (iVar1 < *(int *)(param_1 + 8)) {
if (param_1[0x10] == (bf_write)0x0) {
pbVar3 = (byte *)((iVar1 >> 3) + *(int *)param_1);
*pbVar3 = *pbVar3 | (byte)(1 << ((byte)iVar1 & 7));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
}
}
else {
param_1[0x10] = (bf_write)0x1;
}
bf_write::WriteWord(param_1,(int)(short)local_20[0]);
bf_write::WriteBytes(param_1,pvVar5,local_20[0]);
LAB_001a4593:
uVar6 = uVar6 + 1;
if (uVar2 == uVar6) goto LAB_001a4618;
}
if (*(int *)(param_1 + 8) <= iVar1) {
param_1[0x10] = (bf_write)0x1;
goto LAB_001a4593;
}
if (param_1[0x10] != (bf_write)0x0) goto LAB_001a4593;
uVar6 = uVar6 + 1;
pbVar3 = (byte *)((iVar1 >> 3) + *(int *)param_1);
*pbVar3 = *pbVar3 & ~(byte)(1 << ((byte)iVar1 & 7));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
} while (uVar2 != uVar6);
}
LAB_001a4618:
if (*(int *)(this + 0x3c) == 0) {
iVar1 = *(int *)(param_1 + 0xc);
if (iVar1 < *(int *)(param_1 + 8)) {
if (param_1[0x10] == (bf_write)0x0) {
pbVar3 = (byte *)((iVar1 >> 3) + *(int *)param_1);
*pbVar3 = *pbVar3 & ~(byte)(1 << ((byte)iVar1 & 7));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
}
}
else {
param_1[0x10] = (bf_write)0x1;
}
}
else {
iVar1 = *(int *)(param_1 + 0xc);
if (iVar1 < *(int *)(param_1 + 8)) {
if (param_1[0x10] == (bf_write)0x0) {
pbVar3 = (byte *)((iVar1 >> 3) + *(int *)param_1);
*pbVar3 = *pbVar3 | (byte)(1 << ((byte)iVar1 & 7));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
}
}
else {
param_1[0x10] = (bf_write)0x1;
}
uVar6 = 0;
uVar2 = (**(code **)(**(int **)(this + 0x3c) + 8))(*(int **)(this + 0x3c));
bf_write::WriteWord(param_1,uVar2);
if (0 < (int)uVar2) {
do {
while( true ) {
pcVar4 = (char *)(**(code **)(**(int **)(this + 0x3c) + 0x10))
(*(int **)(this + 0x3c),uVar6);
bf_write::WriteString(param_1,pcVar4);
this_00 = (CNetworkStringTableItem *)
(**(code **)(**(int **)(this + 0x3c) + 0x28))(*(int **)(this + 0x3c),uVar6);
pvVar5 = (void *)CNetworkStringTableItem::GetUserData(this_00,local_20);
iVar1 = *(int *)(param_1 + 0xc);
if (local_20[0] < 1) break;
if (iVar1 < *(int *)(param_1 + 8)) {
if (param_1[0x10] == (bf_write)0x0) {
pbVar3 = (byte *)((iVar1 >> 3) + *(int *)param_1);
*pbVar3 = *pbVar3 | (byte)(1 << ((byte)iVar1 & 7));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
}
}
else {
param_1[0x10] = (bf_write)0x1;
}
bf_write::WriteWord(param_1,(int)(short)local_20[0]);
bf_write::WriteBytes(param_1,pvVar5,local_20[0]);
LAB_001a46d3:
uVar6 = uVar6 + 1;
if (uVar2 == uVar6) {
return;
}
}
if (*(int *)(param_1 + 8) <= iVar1) {
param_1[0x10] = (bf_write)0x1;
goto LAB_001a46d3;
}
if (param_1[0x10] != (bf_write)0x0) goto LAB_001a46d3;
uVar6 = uVar6 + 1;
pbVar3 = (byte *)((iVar1 >> 3) + *(int *)param_1);
*pbVar3 = *pbVar3 & ~(byte)(1 << ((byte)iVar1 & 7));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
} while (uVar2 != uVar6);
}
}
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.