Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetTickCount in program inconsistent with that in expression function #2246

Open
xujintao opened this issue Nov 10, 2019 · 0 comments

Comments

@xujintao
Copy link

@xujintao xujintao commented Nov 10, 2019

My debug program is simple, a loop call GetTickCount per second:

#include <Windows.h>
#include <stdio.h>
int main() {
	while (true) {
		DWORD dwTime = GetTickCount();
		printf("tick: (x)%04xms, (u)%ums, (u)%us\r\n", dwTime, dwTime, dwTime/1000);
		Sleep(1 * 1000);
	}
	getchar();
}

I want to compare the GetTickCount return value in my program with GetTickCount x64dbg supply in expression functions. So i prepare log text below:

[x64dbg_tick: (x){GetTickCount()}ms, (u){u:GetTickCount()}ms, (u){u:GetTickCount()/3E8}s] vs [tick: (x){eax}ms, (u){u:eax}ms, (u){u:eax/3E8}s]

logs:
image
Obviously, x64dbg's GetTickCount is correct and program's GetTickCount is wrong for it runs a time per milisecond. However, if i run program alone without a debugger, it will run per second.

  • Debugger version (Sep 1 2019, 17:35:46).
  • Operating system version and Service Pack (windows 7 64bit, sp1).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.