mirror of
https://github.com/toneillcodes/dll-research
synced 2026-08-09 13:13:50 +00:00
31 lines
822 B
C
31 lines
822 B
C
// cl.exe loader-test.c
|
|
#include <windows.h>
|
|
#include <stdio.h>
|
|
|
|
int main(void)
|
|
{
|
|
// Load the DLL
|
|
HMODULE hMod = LoadLibraryA("loader-notabeacon.dll");
|
|
if (!hMod) {
|
|
printf("Failed to load DLL.\n");
|
|
return 1;
|
|
}
|
|
|
|
// Resolve the reflective loader export
|
|
FARPROC pReflective = GetProcAddress(hMod, "StartReflective");
|
|
if (!pReflective) {
|
|
printf("Failed to resolve StartReflective. Error = %lu\n", GetLastError());
|
|
return 1;
|
|
}
|
|
|
|
// Call the reflective loader export
|
|
printf("[DEBUG] Calling ReflectiveLoader...\n");
|
|
((void(*)())pReflective)();
|
|
printf("[DEBUG] Returned from ReflectiveLoader.\n");
|
|
|
|
// Keep process alive to observe the agent threads
|
|
printf("Reflective loader invoked. Press Enter to exit.\n");
|
|
getchar();
|
|
|
|
return 0;
|
|
} |