2016-01-05 23:01:17 +08:00
|
|
|
#pragma once
|
|
|
|
|
2018-08-23 00:24:55 +08:00
|
|
|
#include "common.h"
|
2018-07-24 03:25:02 +08:00
|
|
|
#include "textthread.h"
|
|
|
|
|
|
|
|
namespace Host
|
|
|
|
{
|
2018-11-28 04:54:04 +08:00
|
|
|
typedef std::function<void(DWORD)> ProcessEventCallback;
|
|
|
|
void Start(ProcessEventCallback OnConnect, ProcessEventCallback OnDisconnect, TextThread::EventCallback OnCreate, TextThread::EventCallback OnDestroy, TextThread::OutputCallback Output);
|
2018-08-25 02:04:23 +08:00
|
|
|
|
2018-11-01 00:04:32 +08:00
|
|
|
bool InjectProcess(DWORD processId, DWORD timeout = 5000);
|
|
|
|
void DetachProcess(DWORD processId);
|
|
|
|
void InsertHook(DWORD processId, HookParam hp, std::string name = "");
|
2018-08-25 00:50:20 +08:00
|
|
|
|
2018-11-01 00:04:32 +08:00
|
|
|
HookParam GetHookParam(DWORD processId, uint64_t addr);
|
2018-11-05 09:48:46 +08:00
|
|
|
inline HookParam GetHookParam(ThreadParam tp) { return GetHookParam(tp.processId, tp.addr); }
|
2018-11-01 00:04:32 +08:00
|
|
|
std::wstring GetHookName(DWORD processId, uint64_t addr);
|
2018-11-05 09:48:46 +08:00
|
|
|
inline std::wstring GetHookName(ThreadParam tp) { return GetHookName(tp.processId, tp.addr); }
|
2018-08-25 00:50:20 +08:00
|
|
|
|
2018-10-31 13:20:44 +08:00
|
|
|
std::shared_ptr<TextThread> GetThread(ThreadParam tp);
|
2018-08-25 00:50:20 +08:00
|
|
|
void AddConsoleOutput(std::wstring text);
|
2018-07-24 03:25:02 +08:00
|
|
|
}
|