Hi, everyone.
I want to make the system time go faster. So I hook KeQueryPerformanceCounter & KeUpdateSystemTime.
But when I hook these two functions, the system become very disfluency, it means that you cannot use WINDOWS smoothly(XP and WIN7-32).
If I hook KeQueryPerformanceCounter in WIN8-32 and WIN8.1-32, the system time go faster, without any side effect (KeUpdateSystemTime is not exist on WIN8 and WIN8.1, so we don't need to hook them).
Who can tell me the reason? :D
I want to make the system time go faster. So I hook KeQueryPerformanceCounter & KeUpdateSystemTime.
But when I hook these two functions, the system become very disfluency, it means that you cannot use WINDOWS smoothly(XP and WIN7-32).
If I hook KeQueryPerformanceCounter in WIN8-32 and WIN8.1-32, the system time go faster, without any side effect (KeUpdateSystemTime is not exist on WIN8 and WIN8.1, so we don't need to hook them).
Who can tell me the reason? :D
Code: Select all
ULONG dwSpeed = 1000, dwSpeedBase = 100; //10x faster speed
LARGE_INTEGER liLastRealTime, liLastReturnTime, liTest;
NTSTATUS __fastcall Proxy_KeUpdateSystemTime(int a1, unsigned int a2, char a3)
{
NTSTATUS st;
a2=a2*(dwSpeed/dwSpeedBase);
st=Ori_KeUpdateSystemTime(a1,a2,a3);
return st;
}
LARGE_INTEGER __stdcall Proxy_KeQueryPerformanceCounter(PLARGE_INTEGER PerformanceFrequency)
{
LARGE_INTEGER liRealTime;
LARGE_INTEGER liReturnTime;
LONGLONG llMid;
liRealTime = Ori_KeQueryPerformanceCounter(PerformanceFrequency);
llMid = (liRealTime.QuadPart - liLastRealTime.QuadPart) * dwSpeed / dwSpeedBase;
liReturnTime.QuadPart = liLastReturnTime.QuadPart + llMid;
liLastRealTime.QuadPart = liRealTime.QuadPart;
liLastReturnTime.QuadPart = liReturnTime.QuadPart;
return liReturnTime;
}