L L4D2node

CPureServerWhitelist::EncodeCommandList

0x001d7330 · 585 bytes · __thiscall

_ZN20CPureServerWhitelist17EncodeCommandListER8CUtlDictIPNS_8CCommandEiER10CUtlBuffer

Decompiled

undefined (3 params)

/* CPureServerWhitelist::EncodeCommandList(CUtlDict<CPureServerWhitelist::CCommand*, int>&,
   CUtlBuffer&) */

void __thiscall
CPureServerWhitelist::EncodeCommandList
          (CPureServerWhitelist *this,CUtlDict *param_1,CUtlBuffer *param_2)

{
  undefined4 uVar1;
  byte *pbVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  ushort uVar6;
  uint uVar7;
  void *pvVar8;
  undefined1 local_26;
  undefined1 uStack_25;
  undefined1 local_24;
  undefined1 uStack_23;
  undefined1 uStack_22;
  undefined1 uStack_21;
  undefined1 local_20;
  undefined1 local_1f;
  undefined1 local_1e;
  undefined1 local_1d;
  
  uVar1 = *(undefined4 *)(param_1 + 0x14);
  if (((byte)param_2[0x15] & 1) == 0) {
    cVar3 = CUtlBuffer::CheckPut(param_2,4);
    if (cVar3 != '\0') {
      if (((byte)param_2[0x34] & 1) == 0) {
        *(undefined4 *)(*(int *)param_2 + (*(int *)(param_2 + 0x10) - *(int *)(param_2 + 0x20))) =
             uVar1;
        iVar4 = *(int *)(param_2 + 0x10);
      }
      else {
        iVar4 = *(int *)(param_2 + 0x10);
        pvVar8 = (void *)((iVar4 - *(int *)(param_2 + 0x20)) + *(int *)param_2);
        if (pvVar8 != (void *)0x0) {
          uStack_21 = (undefined1)((uint)uVar1 >> 0x18);
          local_20 = uStack_21;
          uStack_22 = (undefined1)((uint)uVar1 >> 0x10);
          local_1f = uStack_22;
          uStack_23 = (undefined1)((uint)uVar1 >> 8);
          local_1e = uStack_23;
          local_24 = (undefined1)uVar1;
          local_1d = local_24;
          _V_memcpy(pvVar8,&local_20,4);
          iVar4 = *(int *)(param_2 + 0x10);
        }
      }
      *(int *)(param_2 + 0x10) = iVar4 + 4;
      CUtlBuffer::AddNullTermination(param_2);
    }
  }
  else {
    CUtlBuffer::Printf(param_2,"%d",uVar1);
  }
  iVar4 = CUtlRBTree<CUtlMap<char_const*,CPureServerWhitelist::CCommand*,int>::Node_t,int,CUtlMap<char_const*,CPureServerWhitelist::CCommand*,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CPureServerWhitelist::CCommand*,int>::Node_t,int>,int>>
          ::FirstInorder((CUtlRBTree<CUtlMap<char_const*,CPureServerWhitelist::CCommand*,int>::Node_t,int,CUtlMap<char_const*,CPureServerWhitelist::CCommand*,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CPureServerWhitelist::CCommand*,int>::Node_t,int>,int>>
                          *)param_1);
  do {
    if (iVar4 == -1) {
      return;
    }
    pbVar2 = *(byte **)(*(int *)(param_1 + 4) + 0x14 + iVar4 * 0x18);
    uVar7 = (uint)*pbVar2;
    if (pbVar2[1] != 0) {
      uVar7 = *pbVar2 | 2;
    }
    if (((byte)param_2[0x15] & 1) == 0) {
      cVar3 = CUtlBuffer::CheckPut(param_2,1);
      if (cVar3 == '\0') goto LAB_001d739d;
      *(char *)(*(int *)param_2 + (*(int *)(param_2 + 0x10) - *(int *)(param_2 + 0x20))) =
           (char)uVar7;
      *(int *)(param_2 + 0x10) = *(int *)(param_2 + 0x10) + 1;
      CUtlBuffer::AddNullTermination(param_2);
      uVar6 = *(ushort *)(pbVar2 + 2);
      if (((byte)param_2[0x15] & 1) != 0) goto LAB_001d73ab;
LAB_001d7470:
      cVar3 = CUtlBuffer::CheckPut(param_2,2);
      if (cVar3 != '\0') {
        if (((byte)param_2[0x34] & 1) == 0) {
          *(ushort *)(*(int *)param_2 + (*(int *)(param_2 + 0x10) - *(int *)(param_2 + 0x20))) =
               uVar6;
          iVar5 = *(int *)(param_2 + 0x10);
        }
        else {
          iVar5 = *(int *)(param_2 + 0x10);
          pvVar8 = (void *)((iVar5 - *(int *)(param_2 + 0x20)) + *(int *)param_2);
          if (pvVar8 != (void *)0x0) {
            uStack_25 = (undefined1)(uVar6 >> 8);
            local_20 = uStack_25;
            local_26 = (undefined1)uVar6;
            local_1f = local_26;
            _V_memcpy(pvVar8,&local_20,2);
            iVar5 = *(int *)(param_2 + 0x10);
          }
        }
        *(int *)(param_2 + 0x10) = iVar5 + 2;
        CUtlBuffer::AddNullTermination(param_2);
      }
    }
    else {
      CUtlBuffer::Printf(param_2,"%u",uVar7);
LAB_001d739d:
      uVar6 = *(ushort *)(pbVar2 + 2);
      if (((byte)param_2[0x15] & 1) == 0) goto LAB_001d7470;
LAB_001d73ab:
      CUtlBuffer::Printf(param_2,"%u",(uint)uVar6);
    }
    CUtlBuffer::PutString(param_2,*(char **)(*(int *)(param_1 + 4) + 0x10 + iVar4 * 0x18));
    iVar4 = CUtlRBTree<CUtlMap<char_const*,CPureServerWhitelist::CCommand*,int>::Node_t,int,CUtlMap<char_const*,CPureServerWhitelist::CCommand*,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CPureServerWhitelist::CCommand*,int>::Node_t,int>,int>>
            ::NextInorder((CUtlRBTree<CUtlMap<char_const*,CPureServerWhitelist::CCommand*,int>::Node_t,int,CUtlMap<char_const*,CPureServerWhitelist::CCommand*,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CPureServerWhitelist::CCommand*,int>::Node_t,int>,int>>
                           *)param_1,iVar4);
  } while( true );
}

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)