首页 > 代码库 > 远程线程注入dll

远程线程注入dll

// CommonInject.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>
#include <WinUser.h>
#include <WinDef.h>
#include <iostream>
#include <Tlhelp32.h>
using namespace std;

#include <Psapi.h>
#pragma  comment(lib,"Psapi.lib")
//通用dll 注入器

HANDLE GetProcessWithName(const std::wstring &proc_name){
	HANDLE hd = NULL;
	HANDLE hpross = NULL;
	int retls = 0;
	PROCESSENTRY32 pinfo = {0};
	wchar_t szFileName[MAX_PATH] = {0};

	hpross = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
	if(INVALID_HANDLE_VALUE =http://www.mamicode.com/= hpross)>

vs2010 编译通过,unicode编码

通过输入进程id或者,通过修改进程名,来选择目标进程