L L4D2node

V_FileBase

0x0004a340 · 234 bytes · __cdecl

_Z10V_FileBasePKcPci

Decompiled

undefined (3 params)

/* V_FileBase(char const*, char*, int) */

void V_FileBase(char *param_1,char *param_2,int param_3)

{
  char cVar1;
  char cVar2;
  size_t sVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  
  if ((param_1 == (char *)0x0) || (cVar1 = *param_1, cVar1 == '\0')) {
    *param_2 = '\0';
    return;
  }
  sVar3 = strlen(param_1);
  iVar5 = sVar3 - 1;
  iVar6 = iVar5;
  if (iVar5 == 0) {
LAB_0004a3a7:
    if (cVar1 != '.') goto LAB_0004a3b4;
    iVar4 = 0;
  }
  else {
    cVar2 = param_1[sVar3 - 1];
    iVar4 = iVar5;
    while (cVar2 != '.') {
      if (cVar2 == '/') goto LAB_0004a3b4;
      iVar4 = iVar4 + -1;
      if (iVar4 == 0) goto LAB_0004a3a7;
      cVar2 = param_1[iVar4];
    }
  }
  iVar6 = iVar4 + -1;
LAB_0004a3b4:
  if (iVar5 < 0) {
LAB_0004a3d6:
    iVar5 = 0;
  }
  else {
    cVar1 = param_1[sVar3 - 1];
    while (cVar1 != '/') {
      iVar5 = iVar5 + -1;
      if (iVar5 == -1) goto LAB_0004a3d6;
      cVar1 = param_1[iVar5];
    }
    iVar5 = iVar5 + 1;
  }
  sVar3 = (iVar6 - iVar5) + 2;
  if (param_3 < (int)sVar3) {
    sVar3 = param_3;
  }
  strncpy(param_2,param_1 + iVar5,sVar3);
  if ((int)sVar3 < 1) {
    return;
  }
  param_2[sVar3 - 1] = '\0';
  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)