Browse Source

Fix build with cheatprotection.

aghl
Night Owl 8 years ago
parent
commit
3931dc55e7
  1. 1
      cl_dll/aghl/agglobal.h
  2. 7
      cl_dll/aghl/aghudglobal.cpp
  3. 2
      cl_dll/aghl/agmodel.cpp
  4. 2
      cl_dll/aghl/agmodel.h
  5. 4
      cl_dll/aghl/agvariablechecker.cpp
  6. 11
      cl_dll/aghl/agvariablechecker.h
  7. 2
      cl_dll/aghl/agversioninfo.cpp
  8. 2
      cl_dll/aghl/agwallhack.cpp
  9. 6
      cl_dll/cdll_int.cpp

1
cl_dll/aghl/agglobal.h

@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
#else
#include <limits.h>
#define MAX_PATH PATH_MAX
#define _MAX_PATH MAX_PATH
#endif
#define _bool_h 1
#include <ministl/string>

7
cl_dll/aghl/aghudglobal.cpp

@ -244,10 +244,9 @@ int AgHudGlobal::MsgFunc_CheatCheck(const char *pszName, int iSize, void *pbuf) @@ -244,10 +244,9 @@ int AgHudGlobal::MsgFunc_CheatCheck(const char *pszName, int iSize, void *pbuf)
AgCRC32EnforceFiles();
g_VariableChecker.Activate();
#ifdef _DEBUG
DWORD dwTime = GetTickCount();
#ifdef _DEBUG
AgLog( "Checking for spikes\n" );
#endif //_DEBUG
if (!g_ModelCheck.Check())
@ -255,7 +254,7 @@ int AgHudGlobal::MsgFunc_CheatCheck(const char *pszName, int iSize, void *pbuf) @@ -255,7 +254,7 @@ int AgHudGlobal::MsgFunc_CheatCheck(const char *pszName, int iSize, void *pbuf)
if (s_iCheckWallhack)
{
#ifdef AG_USE_CHEATPROTECTION
#if defined(AG_USE_CHEATPROTECTION) && defined(_WIN32)
#ifdef _DEBUG
AgLog( "Checking for wallhack\n" );
#endif //_DEBUG
@ -280,7 +279,7 @@ int AgHudGlobal::MsgFunc_CheatCheck(const char *pszName, int iSize, void *pbuf) @@ -280,7 +279,7 @@ int AgHudGlobal::MsgFunc_CheatCheck(const char *pszName, int iSize, void *pbuf)
int AgHudGlobal::MsgFunc_WhString(const char *pszName, int iSize, void *pbuf)
{
BEGIN_READ( pbuf, iSize );
#ifdef AG_USE_CHEATPROTECTION
#if defined(AG_USE_CHEATPROTECTION) && defined(_WIN32)
g_Wallhack.AddBadStrings(READ_STRING());
#else
READ_STRING();

2
cl_dll/aghl/agmodel.cpp

@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
#include "com_model.h"
#include "studio.h"
#include "com_weapons.h"
#include "AgModel.h"
#include "agmodel.h"
#ifdef AG_USE_CHEATPROTECTION

2
cl_dll/aghl/agmodel.h

@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
#ifdef AG_USE_CHEATPROTECTION
#include "AgGlobal.h"
#include "agglobal.h"
class AgModel
{

4
cl_dll/aghl/agvariablechecker.cpp

@ -11,8 +11,8 @@ @@ -11,8 +11,8 @@
#include "triangleapi.h"
#include "studio_util.h"
#include "r_studioint.h"
#include "AgVariableChecker.h"
#include "AgModelCheck.h"
#include "agvariablechecker.h"
#include "agmodelcheck.h"
//////////////////////////////////////////////////////////////////////

11
cl_dll/aghl/agvariablechecker.h

@ -8,6 +8,17 @@ @@ -8,6 +8,17 @@
#ifdef AG_USE_CHEATPROTECTION
#ifndef _WIN32
#include <sys/times.h>
typedef unsigned long DWORD;
static inline DWORD GetTickCount( void )
{
tms tm;
return times( &tm );
}
#endif
class AgVariableChecker
{
bool m_bActive;

2
cl_dll/aghl/agversioninfo.cpp

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
#include <stdio.h>
#ifdef AG_USE_CHEATPROTECTION
#if defined(AG_USE_CHEATPROTECTION) && defined(_WIN32)
#include "AgGlobal.h"
#include "AgVersionInfo.h"

2
cl_dll/aghl/agwallhack.cpp

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
#include "hud.h"
#include "cl_util.h"
#ifdef AG_USE_CHEATPROTECTION
#if defined(AG_USE_CHEATPROTECTION) && defined(_WIN32)
#include "AgWallhack.h"
#include "AgVersionInfo.h"

6
cl_dll/cdll_int.cpp

@ -141,7 +141,7 @@ void DLLEXPORT HUD_PlayerMove( struct playermove_s *ppmove, int server ) @@ -141,7 +141,7 @@ void DLLEXPORT HUD_PlayerMove( struct playermove_s *ppmove, int server )
PM_Move( ppmove, server );
}
#ifdef AG_USE_CHEATPROTECTION
#if defined(AG_USE_CHEATPROTECTION) && defined(_WIN32)
void* pFromModuleAddress = 0;
int DLLEXPORT Initialize_Body( cl_enginefunc_t *pEnginefuncs, int iVersion )
#else
@ -160,7 +160,7 @@ int DLLEXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion ) @@ -160,7 +160,7 @@ int DLLEXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion )
//++ BulliT
AgInitClientDll();
#ifdef AG_USE_CHEATPROTECTION
#if defined(AG_USE_CHEATPROTECTION) && defined(_WIN32)
g_Wallhack.SetHLAddressToValidate( (DWORD)pFromModuleAddress );
#endif
//-- Martin Webrant
@ -168,7 +168,7 @@ int DLLEXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion ) @@ -168,7 +168,7 @@ int DLLEXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion )
return 1;
}
#ifdef AG_USE_CHEATPROTECTION
#if defined(AG_USE_CHEATPROTECTION) && defined(_WIN32)
__declspec(naked) int Initialize( cl_enginefunc_t *pEnginefuncs, int Version )
{
__asm pop pFromModuleAddress;

Loading…
Cancel
Save