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 


Inject DLL

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Sat Jun 01, 2013 8:49 am    Post subject: Inject DLL Reply with quote

How does Cheat Engines kernel driver inject dll's? I was monitoring DbgView and I noticed that you called ZwAllocateVirtualMemory. Do you write down all the bytes of the library into the usermode app once you allocated memory with ZwAllocateVirtualMemory?

If you do so, how do you eventually "start up the dll" once its been written in memory?
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25819
Location: The netherlands

PostPosted: Sat Jun 01, 2013 10:48 am    Post subject: Reply with quote

Normally, ce just injects a dll loader into the target memory and calls CreateRemoteThread to execute the loader. (loadlibrary and some exit result handling like proccall)
But if you use the forcedinjection plugin, it will manually setup the dll's memory and adjust the pages where needed, and then call createremotethread on the entrypoint of the dll emulating a process attach

There is a currently disabled alternate method to createremotethread by use of APC's but that's disabled for now until it becomes necessary

Tip, yet another method would be to hook an often called routine (like sysenter) or set an often called page to non-executable and on hook/exception change EIP to the dll injection routine. (or directly to the dll entrypoint if you used the forced injection method)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Sun Jun 02, 2013 9:09 am    Post subject: Reply with quote

To change the EIP we would need to set a breakpoint. Is it possible to set hardware breakpoints in drivers?

Also, is sysenter a function or an opcode. i'm pretty sure I saw sysenter's in the ntdll to call the kernel
Back to top
View user's profile Send private message MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Jun 02, 2013 4:49 pm    Post subject: Reply with quote

It's an instruction to make a fast call to ring 0.
_________________
- 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 -> Cheat Engine 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