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 


Read value from memory with a dll pointer

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

Joined: 04 Dec 2015
Posts: 1

PostPosted: Tue Jan 05, 2016 11:30 pm    Post subject: Read value from memory with a dll pointer Reply with quote

Hi there,

First of all I want to say sorry because I don't know at all what I need to do what I'm looking for and maybe I'll post something nosense.

Well, what I'm looking for is just to read a value stored into the memory by a game, I don't want add nothing or modify it, just read it..
The point is that this game use a DLL thats seems to have a pointer (I think) to this value but I don't know how I can use it, I spent many days searching over the internet and I think that I should hook the DLL to have access to such code but I'm not sure about this, by the way I found the code for the same game and also to do exactly what I need but is on C++ and I need it on C# and I'm unable to "convert" it.

Here are some parts of the code I found, lets see if someone can guide me over the question:


Note: "?GetNickName@User@@QAEPAGXZ" is the pointer located inside the game DLL.

Code:

User_fn8 ptrUser::ptrFun8 = NULL;
static HINSTANCE ptrUser_h_Instance;
//END DATA

void User::Hook() //BEGIN HOOK
{
   ptrUser_h_Instance = GetModuleHandle(TEXT("engine.dll"));

   MAKE_POINTER(ptrUser_h_Instance, ptrUser::ptrFun8, User_fn8, "?GetNickName@User@@QAEPAGXZ");
   HOOK_FUNC(ptrUser_h_Instance, "?GetNickName@User@@QAEPAGXZ", &User::OnCalled_GetNickName, ptrUser::ptrFun8);
}//END HOOK

void User::UnHook() //BEGIN UNHOOK
{
   UNHOOK_FUNC(ptrUser_h_Instance, "?GetNickName@User@@QAEPAGXZ", &User::OnCalled_GetNickName, ptrUser::ptrFun8);
} //END UNHOOK

unsigned short * User::OnCalled_GetNickName(void) //BEGIN EVENT: unsigned short * User::GetNickName(void)
{
   CHECK_THIS
   //Put your code here
   unsigned short * retval = NULL;
   if ( TITLE->GetTitle ( this, retval ) )
   {
      return retval;
   }
   return GetNickName();
} //END EVENT: unsigned short * User::GetNickName(void)


I'll thank any kind of help!
Back to top
View user's profile Send private message
WhoKnowsYes
How do I cheat?
Reputation: 0

Joined: 30 Jan 2017
Posts: 1

PostPosted: Mon Jan 30, 2017 1:50 am    Post subject: Reply with quote

I'm trying something very similar, any idea?
Back to top
View user's profile Send private message
ulysse31
Master Cheater
Reputation: 2

Joined: 19 Mar 2015
Posts: 324
Location: Paris

PostPosted: Mon Jan 30, 2017 2:23 pm    Post subject: Reply with quote

WhoKnowsYes wrote:
I'm trying something very similar, any idea?

Start your own thread, be specific on your needs (not "something much like this"). This thread is bad in every way and is much less likely to receive an answer than a clean thread containing a single well asked question
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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