Advertisement
Guest User

QTS no. 2 - How to attain the injector's location

a guest
Jun 13th, 2010
696
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.49 KB | None | 0 0
  1. /*
  2. -----------------------------------------
  3. * Game hacking QTS ( Quickie Tip Series )
  4. * no. 2 - How to attain the injector's location
  5. -----------------------------------------
  6. * Author: SEGnosis  - GHAnon.net
  7. * Thanks to:
  8. * bitterbanana      - No known site
  9. * Drunken Cheetah   - No known site
  10. * fatboy88      - No known site
  11. * Geek4Ever         - No known site
  12. * learn_more        - www.uc-forum.com
  13. * Novocaine         - http://ilsken.net/blog/?page_id=64
  14. * Philly0494        - No known site
  15. * Roverturbo        - www.uc-forum.com
  16. * SilentKarma       - www.halocoders.com - offline
  17. * Strife        - www.uc-forum.com
  18. * Wieter20      - No known site
  19. */
  20.  
  21. //----------------------------------//
  22. BOOL WINAPI DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpvReserved )
  23. {
  24.     switch( dwReason )
  25.     {
  26.         case DLL_PROCESS_ATTACH:
  27.             char szString[ MAX_PATH ]; // Create a character array buffer with the maximum path length ( besides unicode )
  28.            
  29.             GetModuleFileName( hModule, szString, sizeof( szString ) ); // This function uses the module handle to input the module file path into the string array ie. "C:\\foo\\fee\\module.exe".
  30.  
  31.             // The file path will be that of the injector, not the current process.
  32.             // If you wish to get the file location of the executable; you can set the parameter for HMODULE to null and it will use the module handle of the current executable. This can save time if you aren't looking into getting the file path from within DllMain.
  33.  
  34.         break;
  35.     }
  36.  
  37.     return TRUE;
  38. }
  39. //----------------------------------//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement