Advertisement
Falexom

Untitled

Mar 11th, 2022
900
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <Windows.h>
  3. using namespace std;
  4.  
  5. void bomb()
  6. {
  7.     while(1)
  8.     {
  9.         LPVOID ptr = VirtualAlloc(NULL, 300000, MEM_RESERVE, PAGE_READWRITE);
  10.         ptr = VirtualAlloc(ptr, 300000, MEM_COMMIT, PAGE_READWRITE); //commiting memory
  11.         memset(ptr, '0', 300000);
  12.         cout << "Memory is DEAD INSIDE!";
  13.     }
  14.    
  15. }
  16.  
  17. int main() {
  18.     for (int i = 1; i < 100000; ++i)
  19.     {
  20.         bomb();
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement