L L4D2node

CSlideshowDisplay::BuildSlideShowImagesList

0x00823960 · 1014 bytes · __thiscall

_ZN17CSlideshowDisplay24BuildSlideShowImagesListEv

Decompiled

undefined (1 param)

/* CSlideshowDisplay::BuildSlideShowImagesList() */

void __thiscall CSlideshowDisplay::BuildSlideShowImagesList(CSlideshowDisplay *this)

{
  CSlideshowDisplay *pCVar1;
  char cVar2;
  char *pcVar3;
  KeyValues *this_00;
  IBaseFileSystem *pIVar4;
  int iVar5;
  int iVar6;
  char *pcVar7;
  int in_GS_OFFSET;
  uint uVar8;
  char *local_4130;
  undefined4 local_4128;
  SlideKeywordList_t *local_4124;
  char local_4120 [256];
  char local_4020 [4096];
  char local_3020 [4092];
  undefined1 auStack_2024 [4];
  char local_2020 [4096];
  char local_1020 [4096];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  pcVar3 = local_3020;
  for (iVar6 = 0x400; iVar6 != 0; iVar6 = iVar6 + -1) {
    pcVar3[0] = '\0';
    pcVar3[1] = '\0';
    pcVar3[2] = '\0';
    pcVar3[3] = '\0';
    pcVar3 = pcVar3 + 4;
  }
  pCVar1 = this + 0x4c1;
  V_snprintf(local_4020,0x1000,"materials/vgui/%s/*.vmt",pCVar1);
  pcVar3 = (char *)(**(code **)(*g_pFullFileSystem + 0x70))
                             (g_pFullFileSystem,local_4020,&local_4128);
  if (pcVar3 == (char *)0x0) goto LAB_008239f2;
  do {
    V_strncpy(local_3020,pcVar3,0x1000);
LAB_008239f2:
    if (local_3020[0] == '\0') goto LAB_00823b5e;
    V_snprintf(local_2020,0x1000,"vgui/%s/%s",pCVar1,local_3020);
    iVar6 = _V_strlen(local_2020);
    auStack_2024[iVar6] = 0;
    PrecacheMaterial(local_2020);
    uVar8 = 0x1000;
    V_snprintf(local_1020,0x1000,"materials/vgui/%s/%s",pCVar1,local_3020);
    this_00 = KeyValues::operator_new((KeyValues *)0x2c,uVar8);
                    /* try { // try from 00823aaa to 00823aae has its CatchHandler @ 00823d70 */
    KeyValues::KeyValues(this_00,"material",(IKeyValuesSystem *)0x0,false);
    pIVar4 = (IBaseFileSystem *)0x0;
    if (g_pFullFileSystem != (int *)0x0) {
      pIVar4 = (IBaseFileSystem *)(g_pFullFileSystem + 1);
    }
    cVar2 = KeyValues::LoadFromFile(this_00,pIVar4,local_1020,(char *)0x0);
    if (cVar2 == '\0') {
      iVar6 = *(int *)(this + 0x554);
    }
    else {
      pcVar3 = (char *)KeyValues::GetString(this_00,"%keywords","");
      _V_strcpy(local_4120,pcVar3);
      iVar6 = *(int *)(this + 0x554);
      pcVar3 = local_4120;
LAB_00823be0:
      local_4130 = pcVar3;
      if (*local_4130 != '\0') {
        pcVar3 = local_4130;
        pcVar7 = local_4130;
        if (*local_4130 == ',') {
LAB_00823c78:
          cVar2 = pcVar7[1];
          pcVar3 = pcVar7 + 1;
          *pcVar7 = '\0';
          while ((cVar2 != '\0' && ((cVar2 == ' ' || (cVar2 == ','))))) {
            pcVar3 = pcVar3 + 1;
            cVar2 = *pcVar3;
          }
        }
        else {
          do {
            pcVar3 = pcVar3 + 1;
            cVar2 = *pcVar3;
            if (cVar2 == ',') break;
          } while (cVar2 != '\0');
          pcVar7 = pcVar3;
          if (cVar2 != '\0') goto LAB_00823c78;
        }
        if (0 < iVar6) {
          iVar5 = 0;
          do {
            iVar6 = _V_strcmp(*(char **)(*(int *)(this + 0x548) + iVar5 * 4),local_4130);
            if (iVar6 == 0) {
              iVar6 = *(int *)(this + 0x554);
              if (iVar5 < iVar6) goto LAB_00823be0;
              break;
            }
            iVar5 = iVar5 + 1;
          } while (iVar5 < *(int *)(this + 0x554));
        }
        local_4124 = ::operator_new(0x40);
        iVar6 = CUtlVector<SlideKeywordList_t*,CUtlMemory<SlideKeywordList_t*,int>>::InsertBefore
                          ((CUtlVector<SlideKeywordList_t*,CUtlMemory<SlideKeywordList_t*,int>> *)
                           (this + 0x548),*(int *)(this + 0x554),&local_4124);
        _V_strcpy(*(char **)(*(int *)(this + 0x548) + iVar6 * 4),local_4130);
        iVar6 = *(int *)(this + 0x554);
        goto LAB_00823be0;
      }
    }
    if (0 < iVar6) {
      iVar6 = 0;
      do {
        iVar5 = _V_strcmp(*(char **)(*(int *)(this + 0x548) + iVar6 * 4),"");
        if (iVar5 == 0) {
          if (iVar6 < *(int *)(this + 0x554)) goto LAB_00823b38;
          break;
        }
        iVar6 = iVar6 + 1;
      } while (iVar6 < *(int *)(this + 0x554));
    }
    local_4124 = ::operator_new(0x40);
    iVar6 = CUtlVector<SlideKeywordList_t*,CUtlMemory<SlideKeywordList_t*,int>>::InsertBefore
                      ((CUtlVector<SlideKeywordList_t*,CUtlMemory<SlideKeywordList_t*,int>> *)
                       (this + 0x548),0,&local_4124);
    _V_strcpy(*(char **)(*(int *)(this + 0x548) + iVar6 * 4),"");
LAB_00823b38:
    pcVar3 = (char *)(**(code **)(*g_pFullFileSystem + 0x74))(g_pFullFileSystem,local_4128);
  } while (pcVar3 != (char *)0x0);
  local_3020[0] = '\0';
LAB_00823b5e:
  (**(code **)(*g_pFullFileSystem + 0x7c))(g_pFullFileSystem,local_4128);
  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)