Array_Encode
0x001490d0 · 368 bytes · __cdecl
_Z12Array_EncodePKhP8DVariantPK8SendPropP8bf_writei
Decompiled
undefined (5 params)
/* Array_Encode(unsigned char const*, DVariant*, SendProp const*, bf_write*, int) */
void Array_Encode(uchar *param_1,DVariant *param_2,SendProp *param_3,bf_write *param_4,int param_5)
{
int iVar1;
uint uVar2;
int iVar3;
int iVar4;
uint *puVar5;
int iVar6;
uchar *puVar7;
uint local_38;
undefined1 local_2c [12];
undefined4 local_20;
iVar1 = *(int *)(param_3 + 0x18);
if (*(code **)(param_3 + 0x1c) == (code *)0x0) {
local_38 = *(uint *)(param_3 + 0x20);
}
else {
uVar2 = (**(code **)(param_3 + 0x1c))(param_1,param_5);
local_38 = *(uint *)(param_3 + 0x20);
if ((int)uVar2 <= (int)*(uint *)(param_3 + 0x20)) {
local_38 = uVar2;
}
}
iVar3 = SendProp::GetNumArrayLengthBits(param_3);
uVar2 = *(uint *)(param_4 + 0xc);
if (*(int *)(param_4 + 8) < (int)(iVar3 + uVar2)) {
*(int *)(param_4 + 0xc) = *(int *)(param_4 + 8);
param_4[0x10] = (bf_write)0x1;
}
else {
iVar4 = ((int)uVar2 >> 5) * 4;
uVar2 = uVar2 & 0x1f;
puVar5 = (uint *)(iVar4 + *(int *)param_4);
*puVar5 = local_38 << (sbyte)uVar2 | (&g_BitWriteMasks)[uVar2 * 0x21 + iVar3] & *puVar5;
iVar6 = 0x20 - uVar2;
if (iVar6 < iVar3) {
puVar5 = (uint *)(*(int *)param_4 + 4 + iVar4);
*puVar5 = (&g_BitWriteMasks)[iVar3 - iVar6] & *puVar5 | local_38 >> ((byte)iVar6 & 0x1f);
}
*(int *)(param_4 + 0xc) = *(int *)(param_4 + 0xc) + iVar3;
}
uVar2 = 0;
puVar7 = param_1 + *(int *)(iVar1 + 0x4c);
if (0 < (int)local_38) {
do {
local_20 = 1;
(**(code **)(iVar1 + 0x40))(iVar1,param_1,puVar7,local_2c,uVar2,param_5);
(**(code **)(g_PropTypeFns + *(int *)(iVar1 + 8) * 0x24))
(param_1,local_2c,iVar1,param_4,param_5);
puVar7 = puVar7 + *(int *)(param_3 + 0x24);
uVar2 = uVar2 + 1;
} while (uVar2 != local_38);
}
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.