CChoreoEvent::SaveFlexAnimationsToBuffer
0x00ba7230 · 2358 bytes · __thiscall
_ZN12CChoreoEvent26SaveFlexAnimationsToBufferER10CUtlBufferP17IChoreoStringPool
Decompiled
undefined (3 params)
/* CChoreoEvent::SaveFlexAnimationsToBuffer(CUtlBuffer&, IChoreoStringPool*) */
void __thiscall
CChoreoEvent::SaveFlexAnimationsToBuffer
(CChoreoEvent *this,CUtlBuffer *param_1,IChoreoStringPool *param_2)
{
float fVar1;
uint uVar2;
undefined4 uVar3;
char cVar4;
short sVar5;
undefined1 *puVar6;
int iVar7;
void *pvVar8;
uint uVar9;
int iVar10;
uint uVar11;
float *pfVar12;
uint uVar13;
uint uVar14;
uint local_4c;
int local_44;
int local_40;
undefined1 local_3a;
undefined1 uStack_39;
undefined1 local_38;
undefined1 uStack_37;
undefined1 local_36;
undefined1 uStack_35;
undefined1 local_34;
undefined1 uStack_33;
undefined1 local_32;
undefined1 uStack_31;
undefined1 local_30;
undefined1 uStack_2f;
undefined1 uStack_2e;
undefined1 uStack_2d;
undefined1 local_2c;
undefined1 uStack_2b;
undefined1 uStack_2a;
undefined1 uStack_29;
undefined1 local_28;
undefined1 uStack_27;
undefined1 uStack_26;
undefined1 uStack_25;
undefined1 local_24;
undefined1 uStack_23;
undefined1 uStack_22;
undefined1 uStack_21;
undefined1 local_20;
undefined1 local_1f;
undefined1 local_1e;
undefined1 local_1d;
uVar2 = *(uint *)(this + 0x118);
if (((byte)param_1[0x15] & 1) == 0) {
cVar4 = CUtlBuffer::CheckPut(param_1,1);
if (cVar4 != '\0') {
*(char *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
(char)uVar2;
*(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%u",uVar2 & 0xff);
}
local_4c = 0;
if (0 < (int)uVar2) {
do {
if ((int)local_4c < *(int *)(this + 0x118)) {
local_40 = *(int *)(*(int *)(this + 0x10c) + local_4c * 4);
}
else {
local_40 = 0;
}
puVar6 = &DAT_00d539c2;
if (*(undefined1 **)(local_40 + 4) != (undefined1 *)0x0) {
puVar6 = *(undefined1 **)(local_40 + 4);
}
sVar5 = (*(code *)**(undefined4 **)param_2)(param_2,puVar6);
if (((byte)param_1[0x15] & 1) == 0) {
cVar4 = CUtlBuffer::CheckPut(param_1,2);
if (cVar4 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(short *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
sVar5;
iVar10 = *(int *)(param_1 + 0x10);
}
else {
iVar10 = *(int *)(param_1 + 0x10);
pvVar8 = (void *)((iVar10 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar8 != (void *)0x0) {
uStack_39 = (undefined1)((ushort)sVar5 >> 8);
local_20 = uStack_39;
local_3a = (undefined1)sVar5;
local_1f = local_3a;
_V_memcpy(pvVar8,&local_20,2);
iVar10 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar10 + 2;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%d",(int)sVar5);
}
uVar9 = (uint)(*(byte *)(local_40 + 0x5c) >> 1) * 2 & 2 | *(byte *)(local_40 + 0x5c) & 1;
if (((byte)param_1[0x15] & 1) == 0) {
cVar4 = CUtlBuffer::CheckPut(param_1,1);
if (cVar4 != '\0') {
*(char *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
(char)uVar9;
*(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%u",uVar9);
}
fVar1 = *(float *)(local_40 + 8);
if (((byte)param_1[0x15] & 1) == 0) {
cVar4 = CUtlBuffer::CheckPut(param_1,4);
if (cVar4 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(float *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
fVar1;
iVar10 = *(int *)(param_1 + 0x10);
}
else {
iVar10 = *(int *)(param_1 + 0x10);
pvVar8 = (void *)((iVar10 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar8 != (void *)0x0) {
uStack_2d = (undefined1)((uint)fVar1 >> 0x18);
local_20 = uStack_2d;
uStack_2e = (undefined1)((uint)fVar1 >> 0x10);
local_1f = uStack_2e;
uStack_2f = (undefined1)((uint)fVar1 >> 8);
local_1e = uStack_2f;
local_30 = SUB41(fVar1,0);
local_1d = local_30;
_V_memcpy(pvVar8,&local_20,4);
iVar10 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar10 + 4;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%f",(double)fVar1);
}
fVar1 = *(float *)(local_40 + 0xc);
if (((byte)param_1[0x15] & 1) == 0) {
cVar4 = CUtlBuffer::CheckPut(param_1,4);
if (cVar4 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(float *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
fVar1;
iVar10 = *(int *)(param_1 + 0x10);
}
else {
iVar10 = *(int *)(param_1 + 0x10);
pvVar8 = (void *)((iVar10 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar8 != (void *)0x0) {
uStack_29 = (undefined1)((uint)fVar1 >> 0x18);
local_20 = uStack_29;
uStack_2a = (undefined1)((uint)fVar1 >> 0x10);
local_1f = uStack_2a;
uStack_2b = (undefined1)((uint)fVar1 >> 8);
local_1e = uStack_2b;
local_2c = SUB41(fVar1,0);
local_1d = local_2c;
_V_memcpy(pvVar8,&local_20,4);
iVar10 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar10 + 4;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%f",(double)fVar1);
}
uVar3 = *(undefined4 *)(local_40 + 0x1c);
if (((byte)param_1[0x15] & 1) == 0) {
cVar4 = CUtlBuffer::CheckPut(param_1,2);
if (cVar4 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(short *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
(short)uVar3;
iVar10 = *(int *)(param_1 + 0x10);
}
else {
iVar10 = *(int *)(param_1 + 0x10);
pvVar8 = (void *)((iVar10 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar8 != (void *)0x0) {
uStack_37 = (undefined1)((uint)uVar3 >> 8);
local_20 = uStack_37;
local_38 = (undefined1)uVar3;
local_1f = local_38;
_V_memcpy(pvVar8,&local_20,2);
iVar10 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar10 + 2;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%d",(int)(short)uVar3);
}
iVar10 = 0;
local_44 = 0;
if (0 < *(int *)(local_40 + 0x1c)) {
do {
pfVar12 = (float *)(iVar10 + *(int *)(local_40 + 0x10));
if (pfVar12 != (float *)0x0) {
fVar1 = pfVar12[1];
if (((byte)param_1[0x15] & 1) == 0) {
cVar4 = CUtlBuffer::CheckPut(param_1,4);
if (cVar4 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(float *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))
) = fVar1;
iVar7 = *(int *)(param_1 + 0x10);
}
else {
iVar7 = *(int *)(param_1 + 0x10);
pvVar8 = (void *)((iVar7 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar8 != (void *)0x0) {
uStack_25 = (undefined1)((uint)fVar1 >> 0x18);
local_20 = uStack_25;
uStack_26 = (undefined1)((uint)fVar1 >> 0x10);
local_1f = uStack_26;
uStack_27 = (undefined1)((uint)fVar1 >> 8);
local_1e = uStack_27;
local_28 = SUB41(fVar1,0);
local_1d = local_28;
_V_memcpy(pvVar8,&local_20,4);
iVar7 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar7 + 4;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%f",(double)fVar1);
}
fVar1 = *pfVar12;
if (((byte)param_1[0x15] & 1) == 0) {
cVar4 = CUtlBuffer::CheckPut(param_1,1);
if (cVar4 != '\0') {
*(char *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
(char)(int)(fVar1 * 255.0);
*(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%u",(int)(fVar1 * 255.0) & 0xff);
}
uVar9 = (uint)*(byte *)((int)pfVar12 + 9) << 7;
uVar11 = uVar9 | *(byte *)(pfVar12 + 2) >> 1;
if (((byte)param_1[0x15] & 1) == 0) {
cVar4 = CUtlBuffer::CheckPut(param_1,2);
if (cVar4 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(short *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))
) = (short)uVar11;
iVar7 = *(int *)(param_1 + 0x10);
}
else {
iVar7 = *(int *)(param_1 + 0x10);
pvVar8 = (void *)((iVar7 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar8 != (void *)0x0) {
uStack_35 = (undefined1)(uVar9 >> 8);
local_20 = uStack_35;
local_36 = (undefined1)uVar11;
local_1f = local_36;
_V_memcpy(pvVar8,&local_20,2);
iVar7 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar7 + 2;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%u",uVar11);
}
}
local_44 = local_44 + 1;
iVar10 = iVar10 + 10;
} while (local_44 < *(int *)(local_40 + 0x1c));
}
if ((*(byte *)(local_40 + 0x5c) & 2) != 0) {
uVar9 = *(uint *)(local_40 + 0x30);
if (((byte)param_1[0x15] & 1) == 0) {
cVar4 = CUtlBuffer::CheckPut(param_1,2);
if (cVar4 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(short *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
(short)uVar9;
iVar10 = *(int *)(param_1 + 0x10);
}
else {
iVar10 = *(int *)(param_1 + 0x10);
pvVar8 = (void *)((iVar10 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar8 != (void *)0x0) {
uStack_33 = (undefined1)(uVar9 >> 8);
local_20 = uStack_33;
local_34 = (undefined1)uVar9;
local_1f = local_34;
_V_memcpy(pvVar8,&local_20,2);
iVar10 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar10 + 2;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%u",uVar9 & 0xffff);
}
uVar11 = 0;
if (0 < (int)uVar9) {
do {
if (((int)uVar11 < *(int *)(local_40 + 0x30)) &&
(pfVar12 = (float *)(*(int *)(local_40 + 0x24) + uVar11 * 10),
pfVar12 != (float *)0x0)) {
fVar1 = pfVar12[1];
if (((byte)param_1[0x15] & 1) == 0) {
cVar4 = CUtlBuffer::CheckPut(param_1,4);
if (cVar4 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(float *)(*(int *)param_1 +
(*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) = fVar1;
iVar10 = *(int *)(param_1 + 0x10);
}
else {
iVar10 = *(int *)(param_1 + 0x10);
pvVar8 = (void *)((iVar10 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar8 != (void *)0x0) {
uStack_21 = (undefined1)((uint)fVar1 >> 0x18);
local_20 = uStack_21;
uStack_22 = (undefined1)((uint)fVar1 >> 0x10);
local_1f = uStack_22;
uStack_23 = (undefined1)((uint)fVar1 >> 8);
local_1e = uStack_23;
local_24 = SUB41(fVar1,0);
local_1d = local_24;
_V_memcpy(pvVar8,&local_20,4);
iVar10 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar10 + 4;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%f",(double)fVar1);
}
fVar1 = *pfVar12;
if (((byte)param_1[0x15] & 1) == 0) {
cVar4 = CUtlBuffer::CheckPut(param_1,1);
if (cVar4 != '\0') {
*(char *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20)))
= (char)(int)(fVar1 * 255.0);
*(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%u",(int)(fVar1 * 255.0) & 0xff);
}
uVar13 = (uint)*(byte *)((int)pfVar12 + 9) << 7;
uVar14 = uVar13 | *(byte *)(pfVar12 + 2) >> 1;
if (((byte)param_1[0x15] & 1) == 0) {
cVar4 = CUtlBuffer::CheckPut(param_1,2);
if (cVar4 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(short *)(*(int *)param_1 +
(*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) = (short)uVar14
;
iVar10 = *(int *)(param_1 + 0x10);
}
else {
iVar10 = *(int *)(param_1 + 0x10);
pvVar8 = (void *)((iVar10 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar8 != (void *)0x0) {
uStack_31 = (undefined1)(uVar13 >> 8);
local_20 = uStack_31;
local_32 = (undefined1)uVar14;
local_1f = local_32;
_V_memcpy(pvVar8,&local_20,2);
iVar10 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar10 + 2;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%u",uVar14);
}
}
uVar11 = uVar11 + 1;
} while (uVar11 != uVar9);
}
}
local_4c = local_4c + 1;
} while (local_4c != uVar2);
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.