L L4D2node

CDownloadListGenerator::ForceExactFile

0x0013ec90 · 573 bytes · __thiscall

_ZN22CDownloadListGenerator14ForceExactFileEPKc15ConsistencyType

Decompiled

undefined (3 params)

/* CDownloadListGenerator::ForceExactFile(char const*, ConsistencyType) */

void __thiscall
CDownloadListGenerator::ForceExactFile(CDownloadListGenerator *this,char *param_1,int param_3)

{
  char cVar1;
  int iVar2;
  int in_GS_OFFSET;
  char *local_2050;
  undefined4 local_2041;
  undefined4 local_203d;
  undefined4 local_2039;
  undefined4 local_2035;
  undefined1 local_2031;
  undefined4 local_2030;
  undefined4 local_202c;
  undefined4 local_2028;
  undefined4 local_2024;
  char local_2020 [4096];
  char local_1020 [4096];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (*(int *)(this + 0x17c) == 0) goto LAB_0013ed71;
  if (1 < param_3 - 1U) {
    param_3 = 1;
  }
  iVar2 = _V_strstr(param_1,".vmt");
  if (iVar2 == 0) {
    iVar2 = _V_strstr(param_1,".vtf");
    if (iVar2 != 0) goto LAB_0013ece4;
    cVar1 = MD5_Hash_File((uchar *)&local_2041,param_1,false,(uint *)0x0);
    local_2050 = param_1;
  }
  else {
LAB_0013ece4:
    iVar2 = V_strnicmp(param_1,"materials",9);
    if (iVar2 == 0) {
      V_strncpy(local_2020,param_1,0x1000);
    }
    else {
      V_snprintf(local_2020,0x1000,"materials\\%s",param_1);
    }
    local_2050 = local_2020;
    cVar1 = MD5_Hash_File((uchar *)&local_2041,local_2050,false,(uint *)0x0);
  }
  if (cVar1 == '\x01') {
    V_strncpy(local_1020,local_2050,0x1000);
    V_FixSlashes(local_1020,'/');
    local_2031 = (undefined1)param_3;
    local_2030 = local_2041;
    local_202c = local_203d;
    local_2028 = local_2039;
    local_2024 = local_2035;
    iVar2 = (**(code **)(**(int **)(this + 0x17c) + 0x34))(*(int **)(this + 0x17c),local_1020);
    if (iVar2 == 0xffff) {
      (**(code **)(**(int **)(this + 0x17c) + 0x24))
                (*(int **)(this + 0x17c),1,local_1020,0x11,&local_2031);
    }
    else {
      (**(code **)(**(int **)(this + 0x17c) + 0x2c))(*(int **)(this + 0x17c),iVar2,0x11,&local_2031)
      ;
    }
  }
  else {
    DevWarning("Failed to CRC %s\n",param_1);
  }
LAB_0013ed71:
  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)