L L4D2node

CStaticPropMgr::UnserializeModelDict

0x001e7b30 · 616 bytes · __thiscall

_ZN14CStaticPropMgr20UnserializeModelDictER10CUtlBuffer

Decompiled

undefined (2 params)

/* CStaticPropMgr::UnserializeModelDict(CUtlBuffer&) */

void __thiscall CStaticPropMgr::UnserializeModelDict(CStaticPropMgr *this,CUtlBuffer *param_1)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  int iVar4;
  undefined1 **ppuVar5;
  undefined1 *puVar6;
  int in_GS_OFFSET;
  undefined1 *puVar7;
  undefined1 *local_b8;
  undefined1 *local_a8;
  undefined4 local_a4;
  undefined1 local_a0 [128];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (((byte)param_1[0x15] & 1) == 0) {
    cVar1 = CUtlBuffer::CheckGet(param_1,4);
    if (cVar1 != '\0') {
      if (((byte)param_1[0x34] & 1) == 0) {
        iVar4 = *(int *)(param_1 + 0xc);
        local_b8 = *(undefined1 **)(*(int *)param_1 + (iVar4 - *(int *)(param_1 + 0x20)));
      }
      else {
        ppuVar5 = (undefined1 **)
                  ((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
        if (ppuVar5 == (undefined1 **)0x0) {
          ppuVar5 = &local_a8;
        }
        local_a4 = local_a8;
        local_a4 = (undefined1 *)
                   CONCAT31((int3)((uint)local_a8 >> 8),*(undefined1 *)((int)ppuVar5 + 3));
        local_a4._2_2_ = (undefined2)((uint)local_a8 >> 0x10);
        local_a4._0_2_ =
             CONCAT11(*(undefined1 *)((int)ppuVar5 + 2),*(undefined1 *)((int)ppuVar5 + 3));
        local_a4._3_1_ = (undefined1)((uint)local_a8 >> 0x18);
        local_a4._0_3_ = CONCAT12(*(undefined1 *)((int)ppuVar5 + 1),(undefined2)local_a4);
        local_a4 = (undefined1 *)CONCAT13(*(undefined1 *)ppuVar5,(undefined3)local_a4);
        _V_memcpy(&local_a8,&local_a4,4);
        iVar4 = *(int *)(param_1 + 0xc);
        local_b8 = local_a8;
      }
      *(int *)(param_1 + 0xc) = iVar4 + 4;
      goto LAB_001e7b94;
    }
  }
  else {
    local_a8 = (undefined1 *)0x0;
    CUtlBuffer::Scanf(param_1,"%d",&local_a8);
    local_b8 = local_a8;
LAB_001e7b94:
    iVar4 = *(int *)(this + 0x18);
    if (local_b8 != (undefined1 *)0x0) {
      CUtlVector<CStaticPropMgr::StaticPropDict_t,CUtlMemory<CStaticPropMgr::StaticPropDict_t,int>>
      ::GrowVector((CUtlVector<CStaticPropMgr::StaticPropDict_t,CUtlMemory<CStaticPropMgr::StaticPropDict_t,int>>
                    *)(this + 0xc),(int)local_b8);
      iVar2 = (*(int *)(this + 0x18) - iVar4) - (int)local_b8;
      if ((iVar2 < 1) || ((int)local_b8 < 1)) {
        puVar7 = local_b8;
        COM_TimestampedLog("Starting UnserializeModelDict for %d models\n",local_b8);
        if ((int)local_b8 < 1) goto LAB_001e7bb5;
      }
      else {
        _V_memmove((void *)(*(int *)(this + 0xc) + (int)(local_b8 + iVar4) * 4),
                   (void *)(*(int *)(this + 0xc) + iVar4 * 4),iVar2 * 4);
        COM_TimestampedLog("Starting UnserializeModelDict for %d models\n",local_b8);
      }
      puVar6 = (undefined1 *)0x0;
      do {
        CUtlBuffer::Get(param_1,local_a0,0x80);
        iVar2 = *(int *)(this + 0xc);
        iVar4 = (int)puVar6 * 4;
        puVar6 = puVar6 + 1;
        puVar7 = local_a0;
        uVar3 = (**(code **)(*(int *)modelloader + 0x1c))(modelloader,local_a0,0x10);
        *(undefined4 *)(iVar2 + iVar4) = uVar3;
      } while (puVar6 != local_b8);
      goto LAB_001e7bb5;
    }
  }
  puVar7 = (undefined1 *)0x0;
  COM_TimestampedLog("Starting UnserializeModelDict for %d models\n",0);
LAB_001e7bb5:
  COM_TimestampedLog("Finished UnserializeModelDict\n",puVar7);
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return;
}

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)