L L4D2node

SV_Think

0x001fea70 · 997 bytes · __cdecl

_Z8SV_Thinkb

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* SV_Think(bool) */

void SV_Think(bool param_1)

{
  int iVar1;
  char cVar2;
  int iVar3;
  char *pcVar4;
  undefined4 uVar5;
  longdouble lVar6;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  int local_1c;
  undefined4 local_18;
  undefined4 local_14;
  int local_10;
  
  local_34 = 0;
  local_30 = 0;
  if (_exit == 0) {
    local_1c = 0;
  }
  else {
    (**(code **)(_exit + 0x50))
              (_exit,&local_34,0,0,0,0,"/data/src/engine/./sv_main.cpp",0xbdf,
               &SV_Think(bool)::tm_fmt,"(%s)%s","Unaccounted","SV_Physics");
    local_1c = _exit;
  }
  iVar1 = _DAT_0040b9d4;
  local_24 = local_34;
  local_20 = local_30;
                    /* try { // try from 001fecd6 to 001fed24 has its CatchHandler @ 001fee7f */
  if (((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) &&
     (iVar3 = ThreadGetCurrentId(), iVar1 == iVar3)) {
    if ((char *)*_DAT_0040b030 != "SV_Physics") {
      _DAT_0040b030 =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2c3386,&DAT_00000001,0x2a054b);
    }
    CVProfNode::EnterScope();
    DAT_0040b02c = '\0';
  }
  local_2c = 0;
  local_28 = 0;
  if (_SetSeed == 0) {
    local_10 = 0;
  }
  else {
    pcVar4 = "simulating";
    if (!param_1) {
      pcVar4 = "not simulating";
    }
                    /* try { // try from 001feba0 to 001feba1 has its CatchHandler @ 001feeaf */
    (**(code **)(_SetSeed + 0x50))
              (_SetSeed,&local_2c,0,_VStdLib_GetICVarFactory,0,0,"/data/src/engine/./sv_main.cpp",
               0xbe1,&SV_Think(bool)::tm_fmt,"SV_Think(%s)",pcVar4);
    local_10 = _SetSeed;
  }
  local_18 = local_2c;
  local_14 = local_28;
                    /* try { // try from 001febc7 to 001fec37 has its CatchHandler @ 001fee94 */
  if ((DAT_003b8088 != '\0') &&
     (CGameServer::UpdateReservedState((CGameServer *)&sv), DAT_003e52d9 != '\0')) {
                    /* try { // try from 001fed6b to 001fed6f has its CatchHandler @ 001fee94 */
    NET_SleepUntilMessages(*(int *)(sv_hibernate_ms._28_4_ + 0x30));
    if (local_10 != 0) {
      (**(code **)(local_10 + 0x54))(local_10,local_18,local_14,0,0,0);
    }
    iVar1 = _DAT_0040b9d4;
    if (((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) &&
       (iVar3 = ThreadGetCurrentId(), iVar1 == iVar3)) {
      cVar2 = CVProfNode::ExitScope();
      if (cVar2 != '\0') {
        _DAT_0040b030 = (int *)_DAT_0040b030[0x19];
      }
      DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
    }
    if (local_1c == 0) {
      return;
    }
    (**(code **)(local_1c + 0x54))(local_1c,local_24,local_20,0,0,0);
    return;
  }
  g_ServerGlobalVariables._24_4_ = DAT_003b7f6c;
  lVar6 = (longdouble)CBaseServer::GetTime((CBaseServer *)&sv);
  g_ServerGlobalVariables._12_4_ = (undefined4)lVar6;
  if (param_1) {
    uVar5 = 1;
    g_ServerGlobalVariables._16_4_ = DAT_003a1730;
    if (1 < DAT_003b8064) goto LAB_001fec27;
  }
  else {
    g_ServerGlobalVariables._16_4_ = 0;
  }
  uVar5 = 0;
LAB_001fec27:
  (**(code **)(*(int *)g_pServerPluginHandler + 0x14))(g_pServerPluginHandler,uVar5);
  if (local_10 != 0) {
    (**(code **)(local_10 + 0x54))(local_10,local_18,local_14,0,0,0);
  }
  iVar1 = _DAT_0040b9d4;
  if (((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) &&
     (iVar3 = ThreadGetCurrentId(), iVar1 == iVar3)) {
    cVar2 = CVProfNode::ExitScope();
    if (cVar2 != '\0') {
      _DAT_0040b030 = (int *)_DAT_0040b030[0x19];
    }
    DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
  }
  if (local_1c != 0) {
    (**(code **)(local_1c + 0x54))(local_1c,local_24,local_20,0,0,0);
  }
  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)