Advertisement
Guest User

HadFuny freeze adress

a guest
May 31st, 2010
1,459
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. #include <windows.h>
  2.  
  3. int main()
  4. {
  5.     HWND hWnd = FindWindow(0, "Calculator");
  6.     if(hWnd == 0)
  7.     {
  8.             MessageBox(0, "Error cannot find window.", "Error", MB_OK|MB_ICONERROR);
  9.     }
  10.     else
  11.     {
  12.             DWORD proccess_ID;
  13.             GetWindowThreadProcessId(hWnd, &proccess_ID);
  14.             HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proccess_ID);
  15.             if(!hProcess)
  16.         {
  17.                 MessageBox(0, "Could not open the process!", "Error!", MB_OK|MB_ICONERROR);
  18.             }
  19.         else
  20.         {
  21.                 int newdata = 500;
  22.                 DWORD newdatasize = sizeof(newdata);
  23.             while(1);
  24.             {
  25.                     if(WriteProcessMemory(hProcess, (LPVOID)0x57C2A4, &newdata, newdatasize, NULL))
  26.                 {
  27.                        
  28.                     }
  29.                 else
  30.                 {
  31.                         MessageBox(NULL, "Error cannot WriteProcessMemory!", "Error", MB_OK + MB_ICONERROR);
  32.                     CloseHandle(hProcess);
  33.                     }
  34.                     CloseHandle(hProcess);
  35.             }
  36.             }
  37.     }
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement