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 


Hooking GetThreadContext ASM/Lua

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
RandName
Newbie cheater
Reputation: 0

Joined: 19 Jun 2015
Posts: 22

PostPosted: Sun Jun 26, 2016 1:15 am    Post subject: Hooking GetThreadContext ASM/Lua Reply with quote

Hey folks,

I am trying to hook GetThreadContext, so that it always returns 'clean' Context Flags (Dr0 - Dr7).
I know how to do it in C++ but I didn't manage to do the same with ASM or Lua.

This would be the C++ equivalent:
Code:

BOOL WINAPI hkGetThreadContext(
   _In_    HANDLE    hThread,
   _Inout_ LPCONTEXT lpContext
) {
   BOOL result = (*oGetThreadContext)(hThread, lpContext);
   if (lpContext) {
      lpContext->ContextFlags &= ~0x7F;
      lpContext->Dr0 = 0;
      lpContext->Dr1 = 0;
      lpContext->Dr2 = 0;
      lpContext->Dr3 = 0;
      lpContext->Dr6 = 0;
      lpContext->Dr7 = 0;
   }
   return result;
};


Does anyone of you know how to do it or alternatives with the same result?

Greetings,
Randshot
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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