Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C++ use dbk.sys for WriteProcessMemory

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
emmmre
How do I cheat?
Reputation: 0

Joined: 29 Oct 2021
Posts: 3

PostPosted: Fri Oct 29, 2021 1:57 pm    Post subject: C++ use dbk.sys for WriteProcessMemory Reply with quote

Hello,
Trying to edit memory which guarding with Game guard game.
I can't edit memory when default settings with C.E.
But When I change the Debugging Options->Use windows debugger to use kernelmode driver (Requires DBVM), I can successfully change the memory.

I want to code in C++.
WriteProcessMemory fails, GetLastError returns 5 which is ACCESS_DENIED.

So I want to use dbk32.sys (Cheat Engine's file) to write memory.

But GetProcAddress returns 0.

Need Help, Thanks.

My C++ Code:
Code:
typedef   HANDLE(__stdcall* OPfunc)(DWORD dwDesiredAccess, BOOL  bInheritHandle, DWORD dwProcessId);
typedef   bool(__stdcall* WPMfunc)(HANDLE  hProcess, LPVOID  lpBaseAddress, LPCVOID lpBuffer, SIZE_T  nSize, SIZE_T* lpNumberOfBytesWritten);


HINSTANCE ce_hDLL = LoadLibrary("C:\\Program Files\\Cheat Engine 7.3\\dbk32.sys");   
   if (ce_hDLL == NULL) { // there is no error, loads sys file successfully
      MessageBoxA(0, "Error! Couldnt Load dbk32.dll! Quiting.", "ERROR!", MB_ICONINFORMATION);
      return 7;
   }

   OPfunc OP;
   OP = (OPfunc)GetProcAddress(ce_hDLL, "OP"); // HERE IS THE FAIL. 0

         WPMfunc WPM;
   WPM = (WPMfunc)GetProcAddress(ce_hDLL, "WPM"); // THIS TOO 0
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8517
Location: 127.0.0.1

PostPosted: Fri Oct 29, 2021 5:48 pm    Post subject: Reply with quote

You do not need to open two of the same topic. Stick to the one here:
https://forum.cheatengine.org/viewtopic.php?t=618546

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites