L L4D2node

CResponseDict<ResponseGroup,unsigned_short>::Find

0x005bee30 · 448 bytes · __thiscall

_ZNK13CResponseDictI13ResponseGrouptE4FindEPKc

Decompiled

undefined (2 params)

/* CResponseDict<ResponseGroup, unsigned short>::Find(char const*) const */

uint __thiscall
CResponseDict<ResponseGroup,unsigned_short>::Find
          (CResponseDict<ResponseGroup,unsigned_short> *this,char *param_1)

{
  byte bVar1;
  ushort uVar2;
  int iVar3;
  char cVar4;
  int iVar5;
  int iVar6;
  uint uVar7;
  int local_34;
  void *local_30;
  undefined4 local_2c;
  int local_28;
  undefined4 local_24;
  undefined1 local_20;
  undefined1 local_1f;
  undefined1 local_1e;
  byte local_1d;
  
  local_34 = -0x55555556;
  bVar1 = *param_1;
  while (bVar1 != 0) {
    param_1 = param_1 + 1;
    local_34 = (uint)bVar1 + local_34 * 0x21;
    bVar1 = *param_1;
  }
  local_30 = (void *)0x0;
  local_2c = 0;
  local_28 = 0;
  local_24 = 0;
  local_20 = 1;
  local_1d = local_1d & 0xe0 | 1;
  local_1f = 0;
  uVar7 = (uint)*(ushort *)(this + 0x10);
  local_1e = 1;
  if (*(ushort *)(this + 0x10) != 0xffff) {
    iVar6 = *(int *)(this + 4);
    do {
      while( true ) {
        iVar5 = uVar7 * 0x20;
                    /* try { // try from 005beede to 005beef7 has its CatchHandler @ 005befff */
        cVar4 = (**(code **)this)(&local_34,iVar6 + 8 + iVar5);
        if (cVar4 != '\0') break;
        cVar4 = (**(code **)this)(*(int *)(this + 4) + iVar5 + 8,&local_34);
        if (cVar4 == '\0') goto LAB_005bef17;
        if ((CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
             ::Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar6 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                         ::Links(unsigned_short)::s_Sentinel), iVar6 != 0)) {
          CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
          ::Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f21cda = 0xffff;
          DAT_00f21cdc = 0xffff;
          __cxa_guard_release(&CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                               ::Links(unsigned_short)::s_Sentinel);
        }
        iVar6 = *(int *)(this + 4);
        uVar2 = *(ushort *)(iVar6 + 2 + iVar5);
        uVar7 = (uint)uVar2;
        if (uVar2 == 0xffff) goto LAB_005bef17;
      }
      if ((CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
           ::Links(unsigned_short)::s_Sentinel == '\0') &&
         (iVar6 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                       ::Links(unsigned_short)::s_Sentinel), iVar6 != 0)) {
        DAT_00f21cda = 0xffff;
        CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
        ::Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f21cdc = 0xffff;
        __cxa_guard_release(&CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                             ::Links(unsigned_short)::s_Sentinel);
      }
      iVar6 = *(int *)(this + 4);
      uVar7 = (uint)*(ushort *)(iVar6 + iVar5);
    } while (*(ushort *)(iVar6 + iVar5) != 0xffff);
LAB_005bef17:
    iVar6 = local_28 + -1;
    if (-1 < iVar6) {
      iVar5 = iVar6 * 0x50;
      do {
        iVar3 = iVar5 + 0x19;
        iVar6 = iVar6 + -1;
        iVar5 = iVar5 + -0x50;
        AI_ResponseParams::ScriptFollowup_t::~ScriptFollowup_t
                  ((ScriptFollowup_t *)((int)local_30 + iVar3));
      } while (iVar6 != -1);
    }
  }
  free(local_30);
  return uVar7;
}

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)