2016-01-05 23:01:17 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// host.h
|
|
|
|
// 8/23/2013 jichi
|
|
|
|
// Branch: ITH/IHF.h, rev 105
|
|
|
|
|
2018-08-23 00:24:55 +08:00
|
|
|
#include "common.h"
|
2018-07-24 03:25:02 +08:00
|
|
|
#include "textthread.h"
|
|
|
|
|
2018-07-25 01:39:02 +08:00
|
|
|
typedef std::function<void(DWORD)> ProcessEventCallback;
|
|
|
|
typedef std::function<void(TextThread*)> ThreadEventCallback;
|
2018-07-24 03:25:02 +08:00
|
|
|
|
|
|
|
namespace Host
|
|
|
|
{
|
2018-08-25 00:50:20 +08:00
|
|
|
void Start(ProcessEventCallback onAttach, ProcessEventCallback onDetach, ThreadEventCallback onCreate, ThreadEventCallback onRemove);
|
|
|
|
void Close();
|
2018-08-25 02:04:23 +08:00
|
|
|
|
2018-08-25 00:50:20 +08:00
|
|
|
bool InjectProcess(DWORD pid, DWORD timeout = 5000);
|
2018-08-25 02:04:23 +08:00
|
|
|
void DetachProcess(DWORD pid);
|
|
|
|
|
|
|
|
void InsertHook(DWORD pid, HookParam hp, std::string name = "");
|
|
|
|
void RemoveHook(DWORD pid, unsigned __int64 addr);
|
2018-08-25 00:50:20 +08:00
|
|
|
|
|
|
|
HookParam GetHookParam(DWORD pid, unsigned __int64 addr);
|
|
|
|
HookParam GetHookParam(ThreadParam tp);
|
|
|
|
std::wstring GetHookName(DWORD pid, unsigned __int64 addr);
|
|
|
|
|
|
|
|
TextThread* GetThread(ThreadParam tp);
|
|
|
|
void AddConsoleOutput(std::wstring text);
|
2018-07-24 03:25:02 +08:00
|
|
|
}
|
2016-01-05 23:01:17 +08:00
|
|
|
// EOF
|