L L4D2node

Unserialize

0x00bf2070 · 205 bytes · __cdecl

_Z11UnserializeR10CUtlBufferRi

Decompiled

undefined (2 params)

/* Unserialize(CUtlBuffer&, int&) */

bool Unserialize(CUtlBuffer *param_1,int *param_2)

{
  char cVar1;
  int iVar2;
  int *piVar3;
  int local_14;
  undefined4 local_10;
  
  if (((byte)param_1[0x15] & 1) == 0) {
    cVar1 = CUtlBuffer::CheckGet(param_1,4);
    iVar2 = 0;
    if (cVar1 != '\0') {
      if (((byte)param_1[0x34] & 1) == 0) {
        iVar2 = *(int *)(param_1 + 0xc);
        local_14 = *(int *)(*(int *)param_1 + (iVar2 - *(int *)(param_1 + 0x20)));
      }
      else {
        piVar3 = (int *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
        if (piVar3 == (int *)0x0) {
          piVar3 = &local_14;
        }
        local_10 = local_14;
        local_10 = CONCAT31((int3)((uint)local_14 >> 8),*(undefined1 *)((int)piVar3 + 3));
        local_10._2_2_ = (undefined2)((uint)local_14 >> 0x10);
        local_10._0_2_ = CONCAT11(*(undefined1 *)((int)piVar3 + 2),*(undefined1 *)((int)piVar3 + 3))
        ;
        local_10._3_1_ = (undefined1)((uint)local_14 >> 0x18);
        local_10._0_3_ = CONCAT12(*(undefined1 *)((int)piVar3 + 1),(undefined2)local_10);
        local_10 = CONCAT13((char)*piVar3,(undefined3)local_10);
        _V_memcpy(&local_14,&local_10,4);
        iVar2 = *(int *)(param_1 + 0xc);
      }
      *(int *)(param_1 + 0xc) = iVar2 + 4;
      iVar2 = local_14;
    }
    *param_2 = iVar2;
  }
  else {
    iVar2 = CUtlBuffer::Scanf(param_1,"%d",param_2);
    if (iVar2 != 1) {
      return false;
    }
  }
  return param_1[0x14] == (CUtlBuffer)0x0;
}

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)