L L4D2node

CChoreoChannel::RestoreFromBuffer

0x00b9dfe0 · 835 bytes · __thiscall

_ZN14CChoreoChannel17RestoreFromBufferER10CUtlBufferP12CChoreoSceneP12CChoreoActorP17IChoreoStringPool

Decompiled

undefined (5 params)

/* CChoreoChannel::RestoreFromBuffer(CUtlBuffer&, CChoreoScene*, CChoreoActor*, IChoreoStringPool*)
    */

undefined4 __thiscall
CChoreoChannel::RestoreFromBuffer
          (CChoreoChannel *this,CUtlBuffer *param_1,CChoreoScene *param_2,CChoreoActor *param_3,
          IChoreoStringPool *param_4)

{
  byte bVar1;
  ushort uVar2;
  code *pcVar3;
  undefined2 uVar4;
  char cVar5;
  CChoreoEvent *this_00;
  undefined4 uVar6;
  int iVar7;
  ushort *puVar8;
  int iVar9;
  int in_GS_OFFSET;
  CChoreoChannel CVar10;
  ushort local_126;
  undefined4 local_124;
  char local_120 [256];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  pcVar3 = *(code **)(*(int *)param_4 + 4);
  if (((byte)param_1[0x15] & 1) == 0) {
    cVar5 = CUtlBuffer::CheckGet(param_1,2);
    iVar9 = 0;
    if (cVar5 != '\0') {
      if (((byte)param_1[0x34] & 1) == 0) {
        iVar7 = *(int *)(param_1 + 0xc);
        uVar2 = *(ushort *)(*(int *)param_1 + (iVar7 - *(int *)(param_1 + 0x20)));
      }
      else {
        puVar8 = (ushort *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
        if (puVar8 == (ushort *)0x0) {
          puVar8 = &local_126;
        }
        uVar4 = local_124._2_2_;
        local_124 = (CChoreoEvent *)CONCAT22(local_124._2_2_,local_126);
        local_124 = (CChoreoEvent *)CONCAT31(local_124._1_3_,*(undefined1 *)((int)puVar8 + 1));
        local_124 = (CChoreoEvent *)
                    CONCAT22(uVar4,CONCAT11((char)*puVar8,*(undefined1 *)((int)puVar8 + 1)));
        _V_memcpy(&local_126,&local_124,2);
        iVar7 = *(int *)(param_1 + 0xc);
        uVar2 = local_126;
      }
      iVar9 = (int)(short)uVar2;
      *(int *)(param_1 + 0xc) = iVar7 + 2;
    }
  }
  else {
    local_126 = 0;
    CUtlBuffer::Scanf(param_1,"%d",&local_126);
    iVar9 = (int)(short)local_126;
  }
  (*pcVar3)(param_4,iVar9,local_120,0x100);
  V_strncpy((char *)(this + 4),local_120,0x80);
  if (((byte)param_1[0x15] & 1) == 0) {
    cVar5 = CUtlBuffer::CheckGet(param_1,1);
    if (cVar5 == '\0') goto LAB_00b9e1c8;
    bVar1 = *(byte *)(*(int *)param_1 + (*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)));
    *(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
  }
  else {
    local_124 = (CChoreoEvent *)((uint)local_124 & 0xffffff00);
    CUtlBuffer::Scanf(param_1,"%u",&local_124);
    bVar1 = (byte)local_124;
  }
  if (bVar1 != 0) {
    iVar9 = 1;
    do {
      this_00 = (CChoreoEvent *)CChoreoScene::AllocEvent(param_2);
      uVar6 = CChoreoEvent::RestoreFromBuffer(this_00,param_1,param_2,param_4);
      if ((char)uVar6 == '\0') goto LAB_00b9e18f;
      iVar9 = iVar9 + 1;
      local_124 = this_00;
      CUtlVector<CChoreoEvent*,CUtlMemory<CChoreoEvent*,int>>::InsertBefore
                ((CUtlVector<CChoreoEvent*,CUtlMemory<CChoreoEvent*,int>> *)(this + 0x84),
                 *(int *)(this + 0x90),(CChoreoEvent **)&local_124);
      CChoreoEvent::SetChannel(this_00,this);
      CChoreoEvent::SetActor(this_00,param_3);
    } while (iVar9 != bVar1 + 1);
  }
LAB_00b9e1c8:
  if (((byte)param_1[0x15] & 1) == 0) {
    cVar5 = CUtlBuffer::CheckGet(param_1,1);
    CVar10 = (CChoreoChannel)0x0;
    if (cVar5 != '\0') {
      cVar5 = *(char *)(*(int *)param_1 + (*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)));
      *(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
      CVar10 = (CChoreoChannel)(cVar5 == '\x01');
    }
  }
  else {
    local_126 = local_126 & 0xff00;
    CUtlBuffer::Scanf(param_1,"%c",&local_126);
    CVar10 = (CChoreoChannel)((char)local_126 == '\x01');
  }
  this[0x98] = CVar10;
  uVar6 = 1;
LAB_00b9e18f:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar6;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)