L L4D2node

GetDefaultKeyBindings

0x00183fb0 · 447 bytes · unknown

_Z21GetDefaultKeyBindingsv

Decompiled

undefined (0 params)

/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* GetDefaultKeyBindings() */

KeyValues * GetDefaultKeyBindings(void)

{
  KeyValues *this;
  int iVar1;
  int iVar2;
  char *pcVar3;
  char *pcVar4;
  int in_GS_OFFSET;
  uint in_stack_ffffeab8;
  char local_1520 [256];
  char local_1420 [1024];
  char local_1020 [4096];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  this = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffeab8);
                    /* try { // try from 00183ff0 to 00183ff4 has its CatchHandler @ 00184170 */
  KeyValues::KeyValues(this,"defaults",(IKeyValuesSystem *)0x0,false);
  V_snprintf(local_1020,0x1000,"%skb_def.lst","scripts/");
  iVar1 = (**(code **)(*(int *)(g_pFileSystem + 4) + 8))
                    (g_pFileSystem + 4,local_1020,&DAT_002a9af2,0);
  if (iVar1 == 0) {
    ConMsg("Couldn\'t open kb_def.lst\n");
  }
  else {
    iVar2 = (**(code **)(*(int *)(g_pFileSystem + 4) + 0x18))(g_pFileSystem + 4,iVar1);
    pcVar3 = operator_new__(iVar2 + 1);
    (*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,pcVar3,iVar2,iVar1);
    (**(code **)(*(int *)(g_pFileSystem + 4) + 0xc))(g_pFileSystem + 4,iVar1);
    pcVar3[iVar2] = '\0';
    pcVar4 = pcVar3;
    while( true ) {
      pcVar4 = (char *)COM_ParseFile(pcVar4,local_1420,0x400);
      if (local_1420[0] == '\0') break;
      V_strncpy(local_1520,local_1420,0x100);
      pcVar4 = (char *)COM_ParseFile(pcVar4,local_1420,0x400);
      if (local_1420[0] == '\0') break;
      KeyValues::SetString(this,local_1420,local_1520);
    }
    operator_delete(pcVar3);
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return this;
  }
                    /* 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)