irwan94

Tugas c++ cheat plant vs zombie

Oct 18th, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3. #include <conio.h>
  4.  
  5.  
  6. main()
  7. {
  8. ulang:
  9. HWND cheatwindow = FindWindow(0,("Plants vs. Zombies"));
  10. HANDLE hProcess;
  11.  
  12. DWORD pid;
  13.  
  14. int matahari ;
  15. int unmatahari ;
  16. char tanya;
  17.  
  18. if(!cheatwindow){
  19. cout<<"Error , Plants vs. Zombies tidak di temukan\n\n";
  20. }
  21. else{
  22. GetWindowThreadProcessId(cheatwindow,&pid);
  23. cout<<"Di temukan plant vs zombie process:"<<pid<<"\n\n";
  24. hProcess = OpenProcess(PROCESS_ALL_ACCESS,FALSE,pid);
  25. if(!hProcess){
  26. cout<<"ERROR tidak bisa open proses\n\n";
  27. }
  28. else
  29. {
  30. cout<<"Proses terbuka \n\n";
  31. if(!ReadProcessMemory(hProcess,(void *)0x1675D6F8,(void *)&matahari,sizeof(matahari),NULL))
  32. {
  33. cout<<"error tidak bisa membaca memory \n\n";
  34. }else
  35. {
  36. cout<<"value di temukan:"<<matahari<<"\n\n";
  37. cout<<"Masukan Nilai Matahari:";cin>>unmatahari;
  38. if(!WriteProcessMemory(hProcess,(void *)0x1675D6F8,&unmatahari,(DWORD)sizeof(unmatahari),NULL))
  39. {
  40. cout<<"tidak bisa membaca memory";
  41. }
  42. else
  43. {
  44. cout<<"Nilai Matahari sekarang adalah :"<<unmatahari<<"\n\n";
  45. cout<<"Apakah mau ngecheat ulang :";cin>>tanya;
  46. system("cls");
  47.  
  48. if(tanya == 'y' || tanya == 'Y' )
  49. {
  50. goto ulang;
  51.  
  52.  
  53. }
  54. else
  55. {
  56. return(0);
  57. }
  58. }
  59.  
  60.  
  61. }
  62.  
  63.  
  64. }
  65. }
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. CloseHandle(hProcess);
  73. cout<<"tutup proses";
  74. getch();
  75. }
Advertisement
Add Comment
Please, Sign In to add comment