clean up hookman some more

This commit is contained in:
Akash Mozumdar 2018-05-23 04:31:21 -04:00
parent dff4ae3463
commit 1fb66ddc04
3 changed files with 1 additions and 34 deletions

View File

@ -211,8 +211,6 @@ HookManager::~HookManager()
TextThread *HookManager::FindSingle(DWORD number) TextThread *HookManager::FindSingle(DWORD number)
{ return (number & 0x80008000) ? nullptr : thread_table->FindThread(number); } { return (number & 0x80008000) ? nullptr : thread_table->FindThread(number); }
void HookManager::DetachProcess(DWORD pid) {}
void HookManager::SetCurrent(TextThread *it) void HookManager::SetCurrent(TextThread *it)
{ {
if (current) if (current)
@ -626,25 +624,6 @@ void HookManager::AddConsoleOutput(LPCWSTR text)
} }
} }
void HookManager::ClearText(DWORD pid, DWORD hook, DWORD retn, DWORD spl)
{
HM_LOCK;
//bool flag=false;
//ConsoleOutput("vnrhost:ClearText: lock");
//EnterCriticalSection(&hmcs);
ThreadParameter tp = {pid, hook, retn, spl};
if (TreeNode<ThreadParameter *, DWORD> *in = Search(&tp))
if (TextThread *it = thread_table->FindThread(in->data)) {
it->Reset();
//SetCurrent(it);
if (reset)
reset(it);
//it->ResetEditText();
}
//LeaveCriticalSection(&hmcs);
//ConsoleOutput("vnrhost:ClearText: unlock");
}
void HookManager::ClearCurrent() void HookManager::ClearCurrent()
{ {
HM_LOCK; HM_LOCK;

View File

@ -57,14 +57,12 @@ public:
void UnLink(WORD from); void UnLink(WORD from);
void UnLinkAll(WORD from); void UnLinkAll(WORD from);
void SelectCurrent(DWORD num); void SelectCurrent(DWORD num);
void DetachProcess(DWORD pid);
void SetCurrent(TextThread *it); void SetCurrent(TextThread *it);
void AddConsoleOutput(LPCWSTR text); void AddConsoleOutput(LPCWSTR text);
// jichi 10/27/2013: Add const; add space. // jichi 10/27/2013: Add const; add space.
void DispatchText(DWORD pid, const BYTE *text, DWORD hook, DWORD retn, DWORD split, int len, bool space); void DispatchText(DWORD pid, const BYTE *text, DWORD hook, DWORD retn, DWORD split, int len, bool space);
void ClearText(DWORD pid, DWORD hook, DWORD retn, DWORD split); // private
void RemoveProcessContext(DWORD pid); // private void RemoveProcessContext(DWORD pid); // private
void RemoveSingleHook(DWORD pid, DWORD addr); void RemoveSingleHook(DWORD pid, DWORD addr);
void RegisterThread(TextThread*, DWORD); // private void RegisterThread(TextThread*, DWORD); // private
@ -78,9 +76,6 @@ public:
ConsoleCallback RegisterConsoleCallback(ConsoleCallback cf) ConsoleCallback RegisterConsoleCallback(ConsoleCallback cf)
{ return (ConsoleCallback)_InterlockedExchange((long*)&console,(long)cf); } { return (ConsoleCallback)_InterlockedExchange((long*)&console,(long)cf); }
ConsoleWCallback RegisterConsoleWCallback(ConsoleWCallback cf)
{ return (ConsoleWCallback)_InterlockedExchange((long*)&wconsole,(long)cf); }
ThreadEventCallback RegisterThreadCreateCallback(ThreadEventCallback cf) ThreadEventCallback RegisterThreadCreateCallback(ThreadEventCallback cf)
{ return (ThreadEventCallback)_InterlockedExchange((long*)&create,(long)cf); } { return (ThreadEventCallback)_InterlockedExchange((long*)&create,(long)cf); }
@ -107,13 +102,6 @@ public:
ProcessRecord *Records() { return record; } // private ProcessRecord *Records() { return record; } // private
ThreadTable *Table() { return thread_table; } // private ThreadTable *Table() { return thread_table; } // private
//DWORD& SplitTime() { return split_time; }
//DWORD& RepeatCount() { return repeat_count; }
//DWORD& CyclicRemove() { return cyclic_remove; }
//DWORD& GlobalFilter() { return global_filter; }
void ConsoleOutput(LPCSTR text) { if (console) console(text); } // not thread safe
void ConsoleOutputW(LPCWSTR text) { if (wconsole) wconsole(text); } // not thread safe
void OnThreadCreate(pugi::xml_node profile_node, TextThread* thread); void OnThreadCreate(pugi::xml_node profile_node, TextThread* thread);
void GetProfile(DWORD pid, pugi::xml_node profile_node); void GetProfile(DWORD pid, pugi::xml_node profile_node);

View File

@ -558,7 +558,7 @@ DWORD TextThread::GetEntryString(LPSTR str, DWORD max)
} else { } else {
len = ::sprintf(str, "%.4X:%.4d:0x%08X:0x%08X:0x%08X:", len = ::sprintf(str, "%.4X:%.4d:0x%08X:0x%08X:0x%08X:",
thread_number, tp. pid, tp.hook, tp.retn, tp.spl); thread_number, tp.pid, tp.hook, tp.retn, tp.spl);
len += GetHookName(str + len, tp.pid, tp.hook, max - len); len += GetHookName(str + len, tp.pid, tp.hook, max - len);
thread_string = new char[len + 1]; thread_string = new char[len + 1];