L L4D2node

CreateAndValidateFileLocation<260u>

0x00b42f30 · 390 bytes · __regparm3

_Z29CreateAndValidateFileLocationILj260EEbRAT__cPKc

Decompiled

bool (2 params)

/* bool CreateAndValidateFileLocation<260u>(char (&) [260u], char const*) */

bool __regparm3 CreateAndValidateFileLocation<260u>(char *param_1,char *param_2)

{
  char cVar1;
  bool bVar2;
  int iVar3;
  int in_GS_OFFSET;
  char local_638 [260];
  char local_534 [260];
  char local_430 [260];
  char local_32c [260];
  char local_228 [260];
  char local_124 [260];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  V_MakeAbsolutePath(local_638,0x104,"ems",(char *)0x0);
  V_FixupPathName(local_32c,0x104,param_2);
  V_snprintf(local_534,0x104,"ems%c%s",0x2f,local_32c);
  V_MakeAbsolutePath(local_430,0x104,local_534,(char *)0x0);
  cVar1 = V_MakeRelativePath(local_430,local_638,local_228,0x104);
  if (cVar1 != '\0') {
    iVar3 = V_stristr(local_228,"..");
    if (iVar3 == 0) {
      V_ExtractFilePath(local_534,local_124,0x104);
      (**(code **)(*g_pFullFileSystem + 0x48))(g_pFullFileSystem,local_124,"DEFAULT_WRITE_PATH");
      V_snprintf(param_1,0x104,"ems%c%s",0x2f,local_228);
      bVar2 = true;
      goto LAB_00b4301b;
    }
  }
  Warning("Invalid file location: %s\n",local_430);
  bVar2 = false;
LAB_00b4301b:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return bVar2;
  }
                    /* 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)