2016-01-06 00:01:17 +09:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// host.h
|
|
|
|
// 8/23/2013 jichi
|
|
|
|
// Branch: ITH/IHF.h, rev 105
|
|
|
|
|
2018-08-22 12:24:55 -04:00
|
|
|
#include "common.h"
|
2018-07-23 12:25:02 -07:00
|
|
|
#include "textthread.h"
|
|
|
|
|
2018-08-22 12:24:55 -04:00
|
|
|
#define DLLEXPORT __declspec(dllexport)
|
|
|
|
|
2018-07-24 10:39:02 -07:00
|
|
|
typedef std::function<void(DWORD)> ProcessEventCallback;
|
|
|
|
typedef std::function<void(TextThread*)> ThreadEventCallback;
|
2018-07-23 12:25:02 -07:00
|
|
|
|
|
|
|
namespace Host
|
|
|
|
{
|
2018-08-21 22:43:30 -04:00
|
|
|
DLLEXPORT void Start(ProcessEventCallback onAttach, ProcessEventCallback onDetach, ThreadEventCallback onCreate, ThreadEventCallback onRemove);
|
2018-07-23 12:25:02 -07:00
|
|
|
DLLEXPORT void Close();
|
|
|
|
DLLEXPORT bool InjectProcess(DWORD pid, DWORD timeout = 5000);
|
|
|
|
DLLEXPORT bool DetachProcess(DWORD pid);
|
|
|
|
|
|
|
|
DLLEXPORT bool InsertHook(DWORD pid, HookParam hp, std::string name = "");
|
2018-08-23 12:18:03 -04:00
|
|
|
DLLEXPORT bool RemoveHook(DWORD pid, unsigned __int64 addr);
|
|
|
|
DLLEXPORT HookParam GetHookParam(DWORD pid, unsigned __int64 addr);
|
2018-08-23 11:53:23 -04:00
|
|
|
DLLEXPORT HookParam GetHookParam(ThreadParam tp);
|
2018-08-23 12:18:03 -04:00
|
|
|
DLLEXPORT std::wstring GetHookName(DWORD pid, unsigned __int64 addr);
|
2018-07-23 12:25:02 -07:00
|
|
|
|
2018-08-23 11:53:23 -04:00
|
|
|
DLLEXPORT TextThread* GetThread(ThreadParam tp);
|
2018-07-23 12:25:02 -07:00
|
|
|
DLLEXPORT void AddConsoleOutput(std::wstring text);
|
|
|
|
}
|
2016-01-06 00:01:17 +09:00
|
|
|
|
2018-08-23 11:53:23 -04:00
|
|
|
void DispatchText(ThreadParam tp, const BYTE *text, int len);
|
|
|
|
void RemoveThreads(bool(*RemoveIf)(ThreadParam, ThreadParam), ThreadParam cmp);
|
2018-07-23 12:25:02 -07:00
|
|
|
void RegisterProcess(DWORD pid, HANDLE hostPipe);
|
|
|
|
void UnregisterProcess(DWORD pid);
|
2016-01-06 00:01:17 +09:00
|
|
|
|
|
|
|
// EOF
|