L L4D2node

CheckNavFile

0x00719f00 · 530 bytes · __regparm3

_ZL12CheckNavFilePKc

Decompiled

undefined (1 param)

/* CheckNavFile(char const*) */

byte __regparm3 CheckNavFile(char *param_1)

{
  bool bVar1;
  byte bVar2;
  int iVar3;
  int iVar4;
  int in_GS_OFFSET;
  int local_32c;
  int local_328;
  int local_324;
  char local_320 [256];
  char local_220 [256];
  char local_120 [256];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_1 == (char *)0x0) {
LAB_0071a050:
    bVar2 = 1;
  }
  else {
    V_StripExtension(param_1,local_320,0x100);
    V_snprintf(local_220,0x100,"maps\\%s.bsp",local_320);
    V_snprintf(local_120,0x100,"maps\\%s.nav",local_320);
    iVar3 = (**(code **)(*(int *)(filesystem + 4) + 8))(filesystem + 4,local_120,"rb",&DAT_00c146f4)
    ;
    bVar1 = false;
    if (iVar3 == 0) {
      iVar3 = (**(code **)(*(int *)(filesystem + 4) + 8))(filesystem + 4,local_120,"rb","GAME");
      if (iVar3 == 0) goto LAB_0071a050;
      bVar1 = true;
    }
    iVar4 = (*(code *)**(undefined4 **)(filesystem + 4))(filesystem + 4,&local_32c,4,iVar3);
    if ((iVar4 == 0) || (local_32c != -0x1120532)) {
      (*(code *)(*(undefined4 **)(filesystem + 4))[3])(filesystem + 4,iVar3);
      bVar2 = 2;
    }
    else {
      iVar4 = (*(code *)**(undefined4 **)(filesystem + 4))(filesystem + 4,&local_328,4,iVar3);
      if ((iVar4 == 0) || (0xc < local_328 - 4U)) {
        (**(code **)(*(int *)(filesystem + 4) + 0xc))(filesystem + 4,iVar3);
        bVar2 = 3;
      }
      else {
        (*(code *)**(undefined4 **)(filesystem + 4))(filesystem + 4,&local_324,4,iVar3);
        iVar3 = (**(code **)(*(int *)(filesystem + 4) + 0x1c))(filesystem + 4,local_220,0);
        if (iVar3 == local_324) {
          bVar2 = 0;
        }
        else {
          bVar2 = -!bVar1 & 4;
        }
      }
    }
  }
  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)