forked from Public-Mirror/Textractor
Revert "remove unused code"
This reverts commit b3496222ec1b24df40365d77e8ea6c902873cbc1.
This commit is contained in:
parent
b3496222ec
commit
fe552f6e19
@ -36,6 +36,15 @@ void ConsoleOutput(LPCWSTR text)
|
||||
man->AddConsoleOutput(text);
|
||||
}
|
||||
|
||||
void ConsoleOutput(LPCSTR text)
|
||||
{
|
||||
int wc_length = MB_WC_count(text, -1);
|
||||
LPWSTR wc = new WCHAR[wc_length];
|
||||
MB_WC(text, wc, wc_length);
|
||||
man->AddConsoleOutput(wc);
|
||||
delete wc;
|
||||
}
|
||||
|
||||
std::wstring GetProcessPath(DWORD pid)
|
||||
{
|
||||
UniqueHandle hProc(OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid));
|
||||
|
@ -752,6 +752,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
man->RegisterProcessDetachCallback(RemoveProcessList);
|
||||
man->RegisterProcessNewHookCallback(RefreshProfileOnNewHook);
|
||||
man->RegisterAddRemoveLinkCallback(AddRemoveLink);
|
||||
man->RegisterConsoleCallback(ConsoleOutput);
|
||||
StartHost();
|
||||
{
|
||||
static const WCHAR program_name[] = L"Interactive Text Hooker";
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "host/avl_p.h"
|
||||
#include "host/textthread.h"
|
||||
#include "winmutex/winmutex.h"
|
||||
#include <unordered_map>
|
||||
|
||||
namespace pugi {
|
||||
class xml_node;
|
||||
@ -26,9 +25,6 @@ struct ProcessRecord {
|
||||
HANDLE hookman_mutex;
|
||||
HANDLE hookman_section;
|
||||
LPVOID hookman_map;
|
||||
HANDLE hostPipe;
|
||||
HANDLE hookPipe;
|
||||
HANDLE processThread;
|
||||
};
|
||||
|
||||
class ThreadTable : public MyVector<TextThread *, 0x40>
|
||||
@ -44,19 +40,6 @@ struct IHFSERVICE TLen { int operator()(const ThreadParameter *t); };
|
||||
|
||||
typedef DWORD (*ProcessEventCallback)(DWORD pid);
|
||||
|
||||
struct ThreadParameterHasher
|
||||
{
|
||||
size_t operator()(const ThreadParameter& threadParam) const
|
||||
{
|
||||
return std::hash<DWORD>()((threadParam.pid << 4) + threadParam.hook + threadParam.retn + threadParam.spl);
|
||||
}
|
||||
};
|
||||
|
||||
//bool operator==(const ThreadParameter& one, const ThreadParameter& two)
|
||||
//{
|
||||
// return one.pid == two.pid && one.hook == two.hook && one.retn == two.retn && one.spl == two.spl;
|
||||
//}
|
||||
|
||||
class IHFSERVICE HookManager : public AVLTree<ThreadParameter, DWORD, TCmp, TCpy, TLen>
|
||||
{
|
||||
public:
|
||||
@ -90,6 +73,9 @@ public:
|
||||
|
||||
HANDLE GetCmdHandleByPID(DWORD pid);
|
||||
|
||||
ConsoleCallback RegisterConsoleCallback(ConsoleCallback cf)
|
||||
{ return (ConsoleCallback)_InterlockedExchange((long*)&console,(long)cf); }
|
||||
|
||||
ThreadEventCallback RegisterThreadCreateCallback(ThreadEventCallback cf)
|
||||
{ return (ThreadEventCallback)_InterlockedExchange((long*)&create,(long)cf); }
|
||||
|
||||
@ -120,10 +106,6 @@ public:
|
||||
void GetProfile(DWORD pid, pugi::xml_node profile_node);
|
||||
|
||||
private:
|
||||
std::unordered_map<DWORD, ProcessRecord*> processRecords;
|
||||
std::unordered_map<ThreadParameter, TextThread*, ThreadParameterHasher> threadTable;
|
||||
|
||||
|
||||
typedef win_mutex<CRITICAL_SECTION> mutex_type;
|
||||
mutex_type hmcs;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user