Advertisement
Guest User

Untitled

a guest
May 28th, 2014
568
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. -----------------------------------------
  3. * Game hacking QTS ( Quickie Tip Series )
  4. * no. 28 - Printing to console in a dll
  5. -----------------------------------------
  6. * Author: SEGnosis  
  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. //----------------------------------//
  23.  
  24.  
  25. DWORD WINAPI StartUp(LPVOID lpvParam)
  26. {
  27.     AllocConsole(); // Allocate a new console
  28.     AttachConsole(GetCurrentProcessId()); // Attach it to our current process
  29.     freopen("CON", "w", stdout); // Reopen it for writing
  30.  
  31.     printf("Hello World!\n");
  32.  
  33.     return 0;
  34. }
  35.  
  36.  
  37. BOOL WINAPI DllMain(HMODULE hInstance, DWORD dwReason, LPVOID lpvReserved)
  38. {
  39.     switch(dwReason)
  40.     {
  41.         case DLL_PROCESS_ATTACH:
  42.             CreateThread(0, 0, &StartUp, 0, 0, 0);
  43.         break;
  44.     }
  45.  
  46.     return TRUE;
  47. }
  48.  
  49.  
  50. //----------------------------------//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement