L L4D2node

CButtonTimed::UseThink

0x00634b20 · 273 bytes · __thiscall

_ZN12CButtonTimed8UseThinkEv

Decompiled

undefined (1 param)

/* CButtonTimed::UseThink() */

void __thiscall CButtonTimed::UseThink(CButtonTimed *this)

{
  uint uVar1;
  char cVar2;
  CBasePlayer *this_00;
  int iVar3;
  CBaseEntity *this_01;
  undefined *puVar4;
  
  uVar1 = *(uint *)(this + 0x494);
  if ((((uVar1 != 0xffffffff) &&
       (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar4 + 4) != 0)) {
    this_00 = (CBasePlayer *)
              __dynamic_cast(*(int *)(puVar4 + 4),&CBaseEntity::typeinfo,&CTerrorPlayer::typeinfo,0)
    ;
    if (this_00 != (CBasePlayer *)0x0) {
      cVar2 = CBasePlayer::IsDead(this_00);
      if (cVar2 == '\0') {
        cVar2 = (**(code **)(*(int *)this_00 + 0x7e8))(this_00);
        if ((cVar2 == '\0') && (((byte)this_00[0x1cb0] & 0x20) != 0)) {
          iVar3 = CTerrorPlayer::GetCurrentUseAction((CTerrorPlayer *)this_00);
          if (iVar3 == 10) {
            this_01 = (CBaseEntity *)
                      CTerrorPlayer::GetEntityIAmPerformingActionOn((CTerrorPlayer *)this_00);
            if (this_01 == (CBaseEntity *)this) {
              if (*(float *)(gpGlobals + 0xc) <=
                  (float)*(int *)(this + 0x598) + *(float *)(this + 0x5a0)) {
                CBaseEntity::SetNextThink(this_01,*(float *)(gpGlobals + 0xc) + 0.033,(char *)0x0);
                return;
              }
                    /* WARNING: Could not recover jumptable at 0x00634c34. Too many branches */
                    /* WARNING: Treating indirect jump as call */
              (**(code **)(*(int *)this + 0x334))();
              return;
            }
          }
        }
      }
    }
  }
                    /* WARNING: Could not recover jumptable at 0x00634b69. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(*(int *)this + 0x330))();
  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)