C++???dll???????????
???????????? ???????[ 2014/3/24 10:57:11 ] ????????DLL ??? ????
????DLL??????????????
?????????????£?????С??????????????????????????
????DLL????????????????????????????????????DLL?п??????????????????????
???????????
????1?????????????LoadLibrary?????????DLL???????????????CreateRemoteThread??LoadLibrary????????????????????????????????“?????????????LoadLibrary”???????
????2?????DLL??DllMain????DLL??е????????MFC??DLL??InitInstance????DLL??е????????????????????
???????
????a????????????????????????DLLMain????DLL????????MFC??DLL????InitInstance??????μ??????????????????????????????С??????????MFC??DLL????????????
????b????????????????MFC??????????DLL???????????????????MFC??DLL??
??????????
????1????DLL?????????????????????????
????2?????CreateRemoteThread??LoadLibrary???????????????????????
??????????????е????????????????????????????
??????ó???????????
// #pragma once
#include <windows.h>
#include <TlHelp32.h>
#include <iostream>
#include <time.h>
// ??????????????
bool enableDebugPriv()
{
HANDLE hToken;
LUID sedebugnameValue;
TOKEN_PRIVILEGES tkp;
if ( !OpenProcessToken( GetCurrentProcess()??
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY?? &hToken)
)
{
return false;
}
if( !LookupPrivilegeValue(NULL?? SE_DEBUG_NAME?? &sedebugnameValue) )
{
CloseHandle(hToken);
return false;
}
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Luid = sedebugnameValue;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
if( !AdjustTokenPrivileges(hToken?? FALSE?? &tkp?? sizeof(tkp)?? NULL?? NULL) )
{
CloseHandle(hToken);
return false;
}
return true;
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11