DemonMemory/源代码/InjectDlg.h

39 lines
1.1 KiB
C++

#pragma once
#include "ChooseProcessDlg.h"
#include <psapi.h>
#pragma comment(lib, "psapi.lib")
// CInjectDlg 对话框
class CInjectDlg : public CDialogEx
{
DECLARE_DYNAMIC(CInjectDlg)
private:
DWORD m_dwID;
char m_szDllPath[MAX_PATH];
BOOL RemoteProcessInject(DWORD dwID, char *lpszDllPath);
BOOL JudgePE32Or64(char *lpszDllPath);
DWORD64 GetProcessDllBaseAddress(HANDLE hProcess, HMODULE hBaseAddress, char szDllName[MAX_PATH], BOOL b32);
BOOL GetProcessBaseAddress(HMODULE *lpBaseAddress, HANDLE hProcess);
DWORD64 GetDllBase(HANDLE hProcess, DWORD64 dwFunctionAddress, BOOL b32);
DWORD64 GetFuncInDll(HANDLE hProcess, DWORD64 dwDllBaseAddress, char *lpszFuncName, BOOL b32);
public:
CInjectDlg(CWnd* pParent = NULL); // 标准构造函数
virtual ~CInjectDlg();
// 对话框数据
enum { IDD = IDD_DIALOG_INJECT };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedButtonProcess();
CString m_strProcess;
CString m_strDll;
afx_msg void OnBnClickedButtonDll();
afx_msg void OnBnClickedButtonInject();
};