L L4D2node

KeyValues::ParseIncludedKeys

0x00047030 · 373 bytes · __thiscall

_ZN9KeyValues17ParseIncludedKeysEPKcS1_P15IBaseFileSystemS1_R10CUtlVectorIPS_10CUtlMemoryIS5_iEE

Decompiled

undefined (6 params)

/* KeyValues::ParseIncludedKeys(char const*, char const*, IBaseFileSystem*, char const*,
   CUtlVector<KeyValues*, CUtlMemory<KeyValues*, int> >&) */

void __thiscall
KeyValues::ParseIncludedKeys
          (KeyValues *this,char *param_1,char *param_2,IBaseFileSystem *param_3,char *param_4,
          CUtlVector *param_5)

{
  char *pcVar1;
  char cVar2;
  int iVar3;
  char *pcVar4;
  KeyValues *this_00;
  int in_GS_OFFSET;
  undefined4 local_224;
  char local_220 [512];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_3 != (IBaseFileSystem *)0x0) {
    V_strncpy(local_220,param_1,0x200);
    iVar3 = _V_strlen(local_220);
    if (0 < iVar3) {
      if ((local_220[iVar3 + -1] != '/') && (local_220[iVar3 + -1] != '\\')) {
        pcVar4 = local_220 + iVar3 + -1;
        while (*pcVar4 = '\0', pcVar4 != local_220) {
          pcVar1 = pcVar4 + -1;
          pcVar4 = pcVar4 + -1;
          if ((*pcVar1 == '/') || (*pcVar1 == '\\')) break;
        }
      }
    }
    V_strncat(local_220,param_2,0x200,-1);
    this_00 = operator_new((KeyValues *)0x2c,(uint)param_2);
    Init(this_00,*(IKeyValuesSystem **)(this + 0x14),false);
                    /* try { // try from 00047118 to 0004711c has its CatchHandler @ 000471ad */
    SetName(this_00,local_220);
    this_00[0x11] = (KeyValues)(this[0x11] != (KeyValues)0x0);
    local_224 = this_00;
    cVar2 = LoadFromFile(this_00,param_3,local_220,param_4);
    if (cVar2 == '\0') {
      DevMsg("KeyValues::ParseIncludedKeys: Couldn\'t load included keyvalue file %s\n",local_220);
      deleteThis();
    }
    else {
      CUtlVector<KeyValues*,CUtlMemory<KeyValues*,int>>::InsertBefore
                ((CUtlVector<KeyValues*,CUtlMemory<KeyValues*,int>> *)param_5,
                 *(int *)(param_5 + 0xc),(KeyValues **)&local_224);
    }
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)