L L4D2node

KeyValues::CreateKey

0x0024ebe0 · 151 bytes · __thiscall

_ZN9KeyValues9CreateKeyEPKc

Decompiled

undefined (2 params)

/* KeyValues::CreateKey(char const*) */

KeyValues * __thiscall KeyValues::CreateKey(KeyValues *this,char *param_1)

{
  int iVar1;
  KeyValues *this_00;
  int iVar2;
  uint in_stack_ffffffe8;
  
  this_00 = operator_new((KeyValues *)0x2c,in_stack_ffffffe8);
  Init(this_00,*(IKeyValuesSystem **)(this + 0x14),false);
                    /* try { // try from 0024ec1a to 0024ec1e has its CatchHandler @ 0024ec8b */
  SetName(this_00,param_1);
  if (this_00 == (KeyValues *)0x0) {
    return (KeyValues *)0x0;
  }
  if (*(int *)this_00 == -1) {
    ~KeyValues(this_00);
    operator_delete(this_00,param_1);
    this_00 = (KeyValues *)0x0;
  }
  else {
    this_00[0x11] = (KeyValues)(this[0x11] != (KeyValues)0x0);
    iVar1 = *(int *)(this + 0x20);
    if (*(int *)(this + 0x20) == 0) {
      *(KeyValues **)(this + 0x20) = this_00;
      return this_00;
    }
    do {
      iVar2 = iVar1;
      iVar1 = *(int *)(iVar2 + 0x1c);
    } while (iVar1 != 0);
    *(KeyValues **)(iVar2 + 0x1c) = this_00;
  }
  return this_00;
}

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)