kapko

Untitled

Jul 27th, 2017
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. #include <iostream>
  2. #include <Windows.h>
  3. #include <string>
  4.  
  5.  
  6. using namespace std;
  7.  
  8.  
  9. /*================|MAPY|================*/
  10.  
  11. /*======================================*/
  12.  
  13. int main() {
  14.  
  15.  
  16. HWND hWnd = FindWindowA(0, ("Transformice"));
  17. DWORD procID;
  18.  
  19.  
  20. if (hWnd)
  21. {
  22. SetWindowPos(HWND(hWnd), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
  23. SetFocus(HWND(hWnd));
  24. SetForegroundWindow(HWND(hWnd));
  25. cout << "okno wykryte" << endl;
  26. GetWindowThreadProcessId(hWnd, &procID);
  27. HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID);
  28. if (procID = NULL)
  29. {
  30. cout << "nie znaleziono adresu" << endl;
  31. }
  32. else
  33. {
  34. cout << "wszystko gra" << endl;
  35. poczatek:
  36. while (1) {
  37. int idmapy = 0x95D9194;
  38. ReadProcessMemory(handle, (LPCVOID)idmapy, &idmapy, sizeof(long), 0);
  39. cout << idmapy << endl;
  40.  
  41. if (idmapy == 50)
  42. {
  43. cout << "map50" << endl;
  44. }
  45. else if (idmapy == 10)
  46. {
  47. //while (idmapy == 10)
  48. //{
  49.  
  50.  
  51. cout << "map10" << endl;
  52. Sleep(3000);
  53. keybd_event(0x44, 0, 0, 0);
  54. cout << "prawo 7" << endl;
  55. Sleep(7000);
  56. keybd_event(0x44, 0, KEYEVENTF_KEYUP, 0);
  57. keybd_event(0x41, 0, 0, 0);
  58. cout << "lewo 7,5" << endl;
  59. Sleep(7500);
  60. keybd_event(0x41, 0, KEYEVENTF_KEYUP, 0);
  61.  
  62. while(idmapy == 10) {
  63. Sleep(1000);
  64. cout << "czekam" << endl;
  65. int idmapy = 0x95D9194;
  66. ReadProcessMemory(handle, (LPCVOID)idmapy, &idmapy, sizeof(long), 0);
  67. cout << idmapy << endl;
  68. if (idmapy != 10) { goto poczatek; }
  69. //}
  70. //else { cout << " pizda " << endl; }
  71. }
  72. /*{
  73. Sleep(1000);
  74. cout << "Czekam" << endl;
  75. ReadProcessMemory(handle, (LPCVOID)idmapy, &idmapy, sizeof(long), 0);
  76. goto poczatek;
  77. }*/
  78.  
  79. }
  80. }
  81. }
  82. }
  83. else
  84. {
  85. cout << "nie znaleziono okna" << endl;
  86.  
  87. }
  88.  
  89.  
  90.  
  91. }
Advertisement
Add Comment
Please, Sign In to add comment