L L4D2node

BuildSpriteLoadName

0x00194920 · 427 bytes · __regparm3

_ZL19BuildSpriteLoadNamePKcPciRbS2_.constprop.131

Decompiled

undefined (5 params)

/* BuildSpriteLoadName(char const*, char*, int, bool&, bool&) [clone .constprop.131] */

void __regparm3
BuildSpriteLoadName(char *param_1,char *param_2,int param_3,bool *param_4,bool *param_5)

{
  char *pcVar1;
  int iVar2;
  int in_GS_OFFSET;
  char local_124 [260];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  pcVar1 = (char *)V_GetFileExtension(param_1);
  iVar2 = _V_stricmp(pcVar1,"avi");
  *(bool *)param_3 = iVar2 == 0;
  iVar2 = _V_stricmp(pcVar1,"bik");
  *param_4 = iVar2 == 0;
  iVar2 = _V_stricmp(pcVar1,"vmt");
  if ((((*(char *)param_3 == '\0') && (*param_4 == false)) && (iVar2 != 0)) ||
     ((pcVar1 = strchr(param_1,0x2f), pcVar1 == (char *)0x0 &&
      (pcVar1 = strchr(param_1,0x5c), pcVar1 == (char *)0x0)))) {
    V_FileBase(param_1,local_124,0x104);
    V_snprintf(param_2,0x104,"sprites/%s",local_124);
  }
  else if (iVar2 != 0) {
    V_strncpy(param_2,param_1,0x104);
  }
  else {
    pcVar1 = (char *)V_stristr(param_1,"materials/");
    if ((param_1 == pcVar1) ||
       (pcVar1 = (char *)V_stristr(param_1,"materials\\"), param_1 == pcVar1)) {
      param_1 = param_1 + 10;
    }
    V_StripExtension(param_1,param_2,0x104);
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return;
}

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)