CChoreoScene::SaveToBinaryBuffer
0x00bb3ec0 · 1364 bytes · __thiscall
_ZN12CChoreoScene18SaveToBinaryBufferER10CUtlBufferjP17IChoreoStringPool
Decompiled
undefined (4 params)
/* CChoreoScene::SaveToBinaryBuffer(CUtlBuffer&, unsigned int, IChoreoStringPool*) */
void __thiscall
CChoreoScene::SaveToBinaryBuffer
(CChoreoScene *this,CUtlBuffer *param_1,uint param_2,IChoreoStringPool *param_3)
{
char cVar1;
int iVar2;
void *pvVar3;
byte bVar4;
uint uVar5;
uint uVar6;
CUtlMemory<CChoreoEvent*,int> *local_54;
CChoreoActor *local_4c;
undefined4 local_48;
int local_44 [5];
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
uint local_24;
CChoreoEvent *local_20;
if (((byte)param_1[0x15] & 1) == 0) {
cVar1 = CUtlBuffer::CheckPut(param_1,4);
if (cVar1 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(undefined4 *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
0x64637662;
iVar2 = *(int *)(param_1 + 0x10);
}
else {
iVar2 = *(int *)(param_1 + 0x10);
pvVar3 = (void *)((iVar2 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar3 != (void *)0x0) {
local_30 = (CChoreoEvent *)0x62766364;
_V_memcpy(pvVar3,&local_30,4);
iVar2 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar2 + 4;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%d",0x64637662);
}
if (((((byte)param_1[0x15] & 1) != 0) && (*(int *)(param_1 + 0x10) != 0)) &&
(*(char *)(*(int *)param_1 + ((*(int *)(param_1 + 0x10) + -1) - *(int *)(param_1 + 0x20))) ==
'\n')) {
if (((byte)param_1[0x15] & 0x10) == 0) {
iVar2 = *(int *)(param_1 + 0x18);
}
else {
iVar2 = 0;
}
while (iVar2 = iVar2 + -1, -1 < iVar2) {
while (cVar1 = CUtlBuffer::CheckPut(param_1,1), cVar1 != '\0') {
*(undefined1 *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) = 9
;
*(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
CUtlBuffer::AddNullTermination(param_1);
iVar2 = iVar2 + -1;
if (iVar2 < 0) goto LAB_00bb3f10;
}
}
}
LAB_00bb3f10:
cVar1 = CUtlBuffer::CheckPut(param_1,1);
if (cVar1 != '\0') {
*(undefined1 *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) = 4;
*(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
CUtlBuffer::AddNullTermination(param_1);
}
if (((byte)param_1[0x15] & 1) == 0) {
local_48 = param_2;
cVar1 = CUtlBuffer::CheckPut(param_1,4);
if (cVar1 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(uint *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) = param_2
;
iVar2 = *(int *)(param_1 + 0x10);
}
else {
iVar2 = *(int *)(param_1 + 0x10);
pvVar3 = (void *)((iVar2 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar3 != (void *)0x0) {
local_30 = (CChoreoEvent *)
CONCAT13((undefined1)local_48,
CONCAT12(local_48._1_1_,CONCAT11(local_48._2_1_,local_48._3_1_)));
_V_memcpy(pvVar3,&local_30,4);
iVar2 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar2 + 4;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%d",param_2);
}
uVar5 = 0;
local_44[0] = 0;
local_44[1] = 0;
local_44[2] = 0;
local_44[3] = 0;
local_44[4] = 0;
if (0 < *(int *)(this + 0x10)) {
do {
while( true ) {
local_30 = *(CChoreoEvent **)(*(int *)(this + 4) + uVar5 * 4);
/* try { // try from 00bb3fbc to 00bb403f has its CatchHandler @ 00bb4481 */
iVar2 = CChoreoEvent::GetActor(local_30);
if (iVar2 != 0) break;
CUtlVector<CChoreoEvent*,CUtlMemory<CChoreoEvent*,int>>::InsertBefore
((CUtlVector<CChoreoEvent*,CUtlMemory<CChoreoEvent*,int>> *)local_44,local_44[3],
(CChoreoEvent **)&local_30);
uVar5 = uVar5 + 1;
if (*(int *)(this + 0x10) <= (int)uVar5) goto LAB_00bb3fe8;
}
uVar5 = uVar5 + 1;
} while ((int)uVar5 < *(int *)(this + 0x10));
LAB_00bb3fe8:
uVar5 = local_44[3] & 0xff;
}
iVar2 = local_44[3];
local_54 = (CUtlMemory<CChoreoEvent*,int> *)local_44;
if (((byte)param_1[0x15] & 1) == 0) {
/* try { // try from 00bb42fb to 00bb4329 has its CatchHandler @ 00bb4481 */
cVar1 = CUtlBuffer::CheckPut(param_1,1);
if (cVar1 != '\0') {
*(char *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
(char)uVar5;
*(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%u",uVar5);
}
if (0 < iVar2) {
uVar5 = 0;
do {
CChoreoEvent::SaveToBuffer(*(CChoreoEvent **)(local_44[0] + uVar5 * 4),param_1,this,param_3);
uVar5 = uVar5 + 1;
} while (uVar5 != iVar2);
}
uVar5 = 0;
uVar6 = 0;
local_30 = (CChoreoEvent *)0x0;
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_20 = (CChoreoEvent *)0x0;
if (0 < *(int *)(this + 0x24)) {
iVar2 = 0;
do {
local_4c = *(CChoreoActor **)(*(int *)(this + 0x18) + iVar2 * 4);
if (local_4c != (CChoreoActor *)0x0) {
/* try { // try from 00bb409e to 00bb4155 has its CatchHandler @ 00bb4437 */
CUtlVector<CChoreoActor*,CUtlMemory<CChoreoActor*,int>>::InsertBefore
((CUtlVector<CChoreoActor*,CUtlMemory<CChoreoActor*,int>> *)&local_30,uVar5,
&local_4c);
uVar5 = local_24;
}
iVar2 = iVar2 + 1;
} while (iVar2 < *(int *)(this + 0x24));
uVar6 = uVar5 & 0xff;
}
if (((byte)param_1[0x15] & 1) == 0) {
cVar1 = CUtlBuffer::CheckPut(param_1,1);
if (cVar1 != '\0') {
*(char *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
(char)uVar6;
*(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%u",uVar6);
}
if (0 < (int)uVar5) {
uVar6 = 0;
do {
CChoreoActor::SaveToBuffer(*(CChoreoActor **)(local_30 + uVar6 * 4),param_1,this,param_3);
uVar6 = uVar6 + 1;
} while (uVar6 != uVar5);
}
CCurveData::SaveToBuffer((CUtlBuffer *)(this + 300),(IChoreoStringPool *)param_1);
bVar4 = (byte)this[0x20c] >> 1 & 1;
if (((byte)param_1[0x15] & 1) == 0) {
/* try { // try from 00bb4273 to 00bb42e1 has its CatchHandler @ 00bb4437 */
cVar1 = CUtlBuffer::CheckPut(param_1,1);
if (cVar1 != '\0') {
*(byte *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) = bVar4;
*(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
CUtlBuffer::Printf(param_1,"%u",(uint)bVar4);
}
local_24 = 0;
CUtlMemory<CChoreoActor*,int>::Purge((CUtlMemory<CChoreoActor*,int> *)&local_30);
local_20 = local_30;
CUtlMemory<CChoreoActor*,int>::Purge((CUtlMemory<CChoreoActor*,int> *)&local_30);
local_44[3] = 0;
CUtlMemory<CChoreoEvent*,int>::Purge(local_54);
local_44[4] = local_44[0];
CUtlMemory<CChoreoEvent*,int>::Purge(local_54);
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.