L L4D2node

ComputeModContentFilename

0x00bd6d10 · 256 bytes · __cdecl

_Z25ComputeModContentFilenamePKcPcj

Decompiled

undefined (3 params)

/* ComputeModContentFilename(char const*, char*, unsigned int) */

void ComputeModContentFilename(char *param_1,char *param_2,uint param_3)

{
  int iVar1;
  uint uVar2;
  int iVar3;
  uint uVar4;
  size_t __n;
  uint uVar5;
  
  iVar1 = V_stristr(param_1,"\\game\\");
  if (iVar1 == 0) {
    V_strncpy(param_2,param_1,param_3);
    return;
  }
  uVar2 = iVar1 - (int)param_1;
  if (uVar2 < param_3) {
    memcpy(param_2,param_1,uVar2);
    __n = param_3 - uVar2;
    if (9 < __n) {
      __n = 9;
    }
    memcpy(param_2 + uVar2,"\\content\\",__n);
    uVar5 = __n + uVar2;
    if (uVar5 != param_3) {
      iVar3 = _V_strlen(param_1);
      uVar4 = (iVar3 - uVar2) - 5;
      uVar2 = param_3 - uVar5;
      if (uVar4 <= param_3 - uVar5) {
        uVar2 = uVar4;
      }
      memcpy(param_2 + uVar5,(void *)(iVar1 + 6),uVar2);
      return;
    }
    param_2[uVar5 - 1] = '\0';
    return;
  }
  memcpy(param_2,param_1,param_3);
  param_2[param_3 - 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)