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

Strange crash when run outside of debugger on Windows 10 #15

Open
rcx opened this issue Apr 17, 2019 · 0 comments
Open

Strange crash when run outside of debugger on Windows 10 #15

rcx opened this issue Apr 17, 2019 · 0 comments

Comments

@rcx
Copy link

rcx commented Apr 17, 2019

Hello, thanks for your project. This is really great.

I'm trying to use the library on Windows 10 64-bit. Under Visual Studio's debugger or WinDbg, the program runs fine. When I run it from explorer or cmd, it crashes. To test, I am using the sample program provided, compiled with VS 2017 build tools. It also crashes when compiled with VS 2015 build tools. I tried compiling it myself and using the precompiled dll.

Interestingly, GetModuleHandle64 seems to work fine, but other functions like ReadProcessMemory64 or WriteProcessMemory64 cause a crash.

Some example code:

	printf("hello world\n");
	DWORD64 ntdll = GetModuleHandle64(L"ntdll.dll"); // OK
	printf("ntdll 64 = %llx\n", ntdll);
	HANDLE hProcess = GetCurrentProcess();
	char mem[10];
	BOOL succ = ReadProcessMemory64(hProcess, ntdll, mem, sizeof(mem), NULL); // crash

My Windows version is 10 Enterprise LTSC / 10.0.17763 Build 17763

I attached an compiled exe that is causing the crash here. This is the sample program. main.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant