L L4D2node

CBaseServer::CheckChallengeType

0x00107370 · 533 bytes · __thiscall

_ZN11CBaseServer18CheckChallengeTypeEP11CBaseClientiR8netadr_siPKci

Decompiled

undefined (7 params)

/* CBaseServer::CheckChallengeType(CBaseClient*, int, netadr_s&, int, char const*, int) */

undefined4 __thiscall
CBaseServer::CheckChallengeType
          (CBaseServer *this,CBaseClient *param_1,int param_2,netadr_s *param_3,int param_4,
          char *param_5,int param_6)

{
  char cVar1;
  CBaseClient *this_00;
  undefined4 uVar2;
  int iVar3;
  uint uVar4;
  int in_GS_OFFSET;
  netadr_s *local_44;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_4 - 1U < 3) {
    if (param_4 == 2) {
      iVar3 = _V_strlen(param_5);
      if ((iVar3 < 1) || (iVar3 = _V_strlen(param_5), iVar3 != 0x20)) {
        (**(code **)(*(int *)this + 0xc4))
                  (this,param_3,"Invalid authentication certificate length.\n");
        uVar2 = 0;
        this_00 = (CBaseClient *)this;
        param_1 = (CBaseClient *)param_3;
        goto LAB_001073bf;
      }
    }
    else if (param_4 == 3) {
      local_30 = 0;
      local_34 = 0;
      CBaseClient::SetSteamID(param_1,(CSteamID *)&local_34);
      if (param_6 - 1U < 0x7ff) {
        local_2c = *(undefined4 *)param_3;
        local_28 = *(undefined4 *)(param_3 + 4);
        local_24 = *(undefined4 *)(param_3 + 8);
        iVar3 = netadr_s::GetType(param_3);
        if ((iVar3 == 1) || (cVar1 = netadr_s::IsLocalhost(param_3), cVar1 != '\0')) {
          uVar4 = netadr_s::addr_htonl((netadr_s *)&net_local_adr);
          netadr_s::SetIP((netadr_s *)&local_2c,uVar4);
        }
        local_44 = (netadr_s *)&local_2c;
        this_00 = (CBaseClient *)Steam3Server();
        cVar1 = CSteam3Server::NotifyClientConnect
                          ((CSteam3Server *)this_00,param_1,param_2,local_44,param_5,param_6);
        if ((cVar1 == '\0') && (iVar3 = Steam3Server(), *(int *)(iVar3 + 0x98) != 1)) {
          (**(code **)(*(int *)this + 0xc4))(this,param_3,"STEAM validation rejected\n");
          uVar2 = 0;
          this_00 = (CBaseClient *)this;
          param_1 = (CBaseClient *)param_3;
        }
        else {
          uVar2 = 1;
        }
      }
      else {
        (**(code **)(*(int *)this + 0xc4))
                  (this,param_3,"STEAM certificate length error! %i/%i\n",param_6,0x800);
        uVar2 = 0;
        this_00 = (CBaseClient *)this;
        param_1 = (CBaseClient *)param_3;
      }
      goto LAB_001073bf;
    }
    this_00 = (CBaseClient *)Steam3Server();
    uVar2 = CSteam3Server::NotifyLocalClientConnect(this_00);
    if ((char)uVar2 == '\0') {
      (**(code **)(*(int *)this + 0xc4))(this,param_3,"GSCreateLocalUser failed\n");
      this_00 = (CBaseClient *)this;
      param_1 = (CBaseClient *)param_3;
    }
  }
  else {
    (**(code **)(*(int *)this + 0xc4))(this,param_3,"Invalid connection.\n");
    uVar2 = 0;
    this_00 = (CBaseClient *)this;
    param_1 = (CBaseClient *)param_3;
  }
LAB_001073bf:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail(this_00,param_1);
  }
  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)