L L4D2node

CDmxSerializerKeyValues2::UnserializeId

0x00becd90 · 332 bytes · __thiscall

_ZN24CDmxSerializerKeyValues213UnserializeIdER10CUtlBufferi

Decompiled

undefined (3 params)

/* CDmxSerializerKeyValues2::UnserializeId(CUtlBuffer&, int) */

undefined4 __thiscall
CDmxSerializerKeyValues2::UnserializeId
          (CDmxSerializerKeyValues2 *this,CUtlBuffer *param_1,int param_2)

{
  CUtlCharConversion *pCVar1;
  int iVar2;
  int iVar3;
  undefined4 *puVar4;
  undefined4 *puVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  int in_GS_OFFSET;
  undefined4 uStack_90;
  CUtlCharConversion *local_70 [2];
  CUtlBuffer local_68 [56];
  undefined1 local_30 [16];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  uStack_90 = 0xbecdcd;
  CUtlBuffer::CUtlBuffer(local_68,0,0,0);
                    /* try { // try from 00becdd8 to 00beced3 has its CatchHandler @ 00beceee */
  uStack_90 = 0xbecddd;
  iVar2 = ReadToken(this,param_1,local_68);
  if (iVar2 == 5) {
    uStack_90 = 0xbece25;
    local_70[0] = (CUtlCharConversion *)GetCStringCharConversion();
    uStack_90 = 0xbece3c;
    iVar3 = CUtlBuffer::PeekDelimitedStringLength(local_68,local_70[0],true);
    iVar2 = -((iVar3 + 0xfU & 0xfffffff0) + 0x10);
    puVar5 = (undefined4 *)((int)local_70 + iVar2 + -0x1c);
    *(int *)(local_68 + iVar2 + -0x18) = iVar3;
    pCVar1 = local_70[0];
    *(CUtlBuffer **)((int)local_70 + iVar2 + -0x1c) = local_68;
    *(int *)(local_68 + iVar2 + -0x1c) = (int)local_70 + iVar2;
    *(CUtlCharConversion **)(local_68 + iVar2 + -0x20) = pCVar1;
    *(undefined4 *)((int)&uStack_90 + iVar2) = 0xbece65;
    CUtlBuffer::GetDelimitedString
              (*(CUtlBuffer **)((int)local_70 + iVar2 + -0x1c),
               *(CUtlCharConversion **)(local_68 + iVar2 + -0x20),
               *(char **)(local_68 + iVar2 + -0x1c),*(int *)(local_68 + iVar2 + -0x18));
    *(undefined4 *)(local_68 + iVar2 + -0x1c) = 0;
    *(int *)(local_68 + iVar2 + -0x20) = (int)local_70 + iVar2;
    *(undefined1 **)((int)local_70 + iVar2 + -0x1c) = local_30;
    *(undefined4 *)((int)&uStack_90 + iVar2) = 0xbece7c;
    uVar6 = UniqueIdFromString(*(UniqueId_t **)((int)local_70 + iVar2 + -0x1c),
                               *(char **)(local_68 + iVar2 + -0x20),
                               *(int *)(local_68 + iVar2 + -0x1c));
    if ((char)uVar6 != '\0') {
      if (param_2 == -1) {
        uVar7 = 0;
        puVar4 = (undefined4 *)(*(int *)this + -0x14);
      }
      else {
        puVar4 = (undefined4 *)(*(int *)this + param_2 * 0x14);
        uVar7 = *puVar4;
      }
      *(undefined4 **)(local_68 + iVar2 + -0x20) = puVar4 + 1;
      *(undefined1 **)((int)local_70 + iVar2 + -0x1c) = local_30;
      *(undefined4 *)((int)&uStack_90 + iVar2) = 0xbecea7;
      CopyUniqueId(*(UniqueId_t **)((int)local_70 + iVar2 + -0x1c),
                   *(UniqueId_t **)(local_68 + iVar2 + -0x20));
      *(undefined4 *)((int)local_70 + iVar2 + -0x1c) = uVar7;
      *(undefined1 **)(local_68 + iVar2 + -0x20) = local_30;
      *(undefined4 *)((int)&uStack_90 + iVar2) = 0xbeceb6;
      CDmxElement::SetId(*(CDmxElement **)((int)local_70 + iVar2 + -0x1c),
                         *(UniqueId_t **)(local_68 + iVar2 + -0x20));
      goto LAB_00becdf8;
    }
    *(char **)(local_68 + iVar2 + -0x20) = "Encountered invalid element ID data!";
    *(undefined2 **)((int)local_70 + iVar2 + -0x1c) = &g_KeyValues2ErrorStack;
    *(undefined4 *)((int)&uStack_90 + iVar2) = 0xbeced4;
    CDmxKeyValues2ErrorStack::ReportError
              (*(CDmxKeyValues2ErrorStack **)((int)local_70 + iVar2 + -0x1c),
               *(char **)(local_68 + iVar2 + -0x20));
    puVar5 = (undefined4 *)((int)local_70 + iVar2 + -0x1c);
  }
  else {
    uStack_90 = 0xbecdf6;
    CDmxKeyValues2ErrorStack::ReportError
              ((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
               "Expecting quoted value for element ID, didn\'t find one!");
    puVar5 = (undefined4 *)&stack0xffffff74;
  }
  uVar6 = 0;
LAB_00becdf8:
  *puVar5 = local_68;
  puVar5[-1] = 0xbece00;
  CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)*puVar5);
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar6;
  }
                    /* WARNING: Subroutine does not return */
  puVar5[-1] = &LAB_00beceee;
  __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)