I saw this article linking to a stupid thread on neowin about 3dmark03 "cheating" and decided to 1-up it.
this program will let you cheat adjust the speed of your system clock to get whatever benchmark results you want.
Here is source:
#include <iostream>
using namespace std;
#include "stdlib.h"
#include "windows.h"
int main(int argc, char *argv[])
{
if(argc<2)
{
cout << "Usage: setClockSpeed xxx where xxx is the percentage of normal clock speed you want to run\n"
<< "Example: setClockSpeed 50 will cause your system time to update 50% of the normal amount so your system will benchmark twice as fast\n"
<< "setClockSpeed 200 will cause your system time to update at double it's normal rate so your system will benchmark twice as slow\n"
<< "setClockSpeed 100 will return the clock speed to normal\n"
<< "Decimals can be used so for example setClockSpeed 66.666 will go make the clock run about 2/3 the normal rate\n";
return 0;
}
//must first give self access to adjust time
HANDLE processHandle = GetCurrentProcess();
HANDLE tokenHandle = NULL;
if(OpenProcessToken(processHandle,TOKEN_ADJUST_PRIVILEGES,&tokenHandle)==0)
{
cout << "You don't have rights to change your own access privileges\n";
return 0;
}
LUID timeAdjustmentLUID;
LookupPrivilegeValue(NULL,SE_SYSTEMTIME_NAME,&timeAdjustmentLUID);
TOKEN_PRIVILEGES *newTokenPrivileges=(TOKEN_PRIVILEGES*)malloc(sizeof(DWORD)+sizeof(LUID_AND_ATTRIBUTES));
if(newTokenPrivileges==NULL) {
cout << "Failed to allocate new access privileges\n";
return 0;
}
newTokenPrivileges->PrivilegeCount = 1;
newTokenPrivileges->Privileges[0].Luid = timeAdjustmentLUID;
newTokenPrivileges->Privileges[0].Attributes = SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_USED_FOR_ACCESS;
if(AdjustTokenPrivileges(tokenHandle,FALSE,newTokenPrivileges,0,NULL,NULL)==0)
{
cout << "Failed to grant privileges to adjust system clock\n";
return 0;
}
free(newTokenPrivileges);
double newClockPercent = atof(argv[1]);
DWORD defaultTimeAdjustment;
DWORD defaultTimeIncrement;
BOOL adjustmentDisabled;
GetSystemTimeAdjustment(&defaultTimeAdjustment,&defaultTimeIncrement,&adjustmentDisabled);
DWORD newTimeAdjustment = newClockPercent/100.0 * defaultTimeIncrement;
cout << "default clock increment: " << defaultTimeIncrement << " new adjustment: " << newTimeAdjustment << "\n";
if(newClockPercent==100.0)
{
SetSystemTimeAdjustment(defaultTimeIncrement,TRUE);
}
else
{
if(SetSystemTimeAdjustment(newTimeAdjustment,FALSE)==0)
{
cout << "Attempt to adjust clock speed failed! GetLastError()=" << GetLastError() << "\n";
}
}
return 0;
}
Edit: added code to have the program grant itself privileges to adjust the system clock (you apparently don't have this by default even as Administrator).
this program will let you cheat adjust the speed of your system clock to get whatever benchmark results you want.
Here is source:
#include <iostream>
using namespace std;
#include "stdlib.h"
#include "windows.h"
int main(int argc, char *argv[])
{
if(argc<2)
{
cout << "Usage: setClockSpeed xxx where xxx is the percentage of normal clock speed you want to run\n"
<< "Example: setClockSpeed 50 will cause your system time to update 50% of the normal amount so your system will benchmark twice as fast\n"
<< "setClockSpeed 200 will cause your system time to update at double it's normal rate so your system will benchmark twice as slow\n"
<< "setClockSpeed 100 will return the clock speed to normal\n"
<< "Decimals can be used so for example setClockSpeed 66.666 will go make the clock run about 2/3 the normal rate\n";
return 0;
}
//must first give self access to adjust time
HANDLE processHandle = GetCurrentProcess();
HANDLE tokenHandle = NULL;
if(OpenProcessToken(processHandle,TOKEN_ADJUST_PRIVILEGES,&tokenHandle)==0)
{
cout << "You don't have rights to change your own access privileges\n";
return 0;
}
LUID timeAdjustmentLUID;
LookupPrivilegeValue(NULL,SE_SYSTEMTIME_NAME,&timeAdjustmentLUID);
TOKEN_PRIVILEGES *newTokenPrivileges=(TOKEN_PRIVILEGES*)malloc(sizeof(DWORD)+sizeof(LUID_AND_ATTRIBUTES));
if(newTokenPrivileges==NULL) {
cout << "Failed to allocate new access privileges\n";
return 0;
}
newTokenPrivileges->PrivilegeCount = 1;
newTokenPrivileges->Privileges[0].Luid = timeAdjustmentLUID;
newTokenPrivileges->Privileges[0].Attributes = SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_USED_FOR_ACCESS;
if(AdjustTokenPrivileges(tokenHandle,FALSE,newTokenPrivileges,0,NULL,NULL)==0)
{
cout << "Failed to grant privileges to adjust system clock\n";
return 0;
}
free(newTokenPrivileges);
double newClockPercent = atof(argv[1]);
DWORD defaultTimeAdjustment;
DWORD defaultTimeIncrement;
BOOL adjustmentDisabled;
GetSystemTimeAdjustment(&defaultTimeAdjustment,&defaultTimeIncrement,&adjustmentDisabled);
DWORD newTimeAdjustment = newClockPercent/100.0 * defaultTimeIncrement;
cout << "default clock increment: " << defaultTimeIncrement << " new adjustment: " << newTimeAdjustment << "\n";
if(newClockPercent==100.0)
{
SetSystemTimeAdjustment(defaultTimeIncrement,TRUE);
}
else
{
if(SetSystemTimeAdjustment(newTimeAdjustment,FALSE)==0)
{
cout << "Attempt to adjust clock speed failed! GetLastError()=" << GetLastError() << "\n";
}
}
return 0;
}
Edit: added code to have the program grant itself privileges to adjust the system clock (you apparently don't have this by default even as Administrator).