L L4D2node

CModelLoader::GetModelFileSize

0x0019e410 · 223 bytes · __thiscall

_ZN12CModelLoader16GetModelFileSizeEPKc

Decompiled

undefined (2 params)

/* CModelLoader::GetModelFileSize(char const*) */

undefined4 __thiscall CModelLoader::GetModelFileSize(CModelLoader *this,char *param_1)

{
  int iVar1;
  char *pcVar2;
  undefined4 uVar3;
  int in_GS_OFFSET;
  char local_114 [260];
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  if ((param_1 == (char *)0x0) || (*param_1 == '\0')) {
    uVar3 = 0xffffffff;
  }
  else {
    iVar1 = FindModel(this,param_1);
    pcVar2 = (char *)(iVar1 + 4);
    iVar1 = V_stristr(pcVar2,".spr");
    if (iVar1 == 0) {
      iVar1 = V_stristr(pcVar2,".vmt");
      if (iVar1 == 0) {
        uVar3 = COM_FileSize(param_1);
        goto LAB_0019e4ab;
      }
    }
    pcVar2 = (char *)va("materials/%s",pcVar2);
    V_StripExtension(pcVar2,local_114,0x104);
    V_DefaultExtension(local_114,".vmt",0x104);
    uVar3 = COM_FileSize(local_114);
  }
LAB_0019e4ab:
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar3;
  }
                    /* 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)