和InjectFile配套InjectDLL
// InjectDLL.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include "InjectDLL.h"
// This is an example of an exported variable
INJECTDLL_API int nInjectDLL=0;
// This is an example of an exported function.
INJECTDLL_API int fnInjectDLL(void)
{
return 42;
}
// This is the constructor of a class that has been exported.
// see InjectDLL.h for the class definition
CInjectDLL::CInjectDLL()
{
return;
}
// include区
#include <iostream>
#include <ctime>
using namespace std;
// DLL文件
//变量定义区
const int g_offset = 0x3E000;
const int g_offset_virus = 20;
const int size = 260;
char szLogFileName[] = "debugInfo.log";
void __stdcall VirusEntry();
void Logout();
void InjectModule(const char* param_decFileName);
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
void __stdcall VirusEntry()
{
MessageBox(NULL, "VirusEntry Microsoft", "ddd", 0);
}
// 附加到缓冲区后全部一次性输出
void Logout()
{
//HANDLE hFile = CreateFile(szLogFileName, GENERIC_WRITE, 0, 0,
// OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
//DWORD NumReadWrite = 0;
//char szBuf[MAX_PATH] = "Microosft\r\nThank you all the same";
//CloseHandle(hFile);
}
//插入模块
void InjectModule(const char* param_decFileName)
{
}