L L4D2node

Info_ValueForKey

0x002022c0 · 249 bytes · __cdecl

_Z16Info_ValueForKeyPKcS0_

Decompiled

undefined (2 params)

/* Info_ValueForKey(char const*, char const*) */

undefined1 * Info_ValueForKey(char *param_1,char *param_2)

{
  char cVar1;
  int iVar2;
  undefined1 *puVar3;
  char *pcVar4;
  char *pcVar5;
  char *pcVar6;
  int in_GS_OFFSET;
  char local_810 [2048];
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  Info_ValueForKey(char_const*,char_const*)::valueindex =
       (Info_ValueForKey(char_const*,char_const*)::valueindex + 1) % 4;
  cVar1 = *param_1;
  if (cVar1 == '\\') {
    cVar1 = param_1[1];
    param_1 = param_1 + 1;
  }
  pcVar4 = local_810;
  do {
    if (cVar1 == '\\') {
      *pcVar4 = '\0';
      pcVar6 = param_1 + 1;
      cVar1 = param_1[1];
      pcVar4 = Info_ValueForKey(char_const*,char_const*)::value +
               Info_ValueForKey(char_const*,char_const*)::valueindex * 0x800;
      if ((cVar1 != '\\') && (pcVar5 = pcVar4, cVar1 != '\0')) {
        do {
          pcVar4 = pcVar5 + 1;
          pcVar6 = pcVar6 + 1;
          *pcVar5 = cVar1;
          cVar1 = *pcVar6;
          if (cVar1 == '\0') break;
          pcVar5 = pcVar4;
        } while (cVar1 != '\\');
      }
      *pcVar4 = '\0';
      iVar2 = _V_strcmp(param_2,local_810);
      if (iVar2 == 0) {
        puVar3 = Info_ValueForKey(char_const*,char_const*)::value +
                 Info_ValueForKey(char_const*,char_const*)::valueindex * 0x800;
        goto LAB_002023a1;
      }
      if (*pcVar6 == '\0') goto LAB_0020239c;
      pcVar4 = local_810;
      param_1 = pcVar6;
    }
    else {
      if (cVar1 == '\0') {
LAB_0020239c:
        puVar3 = &DAT_002c79d4;
LAB_002023a1:
        if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
          __stack_chk_fail();
        }
        return puVar3;
      }
      *pcVar4 = cVar1;
      pcVar4 = pcVar4 + 1;
    }
    param_1 = param_1 + 1;
    cVar1 = *param_1;
  } 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)