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 


A wierd dll injection thechnique

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

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Nov 17, 2013 4:45 am    Post subject: A wierd dll injection thechnique Reply with quote

I recently encounter an injection method that i'v never seen..
i'll try to explain what i have figured from it
from a kernel mode driver it gets the entry of ntdll, allocates a buffer at 71b00000 and write the loading routine that uses LdrLoadDll there.
now i'm guessing it redirecting the entry of ntdll to it's loading routine?
I'm pretty confused here Confused
I don't have any code to show here, but does any of you familiar with that kind of method?

_________________
Stylo
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sun Nov 17, 2013 5:40 am    Post subject: Reply with quote

It probably gets the base of ntdll.dll to find the address of LdrLoadDll that the injected dll loader uses
_________________
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
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Nov 17, 2013 5:49 am    Post subject: Reply with quote

Well.. no
it has the address of LdrLoadDll already
and after it allocates memory for the loading routine it writes it (There's a call to ZwWriteVirtualMemory)
i believe it changes the the entry for ntdll so the loading routine will be called and then return it to it's original offset
does that make any sense?!? >_<

_________________
Stylo
Back to top
View user's profile Send private message
TsTg
Master Cheater
Reputation: 5

Joined: 12 Dec 2012
Posts: 340
Location: Somewhere....

PostPosted: Sun Nov 17, 2013 6:44 am    Post subject: Re: A wierd dll injection thechnique Reply with quote

Stylo wrote:

from a kernel mode driver it gets the entry of ntdll, allocates a buffer at 71b00000 and write the loading routine that uses LdrLoadDll there.
now i'm guessing it redirecting the entry of ntdll to it's loading routine?


so do you mean it copies the entire function LdrLoadDll to that allocated memory, then calls the copy instead of directly calling ntdll's ?

if so, are you sure that this driver is not a part of any malicious software (virus, trojan,....etc) ?, it's really weird why would it do this.
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Nov 17, 2013 7:04 am    Post subject: Reply with quote

No no no..
the loading routine contain a call to LdrLoadDll within it.
the driver copies that loading routine to the virtual memory of the desired process.
it's really wierd

@edit:
it turns out i was right Smile
the driver overwrites the entry point offset field at the PE Header of ntdll
then when ntdll is initialized and the entry point is called, the hook is called where there's a call to the original entry point
and right after that a call to LdrLoadDll.
awesome and sick at the same level Very Happy

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