L L4D2node

KeyValues::RecursiveMergeKeyValues

0x00044020 · 151 bytes · __thiscall

_ZN9KeyValues23RecursiveMergeKeyValuesEPS_

Decompiled

undefined (2 params)

/* KeyValues::RecursiveMergeKeyValues(KeyValues*) */

void __thiscall KeyValues::RecursiveMergeKeyValues(KeyValues *this,KeyValues *param_1)

{
  KeyValues *this_00;
  KeyValues *this_01;
  int iVar1;
  char *pcVar2;
  char *pcVar3;
  int iVar4;
  undefined4 uVar5;
  
  this_00 = *(KeyValues **)(param_1 + 0x20);
  do {
    if (this_00 == (KeyValues *)0x0) {
      return;
    }
    for (this_01 = *(KeyValues **)(this + 0x20); this_01 != (KeyValues *)0x0;
        this_01 = *(KeyValues **)(this_01 + 0x1c)) {
      pcVar2 = (char *)GetName(this_01);
      pcVar3 = (char *)GetName(this_00);
      iVar4 = _V_strcmp(pcVar3,pcVar2);
      if (iVar4 == 0) {
        RecursiveMergeKeyValues(this_01,this_00);
        goto LAB_0004407d;
      }
    }
    uVar5 = MakeCopy(this_00);
    iVar4 = *(int *)(this + 0x20);
    if (iVar4 == 0) {
      *(undefined4 *)(this + 0x20) = uVar5;
    }
    else {
      for (iVar1 = *(int *)(iVar4 + 0x1c); iVar1 != 0; iVar1 = *(int *)(iVar1 + 0x1c)) {
        iVar4 = iVar1;
      }
      *(undefined4 *)(iVar4 + 0x1c) = uVar5;
    }
LAB_0004407d:
    this_00 = *(KeyValues **)(this_00 + 0x1c);
  } while( true );
}

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)