Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1. // dllmain.cpp : Defines the entry point for the DLL application.
  2. #include "stdafx.h"
  3. #include <iPowerMemory.h>
  4.  
  5. #define OFFSET_MOUSEX 0x1d7e06
  6. #define OFFSET_MOUSEY 0x1d7e0c
  7.  
  8. DWORD ecxHooked = NULL;
  9. DWORD Offset = NULL;
  10. DWORD Offset2 = NULL;
  11. DWORD jumpBack = NULL;
  12. DWORD mouseX = NULL;
  13. DWORD jumpBack2 = NULL;
  14. DWORD mouseY = NULL;
  15. DWORD jumpBack3 = NULL;
  16. DWORD jumpBack4 = NULL;
  17. DWORD esiHooked = NULL;
  18.  
  19. void _declspec(naked) Hook()
  20. {
  21. _asm
  22. {
  23. mov ecxHooked, ecx
  24. jmp jumpBack
  25. }
  26. }
  27.  
  28. void _declspec(naked) Hook2()
  29. {
  30. _asm
  31. {
  32. mov mouseX, edx
  33. jmp jumpBack2
  34. }
  35. }
  36.  
  37. void _declspec(naked) Hook3()
  38. {
  39. _asm
  40. {
  41. mov mouseY, eax
  42. jmp jumpBack3
  43. }
  44. }
  45.  
  46. void _declspec(naked) Hook4()
  47. {
  48. _asm
  49. {
  50. mov esiHooked, esi
  51. jmp jumpBack4
  52. }
  53. }
  54.  
  55. DWORD APIENTRY MainThread(LPVOID lparam)
  56. {
  57. bool Hooked = false;
  58. iPowerMemClass ipowerHack;
  59. DWORD AddressQuadradoX = NULL;
  60. DWORD AddressQuadradoY = NULL;
  61. void* AddressToHook = ipowerHack.AOB_Scan(0x2000000, 0xFFFFFFF, "\x85\x00\x0f\x84\x00\x00\x00\x00\x8b\x00\x00\x89\x00\x00\x8d\x00\x00\x00\x00\x00\x89\x00\x00\x8d\x00\x00\x8b\x00\x00\xe8\x00\x00\x00\x00\x8b\x00\x8b\x00\x00\x8b\x00\x00\x85\x00\x0f\x84\x00\x00\x00\x00\x8b\x00\x00\x66\x0f", "x?xx????x??x??x?????x??x??x??x????x?x??x??x?xx????x??xx");
  62. DWORD AddressToHook2 = (DWORD)GetModuleHandle("Adobe AIR.dll") + OFFSET_MOUSEX;
  63. DWORD AddressToHook3 = (DWORD)GetModuleHandle("Adobe AIR.dll") + OFFSET_MOUSEY;
  64. void* AddressToHook4 = ipowerHack.AOB_Scan(0x2000000, 0xFFFFFFF, "\x74\x00\x8b\x00\x00\x85\x00\x74\x00\x8b\x00\x00\x8b\x00\x00\x66\x0f\x00\x00\xf2\x0f\x00\x00\x8b\x00\x00\x66\x0f\x00\x00\xf2\x0f\x00\x00\xf2\x0f\x00\x00\x85\x00\x74\x00\x66", "x?x??x?x?x??x??xx??xx??x??xx??xx??xx??x?x?x");
  65.  
  66. if (AddressToHook != nullptr && AddressToHook2 && AddressToHook3 && AddressToHook4 != nullptr)
  67. {
  68. Offset = *(PBYTE)((DWORD)AddressToHook + 0xA);
  69. Offset2 = *(PBYTE)((DWORD)AddressToHook4 + 0xB);
  70. if (!ipowerHack.HookInstrucao((uintptr_t)AddressToHook + 0x2, (uintptr_t)Hook, 6, &jumpBack))
  71. {
  72. MessageBox(NULL, "Hook falhou!", "HackInfo", MB_OK | MB_ICONINFORMATION);
  73. return 0;
  74. }
  75. if (!ipowerHack.HookInstrucao(AddressToHook2, (uintptr_t)Hook2, 6, &jumpBack2))
  76. {
  77. MessageBox(NULL, "Hook falhou!", "HackInfo", MB_OK | MB_ICONINFORMATION);
  78. return 0;
  79. }
  80. if (!ipowerHack.HookInstrucao(AddressToHook3, (uintptr_t)Hook3, 6, &jumpBack3))
  81. {
  82. MessageBox(NULL, "Hook falhou!", "HackInfo", MB_OK | MB_ICONINFORMATION);
  83. return 0;
  84. }
  85. if (!ipowerHack.HookInstrucao((uintptr_t)AddressToHook4 + 0xC, (uintptr_t)Hook4, 7, &jumpBack4))
  86. {
  87. MessageBox(NULL, "Hook falhou!", "HackInfo", MB_OK | MB_ICONINFORMATION);
  88. return 0;
  89. }
  90. }
  91.  
  92. else
  93. {
  94. MessageBox(NULL, "ALGO NÃO FOI ENCONTRADO!", "HackInfo", MB_OK | MB_ICONINFORMATION);
  95. return 0;
  96. }
  97.  
  98. while (true)
  99. {
  100. AddressQuadradoX = ecxHooked + Offset;
  101. AddressQuadradoY = esiHooked + Offset2;
  102. char buffer[1024];
  103. sprintf_s(buffer, "%02x", AddressQuadradoY);
  104. if (GetAsyncKeyState(VK_LBUTTON))
  105. {
  106. //MessageBox(NULL, buffer, "HackInfo", MB_OK | MB_ICONINFORMATION);
  107. *(int*)AddressQuadradoX = (int)(mouseX / 81.5);
  108. *(int*)AddressQuadradoY = (int)(mouseY / 81.5) - 1;
  109. }
  110. Sleep(1);
  111. }
  112. return 0;
  113. }
  114.  
  115. BOOL APIENTRY DllMain( HMODULE hModule,
  116. DWORD ul_reason_for_call,
  117. LPVOID lpReserved
  118. )
  119. {
  120. switch (ul_reason_for_call)
  121. {
  122. case DLL_PROCESS_ATTACH:
  123. MessageBox(NULL, "Dll injetada!", "HackInfo", MB_OK | MB_ICONINFORMATION);
  124. CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)MainThread, nullptr, 0, nullptr);
  125. break;
  126. case DLL_THREAD_ATTACH:
  127. case DLL_THREAD_DETACH:
  128. case DLL_PROCESS_DETACH:
  129. break;
  130. }
  131. return TRUE;
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement