L L4D2node

CServerRemoteAccess::GetMapList

0x0020dd00 · 538 bytes · __thiscall

_ZN19CServerRemoteAccess10GetMapListER10CUtlBuffer

Decompiled

undefined (2 params)

/* CServerRemoteAccess::GetMapList(CUtlBuffer&) */

void __thiscall CServerRemoteAccess::GetMapList(CServerRemoteAccess *this,CUtlBuffer *param_1)

{
  char cVar1;
  char *pcVar2;
  char *pcVar3;
  int iVar4;
  int in_GS_OFFSET;
  undefined4 local_38c;
  undefined4 local_388;
  undefined2 local_384;
  undefined1 local_382;
  char local_32c [260];
  char local_228 [260];
  char local_124 [260];
  int local_20;
  
  local_382 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  local_384 = 0x7073;
  local_38c = 0x7370616d;
  local_388 = 0x622e2a2f;
  V_strncpy(local_32c,com_gamedir,0x104);
  _V_strlower(local_32c);
  pcVar2 = (char *)Sys_FindFirst((char *)&local_38c,(char *)0x0,0);
  while (pcVar2 != (char *)0x0) {
    snprintf(local_228,0x104,"maps/%s",pcVar2);
    (**(code **)(*g_pFileSystem + 0x88))(g_pFileSystem,local_228,local_228,0x104);
    pcVar3 = strstr(local_228,local_32c);
    if (pcVar3 != (char *)0x0) {
      strcpy(local_124,pcVar2);
      pcVar2 = strstr(local_124,".bsp");
      if (pcVar2 != (char *)0x0) {
        *pcVar2 = '\0';
      }
      CUtlBuffer::PutString(param_1,local_124);
      CUtlBuffer::PutString(param_1,"\n");
    }
    pcVar2 = (char *)Sys_FindNext((char *)0x0,0);
  }
  Sys_FindClose();
  if (((((byte)param_1[0x15] & 1) != 0) && (*(int *)(param_1 + 0x10) != 0)) &&
     (*(char *)(*(int *)param_1 + ((*(int *)(param_1 + 0x10) + -1) - *(int *)(param_1 + 0x20))) ==
      '\n')) {
    iVar4 = 0;
    if (((byte)param_1[0x15] & 0x10) == 0) {
      iVar4 = *(int *)(param_1 + 0x18);
    }
    while (iVar4 = iVar4 + -1, -1 < iVar4) {
      cVar1 = CUtlBuffer::CheckPut(param_1,1);
      if (cVar1 != '\0') {
        *(undefined1 *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) = 9
        ;
        *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
        CUtlBuffer::AddNullTermination(param_1);
      }
    }
  }
  cVar1 = CUtlBuffer::CheckPut(param_1,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) = 0;
    *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
    CUtlBuffer::AddNullTermination(param_1);
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* 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)