L L4D2node

CDownloadListGenerator::VerifyCriticalFiles

0x0013e4d0 · 325 bytes · __thiscall

_ZN22CDownloadListGenerator19VerifyCriticalFilesEPci

Decompiled

undefined (3 params)

/* CDownloadListGenerator::VerifyCriticalFiles(char*, int) */

void __thiscall
CDownloadListGenerator::VerifyCriticalFiles(CDownloadListGenerator *this,char *param_1,int param_2)

{
  char cVar1;
  int iVar2;
  int iVar3;
  CDownloadListGenerator *pCVar4;
  int in_GS_OFFSET;
  CDownloadListGenerator *pCVar5;
  char *pcVar6;
  int local_40;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  iVar3 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  pCVar5 = this;
  EnsureCRCFilePath();
  local_40 = 0;
  if (0 < *(int *)(this + 0x1a0)) {
    do {
      pCVar4 = (CDownloadListGenerator *)(*(int *)(this + 0x194) + iVar3);
      cVar1 = (**(code **)(*(int *)(g_pFileSystem + 4) + 0x28))
                        (g_pFileSystem + 4,pCVar4,"GAME_ROOT");
      if (cVar1 == '\0') {
        pCVar5 = pCVar4;
        iVar2 = V_stristr((char *)pCVar4,"pak02_dir.vpk");
        if ((iVar2 == 0) && (iVar2 = GetSteamUniverse(), iVar2 != 2)) {
          pcVar6 = "File %s was not found.\n";
          goto LAB_0013e5d1;
        }
      }
      else {
        local_30 = 0;
        local_2c = 0;
        local_28 = 0;
        local_24 = 0;
        CalculateWhiteListCRC(this,(uchar *)&local_30,(char *)pCVar4);
        pCVar5 = (CDownloadListGenerator *)&local_30;
        iVar2 = _V_memcmp(pCVar5,(void *)(*(int *)(this + 0x194) + iVar3 + 0x104),0x10);
        if (iVar2 != 0) {
          pcVar6 = "File %s is not allowed to be modified.\n";
LAB_0013e5d1:
          V_snprintf(param_1,param_2,pcVar6,pCVar4);
          pCVar5 = (CDownloadListGenerator *)param_1;
          break;
        }
      }
      local_40 = local_40 + 1;
      iVar3 = iVar3 + 0x115;
    } while (local_40 < *(int *)(this + 0x1a0));
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail(pCVar5);
  }
  return;
}

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)