SendTable_WritePropList
0x00155110 · 1766 bytes · __cdecl
_Z23SendTable_WritePropListPK9SendTablePKviP8bf_writeiPKii
Decompiled
undefined (7 params)
/* SendTable_WritePropList(SendTable const*, void const*, int, bf_write*, int, int const*, int) */
void SendTable_WritePropList
(SendTable *param_1,void *param_2,int param_3,bf_write *param_4,int param_5,
int *param_6,int param_7)
{
int iVar1;
int iVar2;
char cVar3;
char cVar4;
int iVar5;
undefined4 uVar6;
int iVar7;
char *pcVar8;
int iVar9;
int iVar10;
int in_GS_OFFSET;
int local_2c4;
CDeltaBitsWriter local_2b0 [12];
CDeltaBitsReader local_2a4 [16];
char *local_294;
uint local_290;
int local_28c;
uint local_288;
undefined4 local_284;
int local_280;
int local_27c;
undefined4 local_278;
int local_274;
char *local_270;
uint local_26c;
int local_268;
uint local_264;
undefined4 local_260;
int local_25c;
int local_258;
undefined4 local_254;
int local_250;
undefined4 local_24c;
char *local_248;
float local_244;
float local_240;
int local_23c;
int local_234;
undefined4 local_230;
undefined4 local_22c;
int local_228;
char **local_224;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
CDeltaBitsWriter::CDeltaBitsWriter(local_2b0,param_4);
if (param_7 == 0) {
CDeltaBitsWriter::~CDeltaBitsWriter(local_2b0);
}
else {
/* try { // try from 00155163 to 001551f3 has its CatchHandler @ 001557f8 */
cVar3 = Sendprop_UsingDebugWatch();
s_debug_info_shown = '\0';
local_290 = local_290 & 0xffffff00;
local_28c = -1;
local_288 = 0;
s_debug_bits_start = *(int *)(param_4 + 0xc);
local_294 = "SendTable_WritePropList->inputBuffer";
iVar2 = *(int *)(param_1 + 0xc);
CBitRead::StartReading((CBitRead *)&local_294,param_2,param_3 + 7 >> 3,0,param_3);
CDeltaBitsReader::CDeltaBitsReader(local_2a4,(bf_read *)&local_294);
/* try { // try from 001551fd to 001557eb has its CatchHandler @ 00155815 */
iVar5 = CDeltaBitsReader::ReadNextPropIndex(local_2a4);
if (iVar5 < 0) {
iVar5 = 0x7fffffff;
}
if (0 < param_7) {
iVar10 = 0;
do {
while (iVar5 < param_6[iVar10]) {
iVar5 = *(int *)(*(int *)(iVar2 + 0x2c) + iVar5 * 4);
(**(code **)(g_PropTypeFns + *(int *)(iVar5 + 8) * 0x24 + 0x20))(iVar5,&local_294);
iVar5 = CDeltaBitsReader::ReadNextPropIndex(local_2a4);
if (iVar5 < 0) {
iVar5 = 0x7fffffff;
}
}
if (iVar5 == 0x7fffffff) break;
if (iVar5 == param_6[iVar10]) {
iVar7 = *(int *)(*(int *)(iVar2 + 0x2c) + iVar5 * 4);
if ((cVar3 != '\0') &&
(cVar4 = ShouldWatchThisProp(param_1,param_5,*(char **)(iVar7 + 0x30)), cVar4 != '\0'))
{
if (host_framecount !=
ShowEncodeDeltaWatchInfo(SendTable_const*,SendProp_const*,bf_read&,int,int)::
lastframe) {
ShowEncodeDeltaWatchInfo(SendTable_const*,SendProp_const*,bf_read&,int,int)::lastframe
= host_framecount;
ConDMsg("delta entity: %i\n",param_5);
}
local_224 = &local_270;
local_230 = 0;
local_22c = 0;
local_270 = local_294;
local_234 = param_5;
s_debug_info_shown = '\x01';
local_26c = local_290;
local_24c = 0;
local_268 = local_28c;
local_264 = local_288;
local_260 = local_284;
local_25c = local_280;
local_258 = local_27c;
local_254 = local_278;
local_250 = local_274;
local_23c = *(int *)(iVar7 + 8);
if (local_274 == 0) {
local_2c4 = 0;
}
else {
local_2c4 = (((uint)(local_27c - local_274) >> 2) * 0x20 - local_280) +
(local_288 & 3) * 8;
if (local_28c < local_2c4) {
local_2c4 = local_28c;
}
}
local_228 = iVar7;
(**(code **)(g_PropTypeFns + local_23c * 0x24 + 4))(&local_24c);
if (local_250 == 0) {
iVar9 = 0;
}
else {
iVar1 = (((uint)(local_258 - local_250) >> 2) * 0x20 - local_25c) +
(local_264 & 3) * 8;
iVar9 = local_268;
if (iVar1 <= local_268) {
iVar9 = iVar1;
}
}
uVar6 = (**(code **)(g_PropTypeFns + *(int *)(iVar7 + 8) * 0x24 + 0x10))();
switch(local_23c) {
case 0:
V_snprintf(DVariant::ToString()::text,0x80,"%i",local_248);
break;
case 1:
V_snprintf(DVariant::ToString()::text,0x80,"%.3f",(double)(float)local_248);
break;
case 2:
V_snprintf(DVariant::ToString()::text,0x80,"(%.3f,%.3f,%.3f)",(double)(float)local_248
,(double)local_244,(double)local_240);
break;
case 3:
V_snprintf(DVariant::ToString()::text,0x80,"(%.3f,%.3f)",(double)(float)local_248,
(double)local_244);
break;
case 4:
pcVar8 = local_248;
if (local_248 == (char *)0x0) {
pcVar8 = "NULL";
}
goto LAB_0015565e;
case 5:
V_snprintf(DVariant::ToString()::text,0x80,"Array");
break;
case 6:
V_snprintf(DVariant::ToString()::text,0x80,"DataTable");
break;
default:
V_snprintf(DVariant::ToString()::text,0x80,"DVariant type %i unknown",local_23c);
}
pcVar8 = DVariant::ToString()::text;
LAB_0015565e:
ConDMsg("+ %s %s, %s, index %i, bits %i, value %s\n",*(undefined4 *)(param_1 + 8),
*(undefined4 *)(iVar7 + 0x30),uVar6,iVar5,iVar9 - local_2c4,pcVar8);
}
if (local_274 == 0) {
local_2c4 = 0;
}
else {
iVar9 = (((uint)(local_27c - local_274) >> 2) * 0x20 - local_280) + (local_288 & 3) * 8;
local_2c4 = local_28c;
if (iVar9 <= local_28c) {
local_2c4 = iVar9;
}
}
(**(code **)(g_PropTypeFns + *(int *)(iVar7 + 8) * 0x24 + 0x20))(iVar7,&local_294);
if (local_274 == 0) {
iVar7 = 0;
}
else {
iVar9 = (((uint)(local_27c - local_274) >> 2) * 0x20 - local_280) + (local_288 & 3) * 8;
iVar7 = local_28c;
if (iVar9 <= local_28c) {
iVar7 = iVar9;
}
}
CDeltaBitsWriter::WritePropIndex(local_2b0,iVar5);
CBitRead::Seek((CBitRead *)&local_294,local_2c4);
bf_write::WriteBitsFromBuffer(param_4,(bf_read *)&local_294,iVar7 - local_2c4);
iVar5 = CDeltaBitsReader::ReadNextPropIndex(local_2a4);
if (iVar5 < 0) {
iVar5 = 0x7fffffff;
}
}
iVar10 = iVar10 + 1;
} while (iVar10 != param_7);
}
if (s_debug_info_shown != '\0') {
ConDMsg("= %i bits (%i bytes)\n",*(int *)(param_4 + 0xc) - s_debug_bits_start,
(*(int *)(param_4 + 0xc) - s_debug_bits_start) + 7 >> 3);
}
CDeltaBitsReader::ForceFinished(local_2a4);
CDeltaBitsReader::~CDeltaBitsReader(local_2a4);
CDeltaBitsWriter::~CDeltaBitsWriter(local_2b0);
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.