IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
  Reply to this topicStart new topicStart Poll

 Making a DLL loader

 
Swoorup  
Posted: Friday, May 4 2012, 17:54
Quote Post


innovator
Group Icon
Group: Members
Joined: Oct 28, 2008

au.gif

XXXXX



I need to make a DLL injector/ loader for an application. Now I would like to do this before the application actually starts, somewhat before the WinMain or main function.

I had read some articles related to it, and found that code cave is the best method for doing this. But are there any drawbacks to it? Also will the appropriate dll have to be loaded before the dll is loaded?
PMMSNYahoo
  Top
 

 
INT 03  
Posted: Thursday, May 31 2012, 12:20
Quote Post


Breakpoint
Group Icon
Group: Members
Joined: Jul 16, 2005

XXXXX



If your injector may start the application, the easiest way is probably to specify the CREATE_SUSPENDED flag when calling CreateProcess. It causes the primary thread of the process to be created in suspended state. You can then inject your DLL. Once you're done with it, resume the primary thread by using the handle returned via the process information structure to start the program.

QUOTE

Also will the appropriate dll have to be loaded before the dll is loaded?

No. When loading PE files via Windows API (e.g. LoadLibrary, CreateProcess, etc.), Windows resolves all (non-delay) imports listed in the image's import table, or refuses to load the file if it is unable to.
PM
  Top
 

 
Swoorup  
Posted: Wednesday, Jun 6 2012, 13:33
Quote Post


innovator
Group Icon
Group: Members
Joined: Oct 28, 2008

au.gif

XXXXX



Thank you! I have been doing the exact same process and have got no odds so far. I had preferred shoving ASM code into the application as the best method though.
PMMSNYahoo
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG