L L4D2node

PrecacheCustomResponseSystem

0x005bc260 · 518 bytes · __cdecl

_Z28PrecacheCustomResponseSystemPKc

Decompiled

undefined (1 param)

/* PrecacheCustomResponseSystem(char const*) */

CResponseSystem * PrecacheCustomResponseSystem(char *param_1)

{
  byte bVar1;
  char cVar2;
  ushort *puVar3;
  CResponseSystem *this;
  char *pcVar4;
  byte *pbVar5;
  uint uVar6;
  int iVar7;
  int local_24;
  CResponseSystem *local_20;
  
  COM_TimestampedLog("PrecacheCustomResponseSystem %s - Start",param_1);
  bVar1 = *param_1;
  if (bVar1 == 0) {
    local_24 = -0x55555556;
  }
  else {
    local_24 = -0x55555556;
    pbVar5 = (byte *)param_1;
    do {
      pbVar5 = pbVar5 + 1;
      local_24 = (uint)bVar1 + local_24 * 0x21;
      bVar1 = *pbVar5;
    } while (bVar1 != 0);
  }
  uVar6 = (uint)DAT_00fbc498;
  if (DAT_00fbc498 != 0xffff) {
    do {
      while( true ) {
        iVar7 = uVar6 * 0x10;
        cVar2 = (*DAT_00fbc488)(&local_24,DAT_00fbc48c + iVar7 + 8);
        if (cVar2 != '\0') break;
        cVar2 = (*DAT_00fbc488)(DAT_00fbc48c + iVar7 + 8,&local_24);
        if (cVar2 == '\0') {
          this = *(CResponseSystem **)(DAT_00fbc48c + 0xc + iVar7);
          if (this != (CResponseSystem *)0x0) goto LAB_005bc419;
          goto LAB_005bc332;
        }
        iVar7 = CUtlRBTree<CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                ::Links((CUtlRBTree<CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                         *)&DAT_00fbc488,(ushort)uVar6);
        uVar6 = (uint)*(ushort *)(iVar7 + 2);
        if (*(ushort *)(iVar7 + 2) == 0xffff) goto LAB_005bc332;
      }
      puVar3 = (ushort *)
               CUtlRBTree<CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
               ::Links((CUtlRBTree<CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                        *)&DAT_00fbc488,(ushort)uVar6);
      uVar6 = (uint)*puVar3;
    } while (*puVar3 != 0xffff);
  }
LAB_005bc332:
  this = operator_new(0x3e44);
                    /* try { // try from 005bc343 to 005bc347 has its CatchHandler @ 005bc46a */
  CResponseSystem::CResponseSystem(this);
  *(undefined ***)this = &PTR__CInstancedResponseSystem_00c58788;
  *(undefined4 *)(this + 0x3e3c) = 0;
  *(undefined1 **)(this + 0x3e40) = g_ExpresserRRScriptBridge;
                    /* try { // try from 005bc368 to 005bc390 has its CatchHandler @ 005bc47c */
  iVar7 = _V_strlen(param_1);
  pcVar4 = operator_new__(iVar7 + 1U);
  *(char **)(this + 0x3e3c) = pcVar4;
  V_strncpy(pcVar4,param_1,iVar7 + 1U);
  cVar2 = (**(code **)(*(int *)this + 0x24))(this);
  if (cVar2 == '\0') {
    Error("CInstancedResponseSystem:  Failed to init response system from %s!",param_1);
  }
  local_20 = (CResponseSystem *)ResponseCopyString(param_1);
  bVar1 = *(byte *)local_20;
  if (bVar1 == 0) {
    iVar7 = -0x55555556;
  }
  else {
    iVar7 = -0x55555556;
    pbVar5 = (byte *)local_20;
    do {
      pbVar5 = pbVar5 + 1;
      iVar7 = (uint)bVar1 + iVar7 * 0x21;
      bVar1 = *pbVar5;
    } while (bVar1 != 0);
  }
  local_24 = iVar7;
  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>>
            *)&DAT_00fbc4a4,(Node_t *)&local_24);
  local_24 = iVar7;
  local_20 = this;
  CUtlRBTree<CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
  ::Insert((CUtlRBTree<CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,CInstancedResponseSystem*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
            *)&DAT_00fbc488,(Node_t *)&local_24);
LAB_005bc419:
  (**(code **)(*(int *)this + 0x1c))(this);
  COM_TimestampedLog("PrecacheCustomResponseSystem %s - Finish",param_1);
  return this;
}

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)