Sign in to follow this  
Followers 0
Shyke

Detecting if DLL is in memory.

9 posts in this topic

Is there presently a way to detect if a specific DLL is loaded into the memory, if so, could someone point me in the right direction?

Share this post


Link to post
Share on other sites



Use DllCall() and the Windows API function GetModuleHandle().

Share this post


Link to post
Share on other sites

Would you give me more information/instruction for this? I'm not familliar with the DLL related functions.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Local $nHnd = 0
While $hMHnd  = 0
    $hMHnd  = _IsModuleLoaded(@SystemDir & '\User32.dll')
    Sleep(100)
WEnd

MsgBox(64, 'Info', 'Found:' & @CR & $hMHnd)

Func _IsModuleLoaded($sModule)
    Local $aGetModuleHandleAPI = DllCall('Kernel32.dll', 'ptr', 'GetModuleHandle', 'str', $sModule)
    If IsArray($aGetModuleHandleAPI) And $aGetModuleHandleAPI[0] <> 0 Then Return $aGetModuleHandleAPI[0]
    Return SetError(1,0,0)
EndFunc

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Thank-you VERY much!

Share this post


Link to post
Share on other sites

Alright, so apparently it only finds the DLL in memory if the DLL I'm trying to detect has been injected into the program. Suggestions?

Share this post


Link to post
Share on other sites

Alright, so apparently it only finds the DLL in memory if the DLL I'm trying to detect has been injected into the program. Suggestions?

O.K., so what is it you are trying to do?


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

Create a program to detect if someone is running WPE Pro to make sure they arn't cheating on a game. WPE Pro injects it's DLL into the target, I want to make it so that if it tries, it kills the process of it's target so it can't effect it.

Share this post


Link to post
Share on other sites

While I hate double posting, it is offsetted by the dire request.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0