L L4D2node

CDownloadListGenerator::AddFileToWhiteList

0x0013f6a0 · 385 bytes · __thiscall

_ZN22CDownloadListGenerator18AddFileToWhiteListEPKcPNS_17WhiteListFileDataE

Decompiled

undefined (3 params)

/* CDownloadListGenerator::AddFileToWhiteList(char const*,
   CDownloadListGenerator::WhiteListFileData*) */

void __thiscall
CDownloadListGenerator::AddFileToWhiteList
          (CDownloadListGenerator *this,char *param_1,WhiteListFileData *param_2)

{
  char cVar1;
  int iVar2;
  int in_GS_OFFSET;
  WhiteListFileData local_135 [260];
  undefined4 local_31;
  undefined4 local_2d;
  undefined4 local_29;
  undefined4 local_25;
  WhiteListFileData local_21;
  int local_20;
  
  local_21 = (WhiteListFileData)0x0;
  local_31 = 0;
  local_2d = 0;
  local_29 = 0;
  local_25 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_1 == (char *)0x0) {
    local_135[0] = (WhiteListFileData)0x0;
  }
  else {
    V_strncpy((char *)local_135,param_1,0x104);
  }
  iVar2 = CUtlVector<CDownloadListGenerator::WhiteListFileData,CUtlMemory<CDownloadListGenerator::WhiteListFileData,int>>
          ::Find((CUtlVector<CDownloadListGenerator::WhiteListFileData,CUtlMemory<CDownloadListGenerator::WhiteListFileData,int>>
                  *)(this + 0x180),local_135);
  if (iVar2 == -1) {
    cVar1 = CalculateWhiteListCRC(this,(uchar *)(param_2 + 0x104),param_1);
    if (cVar1 != '\0') {
      local_21 = (WhiteListFileData)0x0;
      if (param_2 == (WhiteListFileData *)0x0) {
        local_31 = 0;
        local_2d = 0;
        local_29 = 0;
        local_25 = 0;
      }
      else {
        local_21 = param_2[0x114];
        local_31 = *(undefined4 *)(param_2 + 0x104);
        local_2d = *(undefined4 *)(param_2 + 0x108);
        local_29 = *(undefined4 *)(param_2 + 0x10c);
        local_25 = *(undefined4 *)(param_2 + 0x110);
      }
      if (param_1 == (char *)0x0) {
        local_135[0] = (WhiteListFileData)0x0;
      }
      else {
        V_strncpy((char *)local_135,param_1,0x104);
      }
      CUtlVector<CDownloadListGenerator::WhiteListFileData,CUtlMemory<CDownloadListGenerator::WhiteListFileData,int>>
      ::InsertBefore((CUtlVector<CDownloadListGenerator::WhiteListFileData,CUtlMemory<CDownloadListGenerator::WhiteListFileData,int>>
                      *)(this + 0x180),*(int *)(this + 0x18c),local_135);
    }
  }
  else if (*(int *)(sv_show_whitelist_msg._28_4_ + 0x30) != 0) {
    Msg("Whitelist entry \'%s\' is a duplicate.\n",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)