Vector_Decode
0x001487d0 · 281 bytes · __cdecl
_Z13Vector_DecodeP10DecodeInfo
Decompiled
undefined (1 param)
/* Vector_Decode(DecodeInfo*) */
void Vector_Decode(DecodeInfo *param_1)
{
bf_read *pbVar1;
SendProp *pSVar2;
bf_read *pbVar3;
uint uVar4;
undefined4 *puVar5;
undefined4 in_XMM0_Da;
float fVar6;
pSVar2 = *(SendProp **)(param_1 + 0x24);
pbVar3 = *(bf_read **)(param_1 + 0x28);
DecodeFloat(pSVar2,pbVar3);
*(undefined4 *)(param_1 + 4) = in_XMM0_Da;
DecodeFloat(pSVar2,pbVar3);
*(undefined4 *)(param_1 + 8) = in_XMM0_Da;
if (((byte)pSVar2[0x3c] & 0x20) == 0) {
DecodeFloat(pSVar2,pbVar3);
*(undefined4 *)(param_1 + 0xc) = in_XMM0_Da;
}
else {
uVar4 = *(uint *)(pbVar3 + 0x10);
pbVar1 = pbVar3 + 0x14;
*(int *)pbVar1 = *(int *)pbVar1 + -1;
if (*(int *)pbVar1 == 0) {
puVar5 = *(undefined4 **)(pbVar3 + 0x18);
*(undefined4 *)(pbVar3 + 0x14) = 0x20;
if (puVar5 == *(undefined4 **)(pbVar3 + 0x1c)) {
*(undefined4 *)(pbVar3 + 0x14) = 1;
*(undefined4 *)(pbVar3 + 0x10) = 0;
*(undefined4 **)(pbVar3 + 0x18) = puVar5 + 1;
}
else if (*(undefined4 **)(pbVar3 + 0x1c) < puVar5) {
pbVar3[4] = (bf_read)0x1;
*(undefined4 *)(pbVar3 + 0x10) = 0;
}
else {
*(undefined4 **)(pbVar3 + 0x18) = puVar5 + 1;
*(undefined4 *)(pbVar3 + 0x10) = *puVar5;
}
}
else {
*(uint *)(pbVar3 + 0x10) = uVar4 >> 1;
}
fVar6 = *(float *)(param_1 + 8) * *(float *)(param_1 + 8) +
*(float *)(param_1 + 4) * *(float *)(param_1 + 4);
if (fVar6 < 1.0) {
*(float *)(param_1 + 0xc) = SQRT(1.0 - fVar6);
}
else {
*(undefined4 *)(param_1 + 0xc) = 0;
}
if ((uVar4 & 1) != 0) {
*(uint *)(param_1 + 0xc) = *(uint *)(param_1 + 0xc) ^ 0x80000000;
}
}
if (*(int *)param_1 != 0) {
(**(code **)(*(int *)param_1 + 0x20))
(param_1,*(undefined4 *)(param_1 + 0x1c),*(undefined4 *)(param_1 + 0x20));
}
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.