Thread: Best way to inject a DLL?

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    2

    Best way to inject a DLL?

    Hello,

    I make little cheats for games like Half-Life & i'm wondering what the best way to could inject a dll into the process would be. I'm currently doing it by opening the process with OpenProcess, I allocate space for it... then i write it to process memory with WriteProcessMemory & Create the threading. Additional info can be found at MSDN http://msdn.microsoft.com/library/de..._functions.asp

    Thanks for your time & i look forward to posting here as i learn to code

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Well probably the easiest way is using CreateRemoteThread(). This only works on newer windows versions though. Also, the process needs to already be running for CreateRemoteThread() to work.

    Of course there's always the popular SetWindowsHookEx() function as well. This is helpful when you want to load your DLL into multiple processes, but it can also be used for just a single process.

    Your method of injecting DLLs works as well

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. non-MFC DLL with MFC app question.
    By Kempelen in forum Windows Programming
    Replies: 10
    Last Post: 08-20-2008, 07:11 AM
  2. Inject Dll, handle WM_PAINT...
    By asy777 in forum Windows Programming
    Replies: 10
    Last Post: 11-04-2005, 02:38 PM
  3. dll communicating between each other
    By cloudy in forum C++ Programming
    Replies: 5
    Last Post: 06-17-2005, 02:20 AM
  4. DLL and std::string woes!
    By Magos in forum C++ Programming
    Replies: 7
    Last Post: 09-08-2004, 12:34 PM
  5. .lib vs .h vs .dll
    By Shadow12345 in forum C++ Programming
    Replies: 13
    Last Post: 01-01-2003, 05:29 AM