L L4D2node

SessionMembersFindPlayer

0x00037620 · 464 bytes · __cdecl

_Z24SessionMembersFindPlayerP9KeyValuesyPS0_

Decompiled

undefined (3 params)

/* SessionMembersFindPlayer(KeyValues*, unsigned long long, KeyValues**) */

char * SessionMembersFindPlayer(KeyValues *param_1,ulonglong param_2,KeyValues **param_3)

{
  ulonglong uVar1;
  KeyValues *this;
  int iVar2;
  KeyValues *this_00;
  int iVar3;
  char *pcVar4;
  int iVar5;
  int in_GS_OFFSET;
  int local_13c;
  CFmtStrN<256> local_12c [5];
  char local_127 [263];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_3 != (KeyValues **)0x0) {
    *param_3 = (KeyValues *)0x0;
  }
  if (((param_1 != (KeyValues *)0x0) &&
      (this = (KeyValues *)KeyValues::FindKey(param_1,"Members",false), this != (KeyValues *)0x0))
     && (iVar2 = KeyValues::GetInt(this,"numMachines",0), 0 < iVar2)) {
    local_13c = 0;
    do {
      CFmtStrN<256>::CFmtStrN(local_12c,"machine%d",local_13c);
      this_00 = (KeyValues *)KeyValues::FindKey(this,local_127,false);
      if ((this_00 != (KeyValues *)0x0) &&
         (iVar3 = KeyValues::GetInt(this_00,"numPlayers",0), 0 < iVar3)) {
        iVar5 = 0;
        do {
          CFmtStrN<256>::CFmtStrN(local_12c,"player%d",iVar5);
          pcVar4 = (char *)KeyValues::FindKey(this_00,local_127,false);
          if ((pcVar4 != (char *)0x0) &&
             (uVar1 = KeyValues::GetUint64(pcVar4,0xb4d28), param_2 == uVar1)) {
            if (param_3 != (KeyValues **)0x0) {
              *param_3 = this_00;
            }
            goto LAB_000377d6;
          }
          iVar5 = iVar5 + 1;
        } while (iVar5 != iVar3);
      }
      local_13c = local_13c + 1;
    } while (local_13c != iVar2);
  }
  pcVar4 = (char *)0x0;
LAB_000377d6:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return pcVar4;
}

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)