From b42d9e910b74a4c3e28ab8df6516c1dee7b50e36 Mon Sep 17 00:00:00 2001 From: violet-devsec Date: Sat, 2 Aug 2025 01:12:41 +0100 Subject: [PATCH] Loader program added --- loader.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 loader.c diff --git a/loader.c b/loader.c new file mode 100644 index 0000000..f97c48f --- /dev/null +++ b/loader.c @@ -0,0 +1,25 @@ +#include +#include + +int main() +{ + DWORD bytesRead; + BOOL fileReadSuccess, filePermChangeSuccess, processCreateSuccess; + const TCHAR* filePath = _T("shellcode.h"); + + printf("Loader started!\n"); + printf("Shellcode path: %s\n", filePath); + + HANDLE hFile = CreateFile(filePath, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + DWORD fileSize = GetFileSize(hFile, NULL); + LPVOID fileContent = malloc(fileSize); + fileReadSuccess = ReadFile(hFile, fileContent, fileSize, &bytesRead, NULL); + + printf("Shellcode size: %d\n", fileSize); + + void *exec = VirtualAlloc(0, fileSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE); + memcpy(exec, fileContent, fileSize); + ((void(*)())exec)(); + + return 0; +} \ No newline at end of file