L L4D2node

KeyValues::GetString

0x00043300 · 379 bytes · __thiscall

_ZN9KeyValues9GetStringEPKcS1_

Decompiled

undefined (3 params)

/* KeyValues::GetString(char const*, char const*) */

char * __thiscall KeyValues::GetString(KeyValues *this,char *param_1,char *param_2)

{
  int iVar1;
  int iVar2;
  int in_GS_OFFSET;
  char local_220 [512];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar1 = FindKey(this,param_1,false);
  if (iVar1 == 0) {
switchD_0004334c_caseD_0:
    goto LAB_000433a5;
  }
  switch(*(undefined1 *)(iVar1 + 0x10)) {
  default:
    goto switchD_0004334c_caseD_0;
  case 1:
    goto switchD_0004334c_caseD_1;
  case 2:
  case 4:
    V_snprintf(local_220,0x40,"%d",*(undefined4 *)(iVar1 + 0xc));
    break;
  case 3:
    V_snprintf(local_220,0x40,"%f",(double)*(float *)(iVar1 + 0xc));
    break;
  case 5:
    iVar2 = V_UnicodeToUTF8(*(wchar_t **)(iVar1 + 8),local_220,0x200);
    if (iVar2 == 0) goto LAB_000433a5;
    SetString(this,param_1,local_220);
    goto switchD_0004334c_caseD_1;
  case 7:
    V_snprintf(local_220,0x40,"%lld",**(undefined4 **)(iVar1 + 4),(*(undefined4 **)(iVar1 + 4))[1]);
  }
  SetString(this,param_1,local_220);
switchD_0004334c_caseD_1:
  param_2 = *(char **)(iVar1 + 4);
LAB_000433a5:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return param_2;
  }
                    /* 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)