L L4D2node

CMatchExtL4D::GetMapInfoByBspName

0x000351d0 · 585 bytes · __thiscall

_ZN12CMatchExtL4D19GetMapInfoByBspNameEP9KeyValuesPKcPS1_

Decompiled

undefined (4 params)

/* CMatchExtL4D::GetMapInfoByBspName(KeyValues*, char const*, KeyValues**) */

KeyValues * __thiscall
CMatchExtL4D::GetMapInfoByBspName
          (CMatchExtL4D *this,KeyValues *param_1,char *param_2,KeyValues **param_3)

{
  char *pcVar1;
  KeyValues *pKVar2;
  KeyValues *this_00;
  KeyValues *this_01;
  int iVar3;
  char *pcVar4;
  int iVar5;
  KeyValues *this_02;
  int iVar6;
  int in_GS_OFFSET;
  CFmtStrN<256> local_12c [5];
  char local_127 [263];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if ((((*(int *)(this + 4) != 0) && (param_2 != (char *)0x0)) && (*param_2 != '\0')) &&
     ((pcVar1 = (char *)KeyValues::GetString(param_1,"Game/mode",(char *)0x0), pcVar1 != (char *)0x0
      && (*pcVar1 != '\0')))) {
    CFmtStrN<256>::CFmtStrN(local_12c,"GameModes/%s/missions",pcVar1);
    pKVar2 = (KeyValues *)KeyValues::FindKey(*(KeyValues **)(this + 4),local_127,false);
    if (pKVar2 != (KeyValues *)0x0) {
      for (pKVar2 = (KeyValues *)KeyValues::GetFirstValue(pKVar2); pKVar2 != (KeyValues *)0x0;
          pKVar2 = (KeyValues *)KeyValues::GetNextValue(pKVar2)) {
        this_00 = (KeyValues *)KeyValues::GetPtr(pKVar2,(char *)0x0,(void *)0x0);
        if (this_00 != (KeyValues *)0x0) {
          CFmtStrN<256>::CFmtStrN(local_12c,"Modes/%s",pcVar1);
          this_01 = (KeyValues *)KeyValues::FindKey(this_00,local_127,false);
          if ((this_01 != (KeyValues *)0x0) &&
             (iVar3 = KeyValues::GetInt(this_01,"chapters",0), 0 < iVar3)) {
            iVar6 = 1;
            do {
              CFmtStrN<256>::CFmtStrN(local_12c,"%d",iVar6);
              this_02 = (KeyValues *)KeyValues::FindKey(this_01,local_127,false);
              if (this_02 == (KeyValues *)0x0) break;
              pcVar4 = (char *)KeyValues::GetString(this_02,"map","");
              iVar5 = _V_stricmp(pcVar4,param_2);
              if (iVar5 == 0) {
                if (param_3 != (KeyValues **)0x0) {
                  *param_3 = this_00;
                }
                goto LAB_000353ea;
              }
              iVar6 = iVar6 + 1;
            } while (iVar6 <= iVar3);
          }
        }
      }
    }
  }
  this_02 = (KeyValues *)0x0;
LAB_000353ea:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return this_02;
  }
                    /* 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)