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 


Host process access

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Nigtronix
Cheater
Reputation: 0

Joined: 18 May 2007
Posts: 45

PostPosted: Fri May 18, 2007 8:38 pm    Post subject: Host process access Reply with quote

Hello board, I wrote a DLL injector and so far I injected custom DLL with threads that just display messageboxes. I was wondering how I can access the address space and functions of the host process that my DLL is injected into.

Any help will greatly be appreciated

Also, how does the CE "Find out what code writes to this address" work? How would you do that without CE manually?
Back to top
View user's profile Send private message
stimmedcow
How do I cheat?
Reputation: 0

Joined: 21 May 2007
Posts: 5

PostPosted: Mon May 21, 2007 10:07 pm    Post subject: Re: Host process access Reply with quote

Nigtronix wrote:
Hello board, I wrote a DLL injector and so far I injected custom DLL with threads that just display messageboxes. I was wondering how I can access the address space and functions of the host process that my DLL is injected into.


Well, you've done the hard part already, and that is getting your DLL into your target. Once you are injected into the target, you are essentially part of the process now. That means you hvae direct access to memory and functions. As for how you work with it, here are some quick examples off the top of my head that should be along the lines of what you want to do:

Let's say you have it so a function of yours is called on some event, you want to do something, then call the original function.
Code:
 
void MyFunction1()
{
   __asm
   {
      ...
      mov eax, 0x11000       // Let's say our function is at this address
      push 0                        // And it takes 1 param, some int
      call eax                      // Call function
      add esp, 4                  // Restore the stack!
      ...
}


Now, when your function is executed in the client, it will do your stuff, then go though and call the function and then continue on after the function returns.

Now, you may be asking, how do you get the client to call your function?

For that you will have to modify the client itself via assembly code to do that. You will either make the client call your function or jmp into it and back out like a code cave.

So in short, you will:
Make a DLL that contains the code you want to use in some process
Inject the DLL into that process
Patch the process to call your code and functions in your DLL

That all works because the DLL is in the process itself, you can directly access memory of the process and use functions assuming you know how to call them and what registers need to be filled with what data before so.

If you want to PM me later, I can show you how I do everything with my current toolset, I don't have it on the net because I'm redesigning it after an initial test didn't turn out quite that well (Aimed to make it generic but the users didn't quiet understand that concept).

Quote:
Also, how does the CE "Find out what code writes to this address" work? How would you do that without CE manually?


Not sure but it looks like there's a forum of source code here Wink I think they have a hardware driver that's used to tell that, can't say for sure though, didn't look at source and haven't used CE.
Back to top
View user's profile Send private message
Nigtronix
Cheater
Reputation: 0

Joined: 18 May 2007
Posts: 45

PostPosted: Wed May 23, 2007 2:28 am    Post subject: Reply with quote

Wow Thank you so much Very Happy, if you can PM me later about that I'd greatly appreciate it.

Another question? How do I get the bounds of the host process memory space. I want to use ReadProcessMemory() to scan the entire process address space.

Thanks Very Happy
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