L L4D2node

CResponseDict<Criteria,unsigned_short>::Insert

0x005cdf80 · 484 bytes · __thiscall

_ZN13CResponseDictI8CriteriatE6InsertEPKcRKS0_

Decompiled

undefined (3 params)

/* CResponseDict<Criteria, unsigned short>::Insert(char const*, Criteria const&) */

undefined4 __thiscall
CResponseDict<Criteria,unsigned_short>::Insert
          (CResponseDict<Criteria,unsigned_short> *this,char *param_1,Criteria *param_2)

{
  byte bVar1;
  Criteria CVar2;
  uint uVar3;
  size_t __size;
  byte *pbVar4;
  undefined4 uVar5;
  uint uVar6;
  byte *pbVar7;
  int iVar8;
  int local_48;
  undefined2 local_44;
  undefined2 uStack_42;
  undefined2 uStack_40;
  undefined2 local_3e;
  Criteria local_3c;
  undefined4 local_3b;
  undefined4 local_37;
  byte local_33;
  undefined2 local_32;
  undefined2 local_30;
  void *local_2e;
  uint local_2a;
  int local_26;
  void *local_22;
  
  pbVar4 = (byte *)ResponseCopyString(param_1);
  bVar1 = *pbVar4;
  if (bVar1 == 0) {
    iVar8 = -0x55555556;
  }
  else {
    iVar8 = -0x55555556;
    pbVar7 = pbVar4;
    do {
      pbVar7 = pbVar7 + 1;
      iVar8 = (uint)bVar1 + iVar8 * 0x21;
      bVar1 = *pbVar7;
    } while (bVar1 != 0);
  }
  local_44 = SUB42(pbVar4,0);
  uStack_42 = (undefined2)((uint)pbVar4 >> 0x10);
  local_48 = iVar8;
  CUtlRBTree<CUtlMap<unsigned_int,char_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,char_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,char_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
  ::Insert((CUtlRBTree<CUtlMap<unsigned_int,char_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,char_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,char_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
            *)(this + 0x1c),(Node_t *)&local_48);
  local_33 = local_33 & 0x80;
  local_32 = 0xffff;
  local_30 = 0xffff;
  local_3b = 0;
  local_37 = 0;
  local_2e = (void *)0x0;
  local_2a = 0;
  local_26 = 0;
  local_22 = (void *)0x0;
  uStack_42 = 0;
  uStack_40 = 0;
  local_3e = float16::ConvertFloatTo16bits(1.0);
  local_3c = (Criteria)0x0;
  local_44 = *(undefined2 *)param_2;
  local_48 = iVar8;
                    /* try { // try from 005ce046 to 005ce139 has its CatchHandler @ 005ce164 */
  uVar5 = ResponseCopyString(*(char **)(param_2 + 2));
  uStack_42 = (undefined2)uVar5;
  uStack_40 = (undefined2)((uint)uVar5 >> 0x10);
  local_3e = *(undefined2 *)(param_2 + 6);
  CVar2 = param_2[0x11];
  local_3b = *(undefined4 *)(param_2 + 9);
  local_3c = param_2[8];
  local_37 = *(undefined4 *)(param_2 + 0xd);
  local_33 = local_33 & 0x80 | (byte)CVar2 & 1 | (byte)CVar2 & 2 | (byte)CVar2 & 4 | (byte)CVar2 & 8
             | (byte)CVar2 & 0x10 | (byte)CVar2 & 0x20 | (byte)CVar2 & 0x40;
  uVar3 = *(uint *)(param_2 + 0x1e);
  local_32 = *(undefined2 *)(param_2 + 0x12);
  local_30 = *(undefined2 *)(param_2 + 0x14);
  uVar6 = local_2a >> 1;
  if ((int)(local_2a >> 1) < (int)uVar3) {
    uVar6 = uVar3;
  }
  __size = uVar6 * 2;
  local_2e = realloc(local_2e,__size);
  iVar8 = 0;
  local_2a = __size;
  local_22 = local_2e;
  if (0 < (int)uVar3) {
    do {
      CUtlVector<unsigned_short,CUtlMemoryConservative<unsigned_short>>::InsertBefore
                ((CUtlVector<unsigned_short,CUtlMemoryConservative<unsigned_short>> *)&local_2e,
                 local_26,(ushort *)(*(int *)(param_2 + 0x16) + iVar8));
      iVar8 = iVar8 + 2;
    } while (iVar8 != uVar3 * 2);
  }
  uVar5 = CUtlRBTree<CUtlMap<unsigned_int,Criteria,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,Criteria,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,Criteria,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
          ::Insert((CUtlRBTree<CUtlMap<unsigned_int,Criteria,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,Criteria,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,Criteria,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                    *)this,(Node_t *)&local_48);
  local_26 = 0;
  free(local_2e);
  return uVar5;
}

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)