Guest User

Madobu hack

a guest
Jun 27th, 2019
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.48 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <Windows.h>
  4.  
  5.  
  6. void leftclick();
  7. int main()
  8. {
  9.     LPCWSTR window_title = L"SM-G920F";
  10.     HWND hWND = FindWindow(NULL, window_title);
  11.     while (hWND == NULL) {
  12.         hWND = FindWindow(NULL, window_title);
  13.         std::cout<<"No window detected."<<std::endl;
  14.     }
  15.     while (true) {
  16.         Sleep(10);
  17.        
  18.         if (GetAsyncKeyState(VK_UP)) {
  19.            
  20.             leftclick();
  21.            
  22.         }
  23.         if (GetAsyncKeyState('C')) {
  24.             HDC hDC = GetDC(hWND);
  25.             POINT p;
  26.             GetCursorPos(&p);
  27.             ScreenToClient(hWND, &p);
  28.             std::cout << "X= " << p.x << " Y= " << p.y << std::endl;
  29.             COLORREF color1 = GetPixel(hDC, 1240, 475); //find yourself the correct x and y
  30.             //std::cout << color1 << std::endl;
  31.             std::cout << "Red1: "<< (int)GetRValue(color1) << std::endl;
  32.             COLORREF color2 = GetPixel(hDC, 1320, 475);//find yourself the correct x and y
  33.             //std::cout << color2 << std::endl;
  34.             std::cout << "Red2: " << (int)GetRValue(color2) << std::endl;
  35.  
  36.             if ((int)GetRValue(color1)>=250 || (int)GetRValue(color2) >=250) leftclick();
  37.             ReleaseDC(hWND, hDC);
  38.        
  39.         }
  40.         if (GetAsyncKeyState('Q')) return 0;
  41.  
  42.     }
  43. }
  44.  
  45. void leftclick() {
  46.     std::cout << "Clicked!" << std::endl;
  47.     INPUT iNPUT = { 0 };
  48.     iNPUT.type = INPUT_MOUSE;
  49.     iNPUT.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
  50.     iNPUT.mi.mouseData =
  51.     SendInput(1, &iNPUT, sizeof(iNPUT));
  52.     ZeroMemory(&iNPUT, sizeof(iNPUT));
  53.     iNPUT.type = INPUT_MOUSE;
  54.     iNPUT.mi.dwFlags = MOUSEEVENTF_LEFTUP;
  55.     SendInput(1, &iNPUT, sizeof(iNPUT));
  56.     Sleep(120);
  57.  
  58.  
  59. }
Add Comment
Please, Sign In to add comment