Mine
public text v1 · immutableDLLAPI BOOL DllInjectEx(HANDLE hProcess, LPSTR lpszDLL, DWORD dFlags)
{
char buffer[MAX_PATH];
memset(buffer, 0, MAX_PATH);
if (dFlags & DLL_INJECT_RELATIVE) {
GetCurrentDirectory(MAX_PATH - 1 - strlen(lpszDLL), &buffer);
strcat(buffer, lpszDLL);
} else
strcpy(buffer, lpszDLL);
if (dFlags & DLL_INJECT_GETDBGPRIVS)
if (!EnableDebugPrivileges(GetCurrentProcess()))
return FALSE;
return DllInject(hProcess, buffer);
}