mirror of
https://github.com/nixpal/shellsilo
synced 2026-06-06 16:24:28 +00:00
27 lines
549 B
C
27 lines
549 B
C
#include <Windows.h>
|
|
#include <iostream>
|
|
|
|
// Define necessary structures and types
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<MAIN>
|
|
{
|
|
|
|
PVOID BaseAddress = NULL;
|
|
ULONG NumberOfBytesWritten = 0;
|
|
SIZE_T RegionSize = 0x2000;
|
|
DWORD ZeroBits = 0;
|
|
HANDLE hProcess = GetCurrentProcess();
|
|
NtAllocateVirtualMemory(hProcess, &BaseAddress, ZeroBits, &RegionSize, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE)
|
|
PVOID buffer = "Hello";
|
|
ULONG NumberOfBytesToWrite = sizeof(buffer);
|
|
NtWriteVirtualMemory(hProcess, BaseAddress, buffer, NumberOfBytesToWrite, &NumberOfBytesWritten);
|
|
|
|
}
|
|
|