Advertisement
Guest User

Untitled

a guest
Jul 25th, 2015
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include "windows.h"
  4. #pragma comment (lib, "user32.lib")
  5.  
  6. using namespace std;
  7.  
  8. int _tmain(int argc, _TCHAR* argv[])
  9. {
  10.  
  11.  
  12. HWND MShwnd = FindWindowA("blabla", nullptr);
  13.  
  14. if (MShwnd == 0)
  15. {
  16.  
  17. cout << " Error couldn't find BLABLA" << endl;
  18.  
  19. DWORD proc_id;
  20. GetWindowThreadProcessId(MShwnd, &proc_id);
  21.  
  22. HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proc_id);
  23.  
  24. if (!hProc){
  25. cout << " Error Couldn't open process" << endl;
  26. }
  27.  
  28. else{
  29. cout << " The process Opend succsesful" << endl;
  30.  
  31. void* address = reinterpret_cast<void*>(0x6C8F05);
  32. unsigned char nops[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
  33. unsigned char orig[] = { 0x74, 0x0D, 0x8B, 0xCF, 0xE8, 0x52, 0xEA, 0xD4, 0xFF, 0x88, 0x86, 0x14, 0x01, 0x00, 0x00 };
  34.  
  35. if (orig){
  36. WriteProcessMemory(hProc, address, nops, sizeof(nops), nullptr);
  37. }
  38. else {
  39. WriteProcessMemory(hProc, address, orig, sizeof(orig), nullptr);
  40.  
  41. }
  42.  
  43. }
  44.  
  45.  
  46.  
  47. }
  48.  
  49.  
  50. cin.get();
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement