vmcall / dxgkrnl_hook

C++ graphics kernel subsystem hook
481 stars 140 forks source link

Is the incomplete code on purpose? #1

Closed ghost closed 5 years ago

ghost commented 5 years ago

First of all, I appreciate this release, I was thinking about doing something like this for a while now.

// GET CONTEXT
const auto ctx = NtUserGetDc(0x00);

// DRAW TO GAME WINDOW BUFFER
NtGdiPatBlt(ctx, 15, 15, 5, 5, PATCOPY);

Are these left out of the project for any specific reason, or am I missing something?

OCT-Burnz commented 5 years ago

Just google the function names ... Easy fix

ghost commented 5 years ago

@OCT-Burnz I Found the following github repo: https://github.com/rogerorr/NtTrace

Where the following struct was defined:

BOOL
WINAPI
NtGdiPatBlt(
    __in HDC hdcDst,
    __in int x,
    __in int y,
    __in int cx,
    __in int cy,
    __in DWORD rop4
    );

WINUSERAPI
HDC
WINAPI
NtUserGetDC(
   __in_opt HWND hWnd
   );

But I'm still not sure if it's correct.

OCT-Burnz commented 5 years ago

These are just 2 functions from Win32k.sys - just implement their types and define the correct pointers to call them.

ghost commented 5 years ago

Where did you find the documentation for the structures I mentioned earlier for Win32k.sys?

And if you could tell if memeq function is just the following:

static int memeq(const void* d1, const void* d2, size_t n) {
    return memcmp(d1, d2, n) == 0;
}

And this line const auto ctx = NtUserGetDC(0x00); why did the author write 0x00?

vmcall commented 5 years ago

Some symbols are not exported, therefore requiring some manual work - this demonstration was merely ripped out of a larger project, thus the "incomplete code".

None of these issues need any information besides the basic documentation that you can find on msdn, if you are not able to assemble this, i would suggest finding a more suitable project to begin with.

vmcall commented 5 years ago

I will keep this issue open if anyone is willing to babysit.