L L4D2node

CResponseSystem::CopyResponsesFrom

0x005bc840 · 1286 bytes · __thiscall

_ZN15CResponseSystem17CopyResponsesFromEP4RuleS1_PS_

Decompiled

undefined (4 params)

/* CResponseSystem::CopyResponsesFrom(Rule*, Rule*, CResponseSystem*) */

void __thiscall
CResponseSystem::CopyResponsesFrom
          (CResponseSystem *this,Rule *param_1,Rule *param_2,CResponseSystem *param_3)

{
  byte bVar1;
  int iVar2;
  ushort uVar3;
  undefined2 uVar4;
  int iVar5;
  char *pcVar6;
  byte *pbVar7;
  int iVar8;
  int iVar9;
  size_t __size;
  int iVar10;
  int iVar11;
  int iVar12;
  int local_b0;
  undefined4 local_90 [2];
  int local_88;
  byte *local_84;
  void *local_80;
  undefined4 local_7c;
  int local_78;
  undefined4 local_74;
  undefined1 local_70;
  undefined1 local_6f;
  undefined1 local_6e;
  byte local_6d;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  int local_60;
  undefined1 local_5c;
  undefined2 uStack_5b;
  undefined1 uStack_59;
  undefined1 uStack_58;
  undefined4 local_57;
  undefined4 local_53;
  undefined4 local_4f;
  undefined4 local_4b;
  undefined4 local_44;
  undefined2 local_40;
  undefined1 local_3e;
  byte local_3d;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined1 local_20;
  
  iVar2 = *(int *)(param_1 + 0x18);
  if (0 < iVar2) {
    local_b0 = 0;
    do {
      iVar9 = (uint)*(ushort *)(*(int *)(param_1 + 0x10) + local_b0) * 0x20;
      iVar5 = iVar9 + *(int *)(this + 0x10);
      if (iVar5 != -0xc) {
        local_80 = (void *)0x0;
        local_7c = 0;
        local_6e = *(undefined1 *)(iVar5 + 0x1e);
        local_78 = 0;
        local_74 = 0;
        local_6d = local_6d & 0xe0 | *(byte *)(iVar5 + 0x1f) & 1 | *(byte *)(iVar5 + 0x1f) & 2 |
                   *(byte *)(iVar5 + 0x1f) & 4 | *(byte *)(iVar5 + 0x1f) & 8 |
                   *(byte *)(iVar5 + 0x1f) & 0x10;
        local_70 = *(undefined1 *)(iVar5 + 0x1c);
        local_6f = *(undefined1 *)(iVar5 + 0x1d);
        iVar11 = *(int *)(iVar5 + 0x14);
        if (0 < iVar11) {
          iVar10 = 0;
          iVar12 = 0;
          do {
            iVar8 = iVar10 + *(int *)(iVar5 + 0xc);
            if (iVar8 != 0) {
              local_53 = 0;
              local_4f = 0;
              local_4b = 0;
              local_60 = 100;
              uStack_5b = float16::ConvertFloatTo16bits(0.0);
              local_6c = CONCAT22(uStack_5b,uStack_5b);
              local_68 = (void *)CONCAT22(uStack_5b,uStack_5b);
              local_64 = CONCAT22(uStack_5b,uStack_5b);
              local_5c = 0;
              uStack_59 = (undefined1)uStack_5b;
              uStack_58 = (undefined1)((ushort)uStack_5b >> 8);
              local_57 = 0;
              local_3c = 0;
              local_38 = 0;
              local_34 = 0;
              local_30 = 0;
              local_2c = 0;
              local_28 = 0;
              local_24 = 0;
              local_20 = 0;
              local_44 = 0;
              float16::ConvertFloatTo16bits(1.0);
              local_3e = 0;
              local_40 = *(undefined2 *)(iVar8 + 0x2c);
              local_3d = *(byte *)(iVar8 + 0x2f) & 0x3f;
                    /* try { // try from 005bca2e to 005bca7d has its CatchHandler @ 005bcd4d */
              local_44 = ResponseCopyString(*(char **)(iVar8 + 0x28));
              local_3e = *(undefined1 *)(iVar8 + 0x2e);
              local_3d = local_3d & 0x3f | *(byte *)(iVar8 + 0x2f) & 0x40 |
                         *(byte *)(iVar8 + 0x2f) & 0x80;
              CUtlVector<Response,CUtlMemoryConservative<Response>>::InsertBefore
                        ((CUtlVector<Response,CUtlMemoryConservative<Response>> *)&local_80,local_78
                         ,(Response *)&local_6c);
              AI_ResponseParams::ScriptFollowup_t::~ScriptFollowup_t((ScriptFollowup_t *)&local_53);
            }
            iVar12 = iVar12 + 1;
            iVar10 = iVar10 + 0x50;
          } while (iVar12 != iVar11);
          iVar5 = iVar9 + *(int *)(this + 0x10);
        }
        local_90[0] = *(undefined4 *)(iVar5 + 8);
                    /* try { // try from 005bcac3 to 005bcb33 has its CatchHandler @ 005bcd70 */
        uVar3 = 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_90);
        if (uVar3 == 0xffff) {
          pcVar6 = "";
        }
        else {
          pcVar6 = *(char **)((uint)uVar3 * 0x10 + *(int *)(this + 0x2c) + 0xc);
        }
        local_84 = (byte *)ResponseCopyString(pcVar6);
        bVar1 = *local_84;
        if (bVar1 == 0) {
          iVar9 = -0x55555556;
        }
        else {
          iVar9 = -0x55555556;
          pbVar7 = local_84;
          do {
            pbVar7 = pbVar7 + 1;
            iVar9 = (uint)bVar1 + iVar9 * 0x21;
            bVar1 = *pbVar7;
          } while (bVar1 != 0);
        }
        local_88 = iVar9;
        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>>
                  *)(param_3 + 0x28),(Node_t *)&local_88);
        iVar5 = local_78;
        local_68 = (void *)0x0;
        local_64 = 0;
        local_60 = 0;
        local_5c = 0;
        uStack_5b = 0;
        uStack_59 = 0;
        uStack_58 = 1;
        local_57 = CONCAT22((ushort)(local_57 >> 0x10) & 0xffe0,0x100) | 0x10000;
        local_6c = iVar9;
        if (local_78 < 1) {
          local_68 = realloc((void *)0x0,0);
          local_64 = 0;
          local_5c = SUB41(local_68,0);
          uStack_5b = (undefined2)((uint)local_68 >> 8);
          uStack_59 = (undefined1)((uint)local_68 >> 0x18);
        }
        else {
          __size = local_78 * 0x50;
          local_68 = realloc((void *)0x0,__size);
          iVar9 = 0;
          local_5c = SUB41(local_68,0);
          uStack_5b = (undefined2)((uint)local_68 >> 8);
          uStack_59 = (undefined1)((uint)local_68 >> 0x18);
          iVar11 = 0;
          local_64 = __size;
          do {
                    /* try { // try from 005bcbbb to 005bcc2f has its CatchHandler @ 005bcd7d */
            CUtlVector<Response,CUtlMemoryConservative<Response>>::InsertBefore
                      ((CUtlVector<Response,CUtlMemoryConservative<Response>> *)&local_68,local_60,
                       (Response *)((int)local_80 + iVar11));
            iVar9 = iVar9 + 1;
            iVar11 = iVar11 + 0x50;
          } while (iVar9 != iVar5);
        }
        uStack_58 = local_70;
        local_57 = CONCAT31(CONCAT12(local_57._3_1_,
                                     CONCAT11(local_57._2_1_ & 0xe0 | local_6d & 1 | local_6d & 2 |
                                              local_6d & 4 | local_6d & 8 | local_6d & 0x10,local_6e
                                             )),local_6f);
        uVar4 = 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>>
                ::Insert((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>>
                          *)(param_3 + 0xc),(Node_t *)&local_6c);
        iVar9 = local_60 + -1;
        if (-1 < iVar9) {
          iVar5 = iVar9 * 0x50;
          do {
            iVar9 = iVar9 + -1;
            AI_ResponseParams::ScriptFollowup_t::~ScriptFollowup_t
                      ((ScriptFollowup_t *)((int)local_68 + iVar5 + 0x19));
            iVar5 = iVar5 + -0x50;
          } while (iVar9 != -1);
        }
        local_60 = 0;
        free(local_68);
        local_6c = CONCAT22(local_6c._2_2_,uVar4);
                    /* try { // try from 005bcc97 to 005bcc9b has its CatchHandler @ 005bcd70 */
        CUtlVector<unsigned_short,CUtlMemoryConservative<unsigned_short>>::InsertBefore
                  ((CUtlVector<unsigned_short,CUtlMemoryConservative<unsigned_short>> *)
                   (param_2 + 0x10),*(int *)(param_2 + 0x18),(ushort *)&local_6c);
        iVar9 = local_78 + -1;
        if (-1 < iVar9) {
          iVar5 = iVar9 * 0x50;
          do {
            iVar9 = iVar9 + -1;
            AI_ResponseParams::ScriptFollowup_t::~ScriptFollowup_t
                      ((ScriptFollowup_t *)((int)local_80 + iVar5 + 0x19));
            iVar5 = iVar5 + -0x50;
          } while (iVar9 != -1);
        }
        local_78 = 0;
        free(local_80);
      }
      local_b0 = local_b0 + 2;
    } while (local_b0 != iVar2 * 2);
  }
  return;
}

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)