L L4D2node

CDownloadListGenerator::EncodeWhiteList

0x001403e0 · 626 bytes · __thiscall

_ZN22CDownloadListGenerator15EncodeWhiteListEv

Decompiled

undefined (1 param)

/* CDownloadListGenerator::EncodeWhiteList() */

void __thiscall CDownloadListGenerator::EncodeWhiteList(CDownloadListGenerator *this)

{
  byte bVar1;
  char cVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  char *pcVar7;
  int in_GS_OFFSET;
  byte bVar8;
  undefined1 local_239;
  uchar local_238 [16];
  char local_228 [260];
  byte local_124;
  undefined4 local_123;
  undefined4 local_11f;
  undefined4 local_11b;
  undefined4 local_117;
  int local_20;
  
  bVar8 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (*(int *)(this + 0x17c) != 0) {
    iVar6 = 0;
    cVar2 = IsInCoopMode();
    cVar3 = IsAddOnVPKGame(this);
    if (0 < *(int *)(this + 0x18c)) {
      do {
        iVar5 = iVar6 * 0x115 + *(int *)(this + 0x180);
        bVar1 = *(byte *)(iVar5 + 0x114);
        if ((((bVar1 & 2) != 0) && (((bVar1 & 0x10) == 0 || (cVar2 == '\0')))) &&
           (((bVar1 & 0x20) == 0 || (cVar3 == '\0')))) {
          local_123 = *(undefined4 *)(iVar5 + 0x104);
          local_11f = *(undefined4 *)(iVar5 + 0x108);
          local_11b = *(undefined4 *)(iVar5 + 0x10c);
          local_117 = *(undefined4 *)(iVar5 + 0x110);
          local_124 = bVar1;
          iVar4 = (**(code **)(**(int **)(this + 0x17c) + 0x34))(*(int **)(this + 0x17c),iVar5);
          if (iVar4 == 0xffff) {
            (**(code **)(**(int **)(this + 0x17c) + 0x24))
                      (*(int **)(this + 0x17c),1,iVar5,0x11,&local_124);
          }
          else {
            (**(code **)(**(int **)(this + 0x17c) + 0x2c))
                      (*(int **)(this + 0x17c),iVar4,0x11,&local_124);
          }
        }
        iVar6 = iVar6 + 1;
      } while (iVar6 < *(int *)(this + 0x18c));
    }
    pcVar7 = local_228;
    for (iVar6 = 0x41; iVar6 != 0; iVar6 = iVar6 + -1) {
      pcVar7[0] = '\0';
      pcVar7[1] = '\0';
      pcVar7[2] = '\0';
      pcVar7[3] = '\0';
      pcVar7 = pcVar7 + ((uint)bVar8 * -2 + 1) * 4;
    }
    GetAddonVPKName(this,local_228,0x104,(char *)(this + 0x100));
    if (local_228[0] != '\0') {
      V_snprintf((char *)&local_124,0x104,"addons/%s.vpk",local_228);
      V_FixSlashes((char *)&local_124,'/');
      local_239 = 0x92;
      cVar2 = CalculateWhiteListCRC(this,local_238,(char *)&local_124);
      if (cVar2 != '\0') {
        iVar6 = (**(code **)(**(int **)(this + 0x17c) + 0x34))(*(int **)(this + 0x17c),&local_124);
        if (iVar6 == 0xffff) {
          (**(code **)(**(int **)(this + 0x17c) + 0x24))
                    (*(int **)(this + 0x17c),1,&local_124,0x11,&local_239);
        }
        else {
          (**(code **)(**(int **)(this + 0x17c) + 0x2c))
                    (*(int **)(this + 0x17c),iVar6,0x11,&local_239);
        }
      }
    }
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)