ntinjectorthread.cpp
来自「这是一本学习 window编程的很好的参考教材」· C++ 代码 · 共 51 行
CPP
51 行
//---------------------------------------------------------------------------
//
// NtInjectorThread.cpp
//
// SUBSYSTEM:
// API Hooking system
// MODULE:
// Implements a thread that uses an NT device driver
// for monitoring process creation
//
// DESCRIPTION:
//
// AUTHOR: Ivo Ivanov (ivopi@hotmail.com)
//
//---------------------------------------------------------------------------
#include "NtInjectorThread.h"
#include "Injector.h"
//---------------------------------------------------------------------------
//
// class CNtInjectorThread
//
//---------------------------------------------------------------------------
CNtInjectorThread::CNtInjectorThread(CRemThreadInjector* pInjector):
CNtProcessMonitor(),
m_pInjector(pInjector)
{
}
CNtInjectorThread::~CNtInjectorThread()
{
}
void CNtInjectorThread::OnCreateProcess(DWORD dwProcessId)
{
m_pInjector->InjectModuleInto(dwProcessId);
}
void CNtInjectorThread::OnTerminateProcess(DWORD dwProcessId)
{
//
// We shouldn't eject the module here, because the process
// already has been terminated, meaning that the DLL probably
// is unloaded or possibly the process is not running anymore.
//
}
//----------------------------End of the file -------------------------------
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?