L L4D2node

CResponseSystem::CopyRuleFrom

0x005be220 · 462 bytes · __thiscall

_ZN15CResponseSystem12CopyRuleFromEP4RulejPS_

Decompiled

undefined (4 params)

/* CResponseSystem::CopyRuleFrom(Rule*, unsigned int, CResponseSystem*) */

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

{
  Rule RVar1;
  Rule RVar2;
  ushort uVar3;
  Rule *pRVar4;
  undefined4 uVar5;
  int iVar6;
  CUtlRBTree<CUtlMap<unsigned_int,Rule*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,Rule*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,Rule*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
  *this_00;
  byte *pbVar7;
  byte bVar8;
  char *pcVar9;
  int local_24;
  Rule *local_20;
  
  if ((param_1 != (Rule *)0x0) && (param_3 != (CResponseSystem *)0x0)) {
    pRVar4 = ::operator_new(0x26);
    *(undefined4 *)pRVar4 = 0;
    *(undefined4 *)(pRVar4 + 4) = 0;
    *(undefined4 *)(pRVar4 + 8) = 0;
    *(undefined4 *)(pRVar4 + 0xc) = 0;
    *(undefined4 *)(pRVar4 + 0x10) = 0;
    *(undefined4 *)(pRVar4 + 0x14) = 0;
    *(undefined4 *)(pRVar4 + 0x18) = 0;
    *(undefined4 *)(pRVar4 + 0x1c) = 0;
    pRVar4[0x24] = (Rule)0x0;
    *(undefined4 *)(pRVar4 + 0x20) = 0;
    pRVar4[0x25] = (Rule)((byte)pRVar4[0x25] & 0xf8 | 4);
    uVar5 = ResponseCopyString(*(char **)(param_1 + 0x20));
    *(undefined4 *)(pRVar4 + 0x20) = uVar5;
    RVar1 = pRVar4[0x25];
    bVar8 = (byte)param_1[0x25] & 2;
    pRVar4[0x25] = (Rule)((byte)RVar1 & 0xfd | bVar8);
    RVar2 = param_1[0x25];
    pRVar4[0x25] = (Rule)((byte)RVar1 & 0xf9 | bVar8 | (byte)RVar2 & 4);
    pRVar4[0x25] = (Rule)((byte)RVar1 & 0xf8 | bVar8 | (byte)RVar2 & 4 | (byte)param_1[0x25] & 1);
    CopyCriteriaFrom(this,param_1,pRVar4,param_3);
    CopyResponsesFrom(this,param_1,pRVar4,param_3);
    iVar6 = (param_2 >> 0x10) * 0x38;
    local_24 = *(undefined4 *)((param_2 & 0xffff) * 0x10 + *(int *)(this + iVar6 + 0x80) + 8);
    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 + iVar6 + 0x98),(Node_t *)&local_24);
    if (uVar3 == 0xffff) {
      pcVar9 = "";
    }
    else {
      pcVar9 = *(char **)((uint)uVar3 * 0x10 + *(int *)(this + iVar6 + 0x9c) + 0xc);
    }
    this_00 = (CUtlRBTree<CUtlMap<unsigned_int,Rule*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,Rule*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,Rule*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
               *)ResponseRulePartition::GetDictForRule
                           ((ResponseRulePartition *)(param_3 + 0x7c),this,pRVar4);
    local_20 = (Rule *)ResponseCopyString(pcVar9);
    bVar8 = *(byte *)local_20;
    if (bVar8 == 0) {
      iVar6 = -0x55555556;
    }
    else {
      iVar6 = -0x55555556;
      pbVar7 = (byte *)local_20;
      do {
        pbVar7 = pbVar7 + 1;
        iVar6 = (uint)bVar8 + iVar6 * 0x21;
        bVar8 = *pbVar7;
      } while (bVar8 != 0);
    }
    local_24 = iVar6;
    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_00 + 0x1c),(Node_t *)&local_24);
    local_24 = iVar6;
    local_20 = pRVar4;
    CUtlRBTree<CUtlMap<unsigned_int,Rule*,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,Rule*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,Rule*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
    ::Insert(this_00,(Node_t *)&local_24);
    return;
  }
  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)