Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <time.h>
  4. #include <cstdlib>
  5. #include <iostream>
  6. #include <windows.h>
  7. #include <WinInet.h>
  8. #include <stdio.h>
  9. #include <string.h>
  10. #include <fstream>
  11. #include <string>
  12. //0x373F14F6
  13. #define ADDR_SprBullets 0x373F14F6
  14. #define ADDR_GAMESTATUS 0x3779DF64
  15. //373F14F6 . 0F94C0 SETE AL
  16. void Memoria( void* pvAddress, const void* pvBuffer, size_t stLen )
  17. {
  18. MEMORY_BASIC_INFORMATION mbi;
  19. VirtualQuery( ( void* )pvAddress, &mbi, sizeof( mbi ) );
  20. VirtualProtect( mbi.BaseAddress, mbi.RegionSize, PAGE_EXECUTE_READWRITE, &mbi.Protect );
  21. memcpy( ( void* )pvAddress, ( void* )pvBuffer, stLen );
  22. VirtualProtect( mbi.BaseAddress, mbi.RegionSize, mbi.Protect, &mbi.Protect );
  23. FlushInstructionCache( GetCurrentProcess( ), ( void* )pvAddress, stLen );
  24. }
  25. bool IsGameReadyForHook(void)//now this is needed, it checks if Game has started or not.
  26. {
  27. if( GetModuleHandleA( "d3d9.dll" ) != NULL && GetModuleHandleA( "ClientFX.fxd" ) != NULL && GetModuleHandleA( "EhSvc.dll" ) != NULL && GetModuleHandleA( "CShell.dll" ) != NULL )
  28. return true;
  29. return false;
  30. }
  31. bool cIsIngame()
  32. {
  33. if(*(INT*)ADDR_GAMESTATUS==1){
  34. return true;
  35. }else{
  36. return false;
  37. }
  38. }
  39. bool firsthack;
  40. void MainStuff()
  41. {
  42. while(1)
  43. {
  44. if(GetAsyncKeyState(VK_NUMPAD1) &1)
  45. {
  46. firsthack = !firsthack;
  47. }
  48. if(cIsIngame() && firsthack)
  49. {
  50. Memoria((void*) ADDR_SprBullets, "\x33\xC0\x90", 3);
  51. }else{
  52. Memoria((void*) ADDR_SprBullets, "\x0F\x94\xC0", 3);
  53. }
  54. }
  55. }
  56. DWORD WINAPI HackThread()
  57. {
  58. while(!IsGameReadyForHook())
  59. {
  60. Sleep(100);
  61. }
  62. CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)MainStuff, NULL, NULL, NULL);
  63. return 1;
  64. }
  65. BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
  66. {
  67. switch (ul_reason_for_call)
  68. {
  69. case DLL_PROCESS_ATTACH:
  70. CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)HackThread, NULL, NULL, NULL);
  71. break;
  72. }
  73. return TRUE;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement