CChoreoScene::RestoreFromBinaryBuffer
0x00bb34c0 · 1078 bytes · __thiscall
_ZN12CChoreoScene23RestoreFromBinaryBufferER10CUtlBufferPKcP17IChoreoStringPool
Decompiled
undefined (4 params)
/* CChoreoScene::RestoreFromBinaryBuffer(CUtlBuffer&, char const*, IChoreoStringPool*) */
undefined4 __thiscall
CChoreoScene::RestoreFromBinaryBuffer
(CChoreoScene *this,CUtlBuffer *param_1,char *param_2,IChoreoStringPool *param_3)
{
byte bVar1;
char cVar2;
int iVar3;
CChoreoEvent *this_00;
CChoreoActor *this_01;
undefined4 uVar4;
int *piVar5;
int iVar6;
bool bVar7;
float fVar8;
CChoreoScene *this_02;
int local_24;
undefined4 local_20;
V_strncpy((char *)(this + 0x188),param_2,0x80);
if (((byte)param_1[0x15] & 1) == 0) {
uVar4 = CUtlBuffer::CheckGet(param_1,4);
if ((char)uVar4 == '\0') {
return uVar4;
}
if (((byte)param_1[0x34] & 1) == 0) {
iVar6 = *(int *)(param_1 + 0xc);
iVar3 = *(int *)(*(int *)param_1 + (iVar6 - *(int *)(param_1 + 0x20)));
}
else {
piVar5 = (int *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (piVar5 == (int *)0x0) {
piVar5 = &local_24;
}
local_20 = local_24;
local_20._1_3_ = (undefined3)((uint)local_24 >> 8);
local_20 = CONCAT31(local_20._1_3_,*(undefined1 *)((int)piVar5 + 3));
local_20._2_2_ = (undefined2)((uint)local_24 >> 0x10);
local_20._0_2_ = CONCAT11(*(undefined1 *)((int)piVar5 + 2),*(undefined1 *)((int)piVar5 + 3));
local_20._3_1_ = (undefined1)((uint)local_24 >> 0x18);
local_20._0_3_ = CONCAT12(*(undefined1 *)((int)piVar5 + 1),(undefined2)local_20);
local_20 = CONCAT13((char)*piVar5,(undefined3)local_20);
_V_memcpy(&local_24,&local_20,4);
iVar6 = *(int *)(param_1 + 0xc);
iVar3 = local_24;
}
*(int *)(param_1 + 0xc) = iVar6 + 4;
}
else {
local_24 = 0;
CUtlBuffer::Scanf(param_1,"%d",&local_24);
iVar3 = local_24;
}
if (iVar3 != 0x64637662) {
return 0;
}
if (((byte)param_1[0x15] & 1) == 0) {
uVar4 = CUtlBuffer::CheckGet(param_1,1);
if ((char)uVar4 == '\0') {
return uVar4;
}
cVar2 = *(char *)(*(int *)param_1 + (*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
}
else {
local_20 = local_20 & 0xffffff00;
CUtlBuffer::Scanf(param_1,"%c",&local_20);
cVar2 = (byte)local_20;
}
if (cVar2 != '\x04') {
return 0;
}
if (((byte)param_1[0x15] & 1) == 0) {
cVar2 = CUtlBuffer::CheckGet(param_1,4);
if (cVar2 != '\0') {
if (((byte)param_1[0x34] & 1) != 0) {
piVar5 = (int *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (piVar5 == (int *)0x0) {
piVar5 = &local_24;
}
local_20 = local_24;
local_20._1_3_ = (undefined3)((uint)local_24 >> 8);
local_20 = CONCAT31(local_20._1_3_,*(undefined1 *)((int)piVar5 + 3));
local_20._2_2_ = (undefined2)((uint)local_24 >> 0x10);
local_20._0_2_ = CONCAT11(*(undefined1 *)((int)piVar5 + 2),*(undefined1 *)((int)piVar5 + 3))
;
local_20._3_1_ = (undefined1)((uint)local_24 >> 0x18);
local_20._0_3_ = CONCAT12(*(undefined1 *)((int)piVar5 + 1),(undefined2)local_20);
local_20 = CONCAT13((char)*piVar5,(undefined3)local_20);
_V_memcpy(&local_24,&local_20,4);
}
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 4;
}
}
else {
local_24 = 0;
CUtlBuffer::Scanf(param_1,"%d",&local_24);
}
if (((byte)param_1[0x15] & 1) == 0) {
cVar2 = CUtlBuffer::CheckGet(param_1,1);
if (cVar2 != '\0') {
bVar1 = *(byte *)(*(int *)param_1 + (*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
goto LAB_00bb35e8;
}
}
else {
local_20 = local_20 & 0xffffff00;
CUtlBuffer::Scanf(param_1,"%u",&local_20);
bVar1 = (byte)local_20;
LAB_00bb35e8:
if (bVar1 != 0) {
iVar6 = 1;
do {
this_00 = (CChoreoEvent *)AllocEvent(this);
cVar2 = CChoreoEvent::RestoreFromBuffer(this_00,param_1,this,param_3);
if (cVar2 == '\0') {
return 0;
}
iVar6 = iVar6 + 1;
} while (iVar6 != bVar1 + 1);
}
}
if (((byte)param_1[0x15] & 1) == 0) {
cVar2 = CUtlBuffer::CheckGet(param_1,1);
if (cVar2 == '\0') goto LAB_00bb37ec;
bVar1 = *(byte *)(*(int *)param_1 + (*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
}
else {
local_20 = local_20 & 0xffffff00;
CUtlBuffer::Scanf(param_1,"%u",&local_20);
bVar1 = (byte)local_20;
}
if (bVar1 != 0) {
iVar6 = 1;
do {
this_01 = (CChoreoActor *)AllocActor(this);
cVar2 = CChoreoActor::RestoreFromBuffer(this_01,param_1,this,param_3);
if (cVar2 == '\0') {
return 0;
}
iVar6 = iVar6 + 1;
} while (iVar6 != bVar1 + 1);
}
LAB_00bb37ec:
uVar4 = CCurveData::RestoreFromBuffer((CUtlBuffer *)(this + 300),(IChoreoStringPool *)param_1);
if ((char)uVar4 == '\0') {
return 0;
}
if (((byte)param_1[0x15] & 1) == 0) {
cVar2 = CUtlBuffer::CheckGet(param_1,1);
bVar7 = false;
if (cVar2 != '\0') {
cVar2 = *(char *)(*(int *)param_1 + (*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
bVar7 = cVar2 != '\0';
}
}
else {
local_20 = local_20 & 0xffffff00;
CUtlBuffer::Scanf(param_1,"%u",&local_20);
bVar7 = (byte)local_20 != '\0';
}
this[0x20c] = (CChoreoScene)((byte)this[0x20c] & 0xfd | bVar7 * '\x02');
ReconcileCloseCaption(this);
this_02 = this;
InternalDetermineEventTypes(this);
if (s_bEditingDisabled != '\0') {
fVar8 = *(float *)(this + 0x214);
if (fVar8 == 0.0) {
FindStopTime(this_02);
}
*(float *)(this + 0x214) = fVar8;
return uVar4;
}
return uVar4;
}
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.