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. 4
      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 @@
#else #else
#include <limits.h> #include <limits.h>
#define MAX_PATH PATH_MAX #define MAX_PATH PATH_MAX
#define _MAX_PATH MAX_PATH
#endif #endif
#define _bool_h 1 #define _bool_h 1
#include <ministl/string> #include <ministl/string>

7
cl_dll/aghl/aghudglobal.cpp

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

2
cl_dll/aghl/agmodel.cpp

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

2
cl_dll/aghl/agmodel.h

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

4
cl_dll/aghl/agvariablechecker.cpp

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

11
cl_dll/aghl/agvariablechecker.h

@ -8,6 +8,17 @@
#ifdef AG_USE_CHEATPROTECTION #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 class AgVariableChecker
{ {
bool m_bActive; bool m_bActive;

4
cl_dll/aghl/agversioninfo.cpp

@ -1,6 +1,6 @@
#include <stdio.h> #include <stdio.h>
#ifdef AG_USE_CHEATPROTECTION #if defined(AG_USE_CHEATPROTECTION) && defined(_WIN32)
#include "AgGlobal.h" #include "AgGlobal.h"
#include "AgVersionInfo.h" #include "AgVersionInfo.h"
@ -195,4 +195,4 @@ BOOL AgVersionInfo::IsRequiredVersion(int iReqMajor, int iReqMinor, int iReqMicr
return FALSE; return FALSE;
} }
#endif //AG_USE_CHEATPROTECTION #endif //AG_USE_CHEATPROTECTION

2
cl_dll/aghl/agwallhack.cpp

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

6
cl_dll/cdll_int.cpp

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

Loading…
Cancel
Save