L L4D2node

CNetChan::IsValidFileForTransfer

0x001b2820 · 1481 bytes · __regparm3

_ZN8CNetChan22IsValidFileForTransferEPKc.part.60

Decompiled

undefined (1 param)

/* WARNING: Type propagation algorithm not settling */
/* CNetChan::IsValidFileForTransfer(char const*) [clone .part.60] */

bool __regparm3 CNetChan::IsValidFileForTransfer(char *param_1)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  char **ppcVar4;
  char *pcVar5;
  int in_GS_OFFSET;
  bool bVar6;
  char *local_254 [8];
  undefined4 local_234;
  char acStack_231 [261];
  CFmtStrN<256> local_12c [5];
  char local_127 [263];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar2 = _V_strlen(param_1);
  if (iVar2 < 0x104) {
    pcVar3 = (char *)((int)register0x00000010 + 0xfffffdcf) + 1;
    V_strncpy(pcVar3,param_1,0x104);
    V_FixSlashes(pcVar3,'/');
    V_FixDoubleSlashes(pcVar3);
    if (((char *)((int)register0x00000010 + -0x231))[iVar2] != '/') {
      if (acStack_231[1] != '\0') {
        iVar2 = 0;
        ppcVar4 = (char **)pcVar3;
        do {
          ppcVar4 = (char **)((int)ppcVar4 + 1);
          iVar2 = iVar2 + (uint)(acStack_231[1] == '/');
          acStack_231[1] = *(char *)ppcVar4;
        } while (acStack_231[1] != '\0');
        if (0x1f < iVar2) goto LAB_001b284a;
      }
      cVar1 = Q_RemoveAllEvilCharacters(pcVar3);
      if (cVar1 == '\0') {
        ppcVar4 = local_254;
        pcVar5 = "lua";
        local_254[0] = "modes";
        local_254[1] = "missions";
        local_254[2] = "addons";
        local_254[3] = "scripts";
        local_254[4] = "vscripts";
        local_254[5] = "save";
        local_254[6] = "cfg";
        local_254[7] = "ems";
        local_234 = &DAT_002bb071;
        while( true ) {
          CFmtStrN<256>::CFmtStrN(local_12c,"%s/",pcVar5);
          iVar2 = V_stristr(pcVar3,local_127);
          if (iVar2 != 0) break;
          CFmtStrN<256>::CFmtStrN(local_12c,"%s./",pcVar5);
          iVar2 = V_stristr(pcVar3,local_127);
          if (iVar2 != 0) break;
          if (ppcVar4 == (char **)pcVar3) {
            iVar2 = V_stristr(pcVar3,"./././");
            bVar6 = false;
            if (((((((((iVar2 != 0) || (iVar2 = V_stristr(pcVar3,"   "), iVar2 != 0)) ||
                     (iVar2 = V_stristr(pcVar3,"\t"), iVar2 != 0)) ||
                    (((iVar2 = V_stristr(pcVar3,".cfg"), iVar2 != 0 ||
                      (iVar2 = V_stristr(pcVar3,".lst"), iVar2 != 0)) ||
                     ((iVar2 = V_stristr(pcVar3,".exe"), iVar2 != 0 ||
                      ((iVar2 = V_stristr(pcVar3,".pif"), iVar2 != 0 ||
                       (iVar2 = V_stristr(pcVar3,".vbs"), iVar2 != 0)))))))) ||
                   (iVar2 = V_stristr(pcVar3,".com"), iVar2 != 0)) ||
                  ((((iVar2 = V_stristr(pcVar3,".bat"), iVar2 != 0 ||
                     (iVar2 = V_stristr(pcVar3,".cmd"), iVar2 != 0)) ||
                    (iVar2 = V_stristr(pcVar3,".dll"), iVar2 != 0)) ||
                   ((iVar2 = V_stristr(pcVar3,".so"), iVar2 != 0 ||
                    (iVar2 = V_stristr(pcVar3,".dylib"), iVar2 != 0)))))) ||
                 (((iVar2 = V_stristr(pcVar3,".ini"), iVar2 != 0 ||
                   ((iVar2 = V_stristr(pcVar3,".log"), iVar2 != 0 ||
                    (iVar2 = V_stristr(pcVar3,".lua"), iVar2 != 0)))) ||
                  (iVar2 = V_stristr(pcVar3,".vdf"), iVar2 != 0)))) ||
                (((iVar2 = V_stristr(pcVar3,".smx"), iVar2 != 0 ||
                  (iVar2 = V_stristr(pcVar3,".flt"), iVar2 != 0)) ||
                 (iVar2 = V_stristr(pcVar3,".mix"), iVar2 != 0)))) ||
               ((((iVar2 = V_stristr(pcVar3,".asi"), iVar2 != 0 ||
                  (iVar2 = V_stristr(pcVar3,".gcf"), iVar2 != 0)) ||
                 ((iVar2 = V_stristr(pcVar3,".lmp"), iVar2 != 0 ||
                  ((iVar2 = V_stristr(pcVar3,".sys"), iVar2 != 0 ||
                   (iVar2 = V_stristr(pcVar3,".hta"), iVar2 != 0)))))) ||
                ((iVar2 = V_stristr(pcVar3,".zip"), iVar2 != 0 ||
                 ((((iVar2 = V_stristr(pcVar3,".nut"), iVar2 != 0 ||
                    (iVar2 = V_stristr(pcVar3,".nuc"), iVar2 != 0)) ||
                   (iVar2 = V_stristr(pcVar3,".bsp"), iVar2 != 0)) ||
                  ((iVar2 = V_stristr(pcVar3,".res"), iVar2 != 0 ||
                   (iVar2 = V_stristr(pcVar3,".vpk"), iVar2 != 0)))))))))) goto LAB_001b284c;
            iVar2 = V_stristr(pcVar3,"_level_sounds");
            if ((iVar2 == 0) &&
               ((iVar2 = V_stristr(pcVar3,"_commentary"), iVar2 == 0 &&
                (iVar2 = V_stristr(pcVar3,"addonlist"), iVar2 == 0)))) {
              ppcVar4 = (char **)strrchr(pcVar3,0x2f);
              if (ppcVar4 == (char **)0x0) {
                ppcVar4 = (char **)pcVar3;
              }
              pcVar3 = strchr((char *)ppcVar4,0x2e);
              if ((pcVar3 != (char *)0x0) &&
                 (((((iVar2 = _V_strlen(pcVar3), iVar2 - 3U < 2 ||
                     (iVar2 = _V_stricmp(pcVar3,".bsp.bz2"), iVar2 == 0)) ||
                    (iVar2 = _V_stricmp(pcVar3,".xbox.vtx"), iVar2 == 0)) ||
                   ((iVar2 = _V_stricmp(pcVar3,".dx80.vtx"), iVar2 == 0 ||
                    (iVar2 = _V_stricmp(pcVar3,".dx90.vtx"), iVar2 == 0)))) ||
                  (iVar2 = _V_stricmp(pcVar3,".sw.vtx"), iVar2 == 0)))) {
                pcVar3 = strchr(pcVar3,0x20);
                bVar6 = pcVar3 == (char *)0x0;
                goto LAB_001b284c;
              }
            }
            break;
          }
          pcVar5 = *ppcVar4;
          ppcVar4 = ppcVar4 + 1;
        }
      }
    }
  }
LAB_001b284a:
  bVar6 = false;
LAB_001b284c:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return bVar6;
}

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)