|
-
Jan 10th, 2009, 05:28 AM
#1
Thread Starter
Lively Member
[RESOLVED] Get loaded modules
How can I get a list of loaded modules in my program? Example: DLL files that are loaded in my program?
I want to try and prevent DLL injection in my game, and it's not hard for someone to make a DLL and inject it into my process manually or during runtime.
-
Jan 10th, 2009, 07:41 AM
#2
Re: Get loaded modules
 Originally Posted by Daniel Elkins
How can I get a list of loaded modules in my program? Example: DLL files that are loaded in my program?
I want to try and prevent DLL injection in my game, and it's not hard for someone to make a DLL and inject it into my process manually or during runtime. 
Well Daniel there are two ways to find what dll's an app uses.
1) Open the vbp file with NotePad and look at the top where the References are stored. This will also tell you what ActiveX components are needed for the app.
2) Open each bas and cls Modules and read if there are any non standard API calls. There maybe some API calls at the top on each Form so check the code window for each Form as well.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
-
Jan 10th, 2009, 07:52 AM
#3
Thread Starter
Lively Member
Re: Get loaded modules
Thanks, Keith, but that's not quite what I mean.
For example, if my program used a function like "BitBlt" from gdi32.dll, then when my program is launched, Windows loads "gdi32.dll" into the process.
I need to know what DLL files are loaded into my program's process at runtime.
Someone can put their own DLL into my process and therefor run code inside of it, and I want to try & prevent that.
Thanks.
-
Jan 10th, 2009, 08:50 AM
#4
Re: Get loaded modules
With VB6 installation CD, there is a program called PSpy (process spy). It will list the dlls that are currently loaded. I am not sure knowing that information alone will be ideal. Different operating systems may be loading different DLLs into processes. If a user wants WindowBlinds to run, for example, that app may inject itself into every process -- per the pc owner's request. This may be true for other DLLs too.
There are ways to help determine if your application is being subclassed. That could be beneficial. But that won't detect if someone setup a global hook to trap keyboard/mouse events and possible some messaging events. What about overwriting parts of your application's actual memory, hacking?
Maybe search a bit more on anti-cheat tactics?
Last edited by LaVolpe; Jan 10th, 2009 at 08:55 AM.
-
Jan 10th, 2009, 10:12 AM
#5
Re: Get loaded modules
Have a look at this example I found on pscode.
_____________________________________________________________________
----If this post has helped you. Please take time to Rate it.
----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|