请见代码分析,实现线程注射
#include "stdafx.h"#include "windows.h"#include "stdio.h"#include "Psapi.h"#include "Tlhelp32.h"//获得加载的DLL模块的信息,主要包括模块基地址和模块大小BOOL GetThreadInformation(DWORD ProcessID,char* Dllfullname,MODULEENTRY32 &Thread){ HANDLE hthSnapshot = NULL; // 取得指定进程的所有模块映象. hthSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,ProcessID); if (hthSnapshot == NULL) return FALSE; // 取得所有模块列表中的指定的模块. BOOL bMoreMods = Module32First(hthSnapshot, &Thread); if (bMoreMods == FALSE) return FALSE; // 循环取得想要的模块. for (;bMoreMods; bMoreMods = Module32Next(hthSnapshot, &Thread)) { if (strcmp(Thread.szExePath, Dllfullname) == 0) break; } if (strcmp(Thread.szExePath, Dllfullname) == 0) return TRUE; else return FALSE;}//调整进程权限BOOL AdjustPrivileges(HANDLE hProcess,LPCTSTR lpPrivilegeName){ //*************************