L L4D2node

MapList_ListMaps

0x0017ed60 · 537 bytes · __regparm3

_ZL16MapList_ListMapsPKcbbiiPA64_c

Decompiled

undefined (6 params)

/* MapList_ListMaps(char const*, bool, bool, int, int, char (*) [64]) */

int __regparm3
MapList_ListMaps(char *param_1,bool param_2,bool param_3,int param_4,int param_5,char *param_6)

{
  int iVar1;
  int iVar2;
  int iVar3;
  char *pcVar4;
  int iVar5;
  int in_GS_OFFSET;
  uint local_60;
  byte local_52;
  size_t local_50;
  char local_40 [32];
  int local_20;
  
  local_50 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if ((param_1 != (char *)0x0) && (*param_1 != '\0')) {
    local_50 = strlen(param_1);
  }
  if (param_3) {
    ConMsg("-------------\n");
  }
  local_60 = (uint)param_2;
  if (param_4 < 1) {
    iVar5 = 0;
  }
  else {
    iVar5 = 0;
    local_52 = param_2;
    do {
      if ((0 < (int)g_MapListMgr._20_4_) && (iVar5 < param_4)) {
        iVar3 = 0;
        do {
          iVar1 = CMapListManager::GetMapName((CMapListManager *)g_MapListMgr,iVar3);
          iVar2 = CMapListManager::IsMapValid((CMapListManager *)g_MapListMgr,iVar3);
          pcVar4 = (char *)(iVar1 + 5);
          if ((local_50 == 0) || (iVar1 = V_stristr(pcVar4,param_1), iVar1 != 0)) {
            if (param_3) {
              local_40[0] = '\0';
              if (iVar2 == 0) {
                V_strncpy(local_40,"OUTDATED:  ",0x20);
              }
              else if (iVar2 == 1) {
                V_strncpy(local_40,"PENDING:  ",0x20);
              }
              if ((bool)(local_52 & 1) != (iVar2 != 0)) {
                ConMsg("%s %s %s\n",local_40,&DAT_002b52ba,pcVar4);
              }
            }
            if (iVar2 != 0) {
              if (param_5 != 0) {
                V_strncpy(param_6 + iVar5 * 0x40,pcVar4,param_5);
              }
              iVar5 = iVar5 + 1;
            }
            if ((int)g_MapListMgr._20_4_ <= iVar3 + 1) break;
          }
          else if ((int)g_MapListMgr._20_4_ <= iVar3 + 1) break;
          iVar3 = iVar3 + 1;
        } while (iVar5 < param_4);
      }
      local_60 = local_60 - 1;
    } while ((local_60 != 0xffffffff) && (local_52 = local_52 + 1 & 1, iVar5 < param_4));
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar5;
  }
                    /* 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)