L L4D2node

UpgradeToString

0x0051f8e0 · 45 bytes · __cdecl

_Z15UpgradeToString19SurvivorUpgradeType

Decompiled

undefined (1 param)

/* UpgradeToString(SurvivorUpgradeType) */

char * UpgradeToString(int param_1)

{
  int *piVar1;
  char *pcVar2;
  int *piVar3;
  
  if (param_1 == 0) {
    return "INCENDIARY_AMMO";
  }
  piVar3 = (int *)s_upgradeNames;
  do {
    pcVar2 = (char *)piVar3[2];
    if (pcVar2 == (char *)0x0) {
      return tokenset_t<SurvivorUpgradeType>::GetNameByToken(SurvivorUpgradeType)::unknown;
    }
    piVar1 = piVar3 + 3;
    piVar3 = piVar3 + 2;
  } while (param_1 != *piVar1);
  return pcVar2;
}

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)