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 


Loading your DLL with a kernel mode driver

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

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Sun Sep 23, 2012 12:20 pm    Post subject: Loading your DLL with a kernel mode driver Reply with quote

hey guys,

Recently i've been working on my driver and i've been brainstorming and testing ways on how to inject my library into a usermode application through a kernel mode driver.

Apparently, if I allocate and write my dll pathway in my process with my driver and call CreateRemoteThread it would work, but unfortunately CreateRemoteThread is hooked. I tried doing a basic hookhop to override a possible local hook on the function but it failed.

After that I decided to use PsCreateSystemThread to see if I can create a thread to loadlibrary with my kernel mode application but unfortunately, that function is only applicable for functions within the drivers address space. I would grab the address of LoadLibraryA with my usermode application and pass it to my driver, which then creates a thread but that doens't work.

So now i'm stumped with no idea on how I will inject my library. I do have access to the memory of an application and I can do a code injection on a specific function being called, and attempt to get my thread created there but there are constant CRC checks.

Can anybody help me out?
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Mon Sep 24, 2012 3:42 am    Post subject: Reply with quote

you could try hooking the timer interrupt
When it triggers and it's inside your target process adjust the stack.
Make the return address of the interrupt call point to your injected usermode code, so when iret is called by the original interrupt handler it will jump to your function instead of the original code.

To be able to return to the original state of the usermode thread that got interrupted you will need to store some data.
The best spot would be to use the usermode's ESP address and decrease it with the amount of data you're going to save. (registers, floatdata if you use it, correct return address, etc...)

Tip: Make sure your code only runs once.

It of course requires at least one active thread.

--

You could also try using APC's (again, requires a thread that is executing/awake)

_________________
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
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