L L4D2node

FixupModelName

0x00497ec0 · 244 bytes · __regparm3

_ZL14FixupModelNamePciPKc.constprop.86

Decompiled

undefined (3 params)

/* FixupModelName(char*, int, char const*) [clone .constprop.86] */

char * __regparm3 FixupModelName(char *param_1,int param_2,char *param_3)

{
  int iVar1;
  int in_GS_OFFSET;
  char local_410 [1024];
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  V_strncpy(local_410,(char *)param_2,0x400);
  iVar1 = V_strnicmp(local_410,"models/",7);
  if (iVar1 == 0) {
    V_strncpy(param_1,local_410,0x200);
    iVar1 = _V_strlen(param_1);
  }
  else {
    V_snprintf(param_1,0x200,"models/%s",local_410);
    iVar1 = _V_strlen(param_1);
  }
  if ((iVar1 < 4) || (iVar1 = _V_stricmp(param_1 + iVar1 + -4,".mdl"), iVar1 != 0)) {
    V_strncat(param_1,".mdl",0x200,-1);
  }
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return param_1;
  }
                    /* 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)