L L4D2node

HasZipSuffix

0x000ede30 · 259 bytes · __cdecl

_Z12HasZipSuffixPKc

Decompiled

undefined (1 param)

/* HasZipSuffix(char const*) */

bool HasZipSuffix(char *param_1)

{
  size_t sVar1;
  int iVar2;
  char *pcVar3;
  bool bVar4;
  
  sVar1 = strlen(param_1);
  pcVar3 = param_1 + sVar1;
  if ((param_1 < pcVar3) && (*pcVar3 != '.')) {
    do {
      pcVar3 = pcVar3 + -1;
      if (pcVar3 == param_1) goto LAB_000ede6c;
    } while (*pcVar3 != '.');
  }
  else if (param_1 == pcVar3) {
LAB_000ede6c:
    if (*pcVar3 != '.') {
      return false;
    }
  }
  iVar2 = _V_stricmp(pcVar3,".Z");
  if ((((iVar2 == 0) || (iVar2 = _V_stricmp(pcVar3,".zip"), iVar2 == 0)) ||
      (iVar2 = _V_stricmp(pcVar3,".zoo"), iVar2 == 0)) ||
     (((iVar2 = _V_stricmp(pcVar3,".arc"), iVar2 == 0 ||
       (iVar2 = _V_stricmp(pcVar3,".lzh"), iVar2 == 0)) ||
      ((iVar2 = _V_stricmp(pcVar3,".arj"), iVar2 == 0 ||
       (iVar2 = _V_stricmp(pcVar3,".gz"), iVar2 == 0)))))) {
    bVar4 = true;
  }
  else {
    iVar2 = _V_stricmp(pcVar3,".tgz");
    bVar4 = iVar2 == 0;
  }
  return bVar4;
}

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)