L L4D2node

CResponseSystem::ResolveResponse

0x005b73e0 · 1004 bytes · __thiscall

_ZN15CResponseSystem15ResolveResponseERNS_20ResponseSearchResultEiPKcbP15IResponseFilter

Decompiled

undefined (6 params)

/* CResponseSystem::ResolveResponse(CResponseSystem::ResponseSearchResult&, int, char const*, bool,
   IResponseFilter*) */

undefined4 __thiscall
CResponseSystem::ResolveResponse
          (CResponseSystem *this,ResponseSearchResult *param_1,int param_2,char *param_3,
          bool param_4,IResponseFilter *param_5)

{
  ResponseGroup *pRVar1;
  byte bVar2;
  byte bVar3;
  char cVar4;
  ushort uVar5;
  uint uVar6;
  int iVar7;
  undefined4 uVar8;
  undefined1 *puVar9;
  int iVar10;
  int iVar11;
  int iVar12;
  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;
  bVar2 = *param_3;
  while (bVar2 != 0) {
    param_3 = param_3 + 1;
    local_34 = (uint)bVar2 + local_34 * 0x21;
    bVar2 = *param_3;
  }
  local_30 = (void *)0x0;
  uVar5 = *(ushort *)(this + 0x1c);
  local_2c = 0;
  local_28 = 0;
  local_24 = 0;
  local_20 = 1;
  local_1d = local_1d & 0xe0 | 1;
  local_1f = 0;
  local_1e = 1;
  if (uVar5 != 0xffff) {
    iVar12 = *(int *)(this + 0x10);
    do {
      while( true ) {
        iVar11 = (uint)uVar5 * 0x20;
                    /* try { // try from 005b749e to 005b74b9 has its CatchHandler @ 005b77fb */
        cVar4 = (**(code **)(this + 0xc))(&local_34,iVar12 + 8 + iVar11);
        if (cVar4 != '\0') break;
        cVar4 = (**(code **)(this + 0xc))(*(int *)(this + 0x10) + iVar11 + 8,&local_34);
        if (cVar4 == '\0') goto LAB_005b74d9;
        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') &&
           (iVar12 = __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), iVar12 != 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);
        }
        iVar12 = *(int *)(this + 0x10);
        uVar5 = *(ushort *)(iVar12 + 2 + iVar11);
        if (uVar5 == 0xffff) goto LAB_005b74d9;
      }
      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') &&
         (iVar12 = __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), iVar12 != 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);
      }
      iVar12 = *(int *)(this + 0x10);
      uVar5 = *(ushort *)(iVar12 + iVar11);
    } while (uVar5 != 0xffff);
LAB_005b74d9:
    iVar12 = local_28 + -1;
    if (-1 < iVar12) {
      iVar11 = iVar12 * 0x50;
      do {
        iVar10 = iVar11 + 0x19;
        iVar12 = iVar12 + -1;
        iVar11 = iVar11 + -0x50;
        AI_ResponseParams::ScriptFollowup_t::~ScriptFollowup_t
                  ((ScriptFollowup_t *)((int)local_30 + iVar10));
      } while (iVar12 != -1);
    }
    local_28 = 0;
    free(local_30);
    if (uVar5 != 0xffff) {
      iVar12 = (uint)uVar5 * 0x20 + *(int *)(this + 0x10);
      if ((*(char *)(iVar12 + 0x1c) != '\0') && (iVar11 = *(int *)(iVar12 + 0x14), iVar11 != 0)) {
        pRVar1 = (ResponseGroup *)(iVar12 + 0xc);
        if ((*(byte *)(iVar12 + 0x1f) & 8) == 0) {
          uVar6 = SelectWeightedResponseFromResponseGroup(this,pRVar1,param_5);
          if (-1 < (int)uVar6) {
            iVar10 = uVar6 * 0x50;
LAB_005b7683:
            if (param_4) {
              local_34 = *(int *)(*(int *)(this + 0x10) + 8 + (uint)uVar5 * 0x20);
              uVar5 = 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>>
                      ::Find((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 + 0x28),(Node_t *)&local_34);
              if (uVar5 == 0xffff) {
                puVar9 = &DAT_00d539c2;
              }
              else {
                puVar9 = *(undefined1 **)((uint)uVar5 * 0x10 + *(int *)(this + 0x2c) + 0xc);
              }
              DebugPrint(this,param_2,"%s\n",puVar9);
              DebugPrint(this,param_2,"{\n");
              DescribeResponseGroup(this,pRVar1,uVar6,param_2);
            }
            iVar10 = iVar10 + *(int *)(iVar12 + 0xc);
            if ((*(byte *)(iVar10 + 0x2f) & 0x3f) == 4) {
              uVar8 = ResolveResponse(this,param_1,param_2 + 1,*(char **)(iVar10 + 0x28),param_4,
                                      param_5);
            }
            else {
              *(int *)(param_1 + 4) = iVar10;
              *(ResponseGroup **)param_1 = pRVar1;
              uVar8 = 1;
            }
            if (param_4) {
              DebugPrint(this,param_2,"}\n");
              return uVar8;
            }
            return uVar8;
          }
        }
        else {
          bVar2 = *(byte *)(iVar12 + 0x1d);
          bVar3 = bVar2;
          do {
            uVar6 = (uint)bVar3;
            *(byte *)(iVar12 + 0x1d) = bVar3 + 1;
            if ((int)uVar6 < iVar11) {
              iVar10 = uVar6 * 0x50;
            }
            else {
              if ((*(byte *)(iVar12 + 0x1f) & 0x10) != 0) {
                *(undefined1 *)(iVar12 + 0x1c) = 0;
                return 0;
              }
              *(undefined1 *)(iVar12 + 0x1d) = 0;
              iVar10 = 0;
              uVar6 = 0;
            }
            if ((param_5 == (IResponseFilter *)0x0) ||
               (iVar7 = iVar10 + *(int *)(iVar12 + 0xc),
               cVar4 = (*(code *)**(undefined4 **)param_5)
                                 (param_5,*(byte *)(iVar7 + 0x2f) & 0x3f,
                                  *(undefined4 *)(iVar7 + 0x28)), cVar4 != '\0')) goto LAB_005b7683;
            bVar3 = *(byte *)(iVar12 + 0x1d);
          } while (bVar2 != bVar3);
        }
      }
    }
  }
  return 0;
}

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)