Injecting C++ DLL
Hi guys,
so i will explain my problem, i try to inject a dll (my dll) in c++ in a process... I have create my dll injector... And that work in some process, and in other process he don't work (like notepad, and my game). So i google it, and i saw this.
But still not work... And i have run as admin... If u have some idea, or example... Thanks. Sorry for my english.
so i will explain my problem, i try to inject a dll (my dll) in c++ in a process... I have create my dll injector... And that work in some process, and in other process he don't work (like notepad, and my game). So i google it, and i saw this.
Code:
BOOL ObtenirDebugPrivileges()
{
BOOL bRET = FALSE;
TOKEN_PRIVILEGES tp;
HANDLE hToken;
if (LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &tp.Privileges[0].Luid))
{
if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken))
{
if (hToken != INVALID_HANDLE_VALUE)
{
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
tp.PrivilegeCount = 1;
if (AdjustTokenPrivileges(hToken, FALSE, &tp, 0, 0, 0))
bRET = TRUE;
CloseHandle(hToken);
}
}
}
return bRET;
}
