L L4D2node

V_ExtractFilePath

0x00b7c840 · 120 bytes · __cdecl

_Z17V_ExtractFilePathPKcPci

Decompiled

undefined (3 params)

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

bool V_ExtractFilePath(char *param_1,char *param_2,int param_3)

{
  size_t sVar1;
  char *pcVar2;
  size_t sVar3;
  
  if (param_3 < 1) {
    return false;
  }
  if (param_1 != (char *)0x0) {
    sVar1 = strlen(param_1);
    sVar3 = 0;
    if (sVar1 == 0) goto LAB_00b7c887;
    for (pcVar2 = param_1 + (sVar1 - 1); param_1 != pcVar2; pcVar2 = pcVar2 + -1) {
      if (pcVar2[-1] == '/') {
        sVar3 = (int)pcVar2 - (int)param_1;
        goto LAB_00b7c887;
      }
    }
  }
  sVar3 = 0;
LAB_00b7c887:
  sVar1 = param_3 - 1U;
  if ((int)sVar3 <= (int)(param_3 - 1U)) {
    sVar1 = sVar3;
  }
  memcpy(param_2,param_1,sVar1);
  param_2[sVar1] = '\0';
  return sVar1 != 0;
}

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)