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
|
|
|
|
{
|
2019-02-05 04:18:47 +08:00
|
|
|
using ProcessEventHandler = std::function<void(DWORD)>;
|
|
|
|
using ThreadEventHandler = std::function<void(TextThread&)>;
|
2019-09-11 09:59:59 +08:00
|
|
|
using HookEventHandler = std::function<void(HookParam, std::wstring text)>;
|
2019-02-05 04:18:47 +08:00
|
|
|
void Start(ProcessEventHandler Connect, ProcessEventHandler Disconnect, ThreadEventHandler Create, ThreadEventHandler Destroy, TextThread::OutputCallback Output);
|
2018-08-25 02:04:23 +08:00
|
|
|
|
2019-02-16 13:33:38 +08:00
|
|
|
void InjectProcess(DWORD processId);
|
2018-11-01 00:04:32 +08:00
|
|
|
void DetachProcess(DWORD processId);
|
2019-06-17 10:57:41 +08:00
|
|
|
|
2018-12-02 04:55:32 +08:00
|
|
|
void InsertHook(DWORD processId, HookParam hp);
|
2019-06-10 13:49:11 +08:00
|
|
|
void RemoveHook(DWORD processId, uint64_t address);
|
2019-06-02 14:09:17 +08:00
|
|
|
void FindHooks(DWORD processId, SearchParam sp, HookEventHandler HookFound = {});
|
2018-08-25 00:50:20 +08:00
|
|
|
|
2019-06-17 10:57:41 +08:00
|
|
|
TextThread* GetThread(int64_t handle);
|
2019-02-05 04:18:47 +08:00
|
|
|
TextThread& GetThread(ThreadParam tp);
|
2019-06-10 13:49:11 +08:00
|
|
|
|
2018-08-25 00:50:20 +08:00
|
|
|
void AddConsoleOutput(std::wstring text);
|
2019-01-05 16:47:32 +08:00
|
|
|
|
|
|
|
inline int defaultCodepage = SHIFT_JIS;
|
2019-01-10 11:35:01 +08:00
|
|
|
|
|
|
|
constexpr ThreadParam console{ 0, -1LL, -1LL, -1LL }, clipboard{ 0, 0, -1LL, -1LL };
|
2018-07-24 03:25:02 +08:00
|
|
|
}
|