Results 1 to 5 of 5

Thread: [RESOLVED] Get loaded modules

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2009
    Posts
    90

    Resolved [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.

  2. #2
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: Get loaded modules

    Quote 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.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2009
    Posts
    90

    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.

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    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
  •  



Click Here to Expand Forum to Full Width