L L4D2node

CTakeDamageInfo::GetAmmoName

0x004c7d90 · 231 bytes · __thiscall

_ZNK15CTakeDamageInfo11GetAmmoNameEv

Decompiled

undefined (1 param)

/* CTakeDamageInfo::GetAmmoName() const */

char * __thiscall CTakeDamageInfo::GetAmmoName(CTakeDamageInfo *this)

{
  uint uVar1;
  CAmmoDef *this_00;
  undefined4 *puVar2;
  int iVar3;
  undefined *puVar4;
  int *piVar5;
  char *pcVar6;
  char *local_10;
  
  iVar3 = *(int *)(this + 0x54);
  if (-1 < iVar3) {
    this_00 = (CAmmoDef *)GetAmmoDef();
    puVar2 = (undefined4 *)CAmmoDef::GetAmmoOfIndex(this_00,iVar3);
    return (char *)*puVar2;
  }
  uVar1 = *(uint *)(this + 0x30);
  pcVar6 = "Unknown";
  if ((((uVar1 != 0xffffffff) &&
       (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar4 + 4) != 0)) {
    pcVar6 = *(char **)(*(int *)(puVar4 + 4) + 0x7c);
    if (pcVar6 == (char *)0x0) {
      pcVar6 = "";
    }
    iVar3 = _V_strcmp(pcVar6,"prop_physics");
    if (iVar3 == 0) {
      uVar1 = *(uint *)(this + 0x30);
      piVar5 = (int *)0x0;
      if (((uVar1 != 0xffffffff) &&
          (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) {
        piVar5 = *(int **)(puVar4 + 4);
      }
      (**(code **)(*piVar5 + 0x20))(&local_10,piVar5);
      if (local_10 == (char *)0x0) {
        local_10 = "";
      }
      return local_10;
    }
  }
  return pcVar6;
}

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)