Print Page | Close Window

Effective Way to Detect Speed Hacks

Printed From: Mirage Source
Category: Tutorials
Forum Name: Approved Tutorials
Forum Discription: All tutorials shown to actually work with MSE are moved here.
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=48
Printed Date: 20 December 2006 at 6:01pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: Effective Way to Detect Speed Hacks
Posted By: Sync
Subject: Effective Way to Detect Speed Hacks
Date Posted: 07 February 2006 at 6:24pm
Originally posted by Verrigan

Difficulty Easy 1/5

Many of you are aware of applications out there that cause programs to speed up.. You will find that people using these programs will actually move faster in some online games. In most cases, this causes a server to 'cater' to the faster individuals because they are sending more frequent data, which will effectively lag other players.

I could go into why these types of programs have this kind of effect on application performance, but I would be speculating.. All I know is that when you call GetTickCount or QueryPerformanceCounter functions, they will give you a higher number than the actual value on the system.. So if you do:
If GetTickCount - BeginTick > 500
it could happen in 1/10 of a second instead of 1/2 of a second. (1000 ticks from GetTickCount = 1 Second)

Well.. I have some good news for you guys. :) These applications do not have an effect on the VB Timer() function. :)

What does this mean?

This means you can check for a speed hack application, and abort your client if the user is using one. :)

How? Check your tickcounts against a timer.. First set a variable = to Timer. Then set a variable = to GetTickCount. Here is an example:
Public SpeedHackTestTimer As Long
Public SpeedHackTestTickCount As Long

Public Sub SetSpeedHackTestStart()
  SpeedHackTestTimer = Timer
  SpeedHackTestTickCount = GetTickCount
End Sub


Next, you will need a procedure to check the values against each other.. This isn't perfect, because we're comparing milliseconds against seconds, but it should be fairly close. :) Here is an example:
Public Sub SpeedHackTest()
  Dim TimerDiff As Long
  Dim TickDiff As Double
  Dim TickAndTimerDiff As Double
 
  TimerDiff = Timer - SpeedHackTestTimer
  TickDiff = (GetTickCount - SpeedHackTestTickCount)  / 1000
 
  TickAndTimerDiff = TickDiff - TimerDiff
  If TickAndTimerDiff > 1 Or TickAndTimerDiff < -1 Then
    'System is running a speed hacking program.
    'We can notify the server, or simply end the application.
    'You would need to develop a packet to send to the server
    'if you wish to notify the server.. Then keep track of the number
    'of times a user uses speed hacking software, and ban if needed. :)
    GameDestroy
  End If
End Sub



Now, this is not fully conclusive.. If 'they' develop a way to modify the Timer function's return value, you will not be able to use this method to detect speed hacking software. Please feel free to post any bugs/questions/comments/suggestions. :)



Replies:
Posted By: Sync
Date Posted: 07 February 2006 at 6:25pm
Approved




Print Page | Close Window

Bulletin Board Software by Web Wiz Forums version 8.01 - http://www.webwizforums.com
Copyright ©2001-2006 Web Wiz Guide - http://www.webwizguide.info