L L4D2node

GCSDK::CJobMgr::BYieldIfNeeded

0x00062e30 · 131 bytes · __thiscall

_ZN5GCSDK7CJobMgr14BYieldIfNeededERNS_4CJobEPb

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* GCSDK::CJobMgr::BYieldIfNeeded(GCSDK::CJob&, bool*) */

undefined4 __thiscall GCSDK::CJobMgr::BYieldIfNeeded(CJobMgr *this,CJob *param_1,bool *param_2)

{
  longlong lVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  
  if (param_2 != (bool *)0x0) {
    *param_2 = false;
  }
  uVar3 = rdtsc();
  lVar1 = (ulonglong)((uint)uVar3 - *(uint *)(param_1 + 0x40)) * 1000000;
  uVar3 = __udivdi3((int)lVar1,
                    (int)((ulonglong)lVar1 >> 0x20) +
                    (((int)((ulonglong)uVar3 >> 0x20) - *(int *)(param_1 + 0x44)) -
                    (uint)((uint)uVar3 < *(uint *)(param_1 + 0x40))) * 1000000,_g_ClockSpeed,
                    _RandomInt);
  if ((((int)((ulonglong)uVar3 >> 0x20) != 0) || (uVar2 = 1, 0x9c4 < (uint)uVar3)) &&
     (uVar2 = BYield(this,param_1), param_2 != (bool *)0x0)) {
    *param_2 = SUB41(uVar2,0);
  }
  return uVar2;
}

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)