L L4D2node

CPlayerMove::RunPreThink

0x007c7dd0 · 1992 bytes · __thiscall

_ZN11CPlayerMove11RunPreThinkEP11CBasePlayer

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CPlayerMove::RunPreThink(CBasePlayer*) */

void __thiscall CPlayerMove::RunPreThink(CPlayerMove *this,CBasePlayer *param_1)

{
  int iVar1;
  char cVar2;
  int iVar3;
  CBasePlayer *pCVar4;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  CBasePlayer *local_1c;
  undefined4 local_18;
  undefined4 local_14;
  CBasePlayer *local_10;
  
  local_34 = 0;
  local_30 = 0;
  if (___atan2f_finite == (CBasePlayer *)0x0) {
    local_1c = (CBasePlayer *)0x0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_34,0,0,0,0,"/data/src/game/server/player_command.cpp",0xfd,
               &RunPreThink(CBasePlayer*)::tm_fmt,"(%s)%s","Unaccounted","CPlayerMove::RunPreThink")
    ;
    local_1c = ___atan2f_finite;
  }
  iVar1 = _DAT_0105db00;
  local_24 = local_34;
  local_20 = local_30;
                    /* try { // try from 007c829e to 007c82a2 has its CatchHandler @ 007c8609 */
  if (((_DAT_0105d154 != 0) || (pCVar4 = local_1c, DAT_0105d158 == '\0')) &&
     (iVar3 = ThreadGetCurrentId(), pCVar4 = ___atan2f_finite, iVar1 == iVar3)) {
    if (*(char **)_DAT_0105d15c != "CPlayerMove::RunPreThink") {
                    /* try { // try from 007c8428 to 007c8439 has its CatchHandler @ 007c8609 */
      _DAT_0105d15c =
           (CBasePlayer *)
           CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcbc4b4,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
    pCVar4 = ___atan2f_finite;
  }
  local_2c = 0;
  local_28 = 0;
  if (pCVar4 == (CBasePlayer *)0x0) {
    local_10 = (CBasePlayer *)0x0;
  }
  else {
                    /* try { // try from 007c7ef2 to 007c7ef4 has its CatchHandler @ 007c861d */
    (**(code **)(pCVar4 + 0x50))
              (pCVar4,&local_2c,0,0,0,0,"/data/src/game/server/player_command.cpp",0x100,
               &RunPreThink(CBasePlayer*)::tm_fmt,"(%s)%s","Unaccounted","player->PhysicsRunThink()"
              );
    local_10 = ___atan2f_finite;
  }
  iVar1 = _DAT_0105db00;
  local_18 = local_2c;
  local_14 = local_28;
                    /* try { // try from 007c8236 to 007c8284 has its CatchHandler @ 007c8607 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar3 = ThreadGetCurrentId(), iVar1 == iVar3)) {
    if (*(char **)_DAT_0105d15c != "player->PhysicsRunThink()") {
      _DAT_0105d15c =
           (CBasePlayer *)
           CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcbc4cd,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  pCVar4 = param_1;
                    /* try { // try from 007c7f2f to 007c7f33 has its CatchHandler @ 007c860d */
  cVar2 = CBaseEntity::PhysicsRunThink(param_1,0);
  iVar1 = _DAT_0105db00;
  if (cVar2 == '\0') {
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar3 = ThreadGetCurrentId(), iVar1 == iVar3)) {
      pCVar4 = _DAT_0105d15c;
      cVar2 = CVProfNode::ExitScope();
      if (cVar2 != '\0') {
        _DAT_0105d15c = *(CBasePlayer **)(_DAT_0105d15c + 100);
      }
      DAT_0105d158 = _DAT_0105d15c == (CBasePlayer *)0x105d160;
    }
    if (local_10 != (CBasePlayer *)0x0) {
      pCVar4 = local_10;
      (**(code **)(local_10 + 0x54))(local_10,local_18,local_14,0,0,0);
    }
    iVar1 = _DAT_0105db00;
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar3 = ThreadGetCurrentId(pCVar4), iVar1 == iVar3)) {
      cVar2 = CVProfNode::ExitScope();
      if (cVar2 != '\0') {
        _DAT_0105d15c = *(CBasePlayer **)(_DAT_0105d15c + 100);
      }
      DAT_0105d158 = _DAT_0105d15c == (CBasePlayer *)0x105d160;
    }
    if (local_1c != (CBasePlayer *)0x0) {
      (**(code **)(local_1c + 0x54))(local_1c,local_24,local_20,0,0,0);
      return;
    }
  }
  else {
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar3 = ThreadGetCurrentId(), iVar1 == iVar3)) {
      pCVar4 = _DAT_0105d15c;
      cVar2 = CVProfNode::ExitScope();
      if (cVar2 != '\0') {
        _DAT_0105d15c = *(CBasePlayer **)(_DAT_0105d15c + 100);
      }
      DAT_0105d158 = _DAT_0105d15c == (CBasePlayer *)0x105d160;
    }
    if (local_10 != (CBasePlayer *)0x0) {
      pCVar4 = local_10;
      (**(code **)(local_10 + 0x54))(local_10,local_18,local_14,0,0,0);
    }
    local_2c = 0;
    local_28 = 0;
    if (___atan2f_finite == (CBasePlayer *)0x0) {
      local_10 = (CBasePlayer *)0x0;
    }
    else {
                    /* try { // try from 007c8009 to 007c800b has its CatchHandler @ 007c861d */
      pCVar4 = ___atan2f_finite;
      (**(code **)(___atan2f_finite + 0x50))
                (___atan2f_finite,&local_2c,0,0,0,0,"/data/src/game/server/player_command.cpp",0x105
                 ,&RunPreThink(CBasePlayer*)::tm_fmt,"(%s)%s","Unaccounted",
                 "g_pGameRules->PlayerThink( player )");
      local_10 = ___atan2f_finite;
    }
    iVar1 = _DAT_0105db00;
    local_18 = local_2c;
    local_14 = local_28;
                    /* try { // try from 007c8039 to 007c803d has its CatchHandler @ 007c85db */
    if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
       (iVar3 = ThreadGetCurrentId(pCVar4), iVar1 == iVar3)) {
      if (*(char **)_DAT_0105d15c != "g_pGameRules->PlayerThink( player )") {
                    /* try { // try from 007c8570 to 007c8581 has its CatchHandler @ 007c85db */
        _DAT_0105d15c =
             (CBasePlayer *)
             CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcbc5e0,(char *)0x1,0xbfafa1);
      }
      CVProfNode::EnterScope();
      DAT_0105d158 = '\0';
    }
                    /* try { // try from 007c8054 to 007c8059 has its CatchHandler @ 007c8621 */
    pCVar4 = g_pGameRules;
    (**(code **)(*(int *)g_pGameRules + 0x114))(g_pGameRules,param_1);
    iVar1 = _DAT_0105db00;
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar3 = ThreadGetCurrentId(), iVar1 == iVar3)) {
      pCVar4 = _DAT_0105d15c;
      cVar2 = CVProfNode::ExitScope();
      if (cVar2 != '\0') {
        _DAT_0105d15c = *(CBasePlayer **)(_DAT_0105d15c + 100);
      }
      DAT_0105d158 = _DAT_0105d15c == (CBasePlayer *)0x105d160;
    }
    if (local_10 != (CBasePlayer *)0x0) {
      pCVar4 = local_10;
      (**(code **)(local_10 + 0x54))(local_10,local_18,local_14,0,0,0);
    }
    local_2c = 0;
    local_28 = 0;
    if (___atan2f_finite == (CBasePlayer *)0x0) {
      local_10 = (CBasePlayer *)0x0;
    }
    else {
                    /* try { // try from 007c8128 to 007c812a has its CatchHandler @ 007c861d */
      pCVar4 = ___atan2f_finite;
      (**(code **)(___atan2f_finite + 0x50))
                (___atan2f_finite,&local_2c,0,0,0,0,"/data/src/game/server/player_command.cpp",0x10a
                 ,&RunPreThink(CBasePlayer*)::tm_fmt,"(%s)%s","Unaccounted","player->PreThink()");
      local_10 = ___atan2f_finite;
    }
    iVar1 = _DAT_0105db00;
    local_18 = local_2c;
    local_14 = local_28;
                    /* try { // try from 007c8159 to 007c815d has its CatchHandler @ 007c8641 */
    if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
       (iVar3 = ThreadGetCurrentId(pCVar4), iVar1 == iVar3)) {
      if (*(char **)_DAT_0105d15c != "player->PreThink()") {
                    /* try { // try from 007c84f0 to 007c8501 has its CatchHandler @ 007c8641 */
        _DAT_0105d15c =
             (CBasePlayer *)
             CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcbc4e7,(char *)0x1,0xbfafa1);
      }
      CVProfNode::EnterScope();
      DAT_0105d158 = '\0';
    }
                    /* try { // try from 007c816b to 007c8170 has its CatchHandler @ 007c8631 */
    (**(code **)(*(int *)param_1 + 0x594))(param_1);
    iVar1 = _DAT_0105db00;
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar3 = ThreadGetCurrentId(), iVar1 == iVar3)) {
      param_1 = _DAT_0105d15c;
      cVar2 = CVProfNode::ExitScope();
      if (cVar2 != '\0') {
        _DAT_0105d15c = *(CBasePlayer **)(_DAT_0105d15c + 100);
      }
      DAT_0105d158 = _DAT_0105d15c == (CBasePlayer *)0x105d160;
    }
    if (local_10 != (CBasePlayer *)0x0) {
      param_1 = local_10;
      (**(code **)(local_10 + 0x54))(local_10,local_18,local_14,0,0,0);
    }
    iVar1 = _DAT_0105db00;
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar3 = ThreadGetCurrentId(param_1), iVar1 == iVar3)) {
      cVar2 = CVProfNode::ExitScope();
      if (cVar2 != '\0') {
        _DAT_0105d15c = *(CBasePlayer **)(_DAT_0105d15c + 100);
      }
      DAT_0105d158 = _DAT_0105d15c == (CBasePlayer *)0x105d160;
    }
    if (local_1c != (CBasePlayer *)0x0) {
      (**(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)