mirror of
https://github.com/Artikash/Textractor.git
synced 2024-12-23 08:54:12 +08:00
scrap that dumb idea
This commit is contained in:
parent
c808e7594d
commit
64eee8f049
@ -28,5 +28,4 @@ enum HookParamType : unsigned
|
||||
DIRECT_READ = 0x2000, // /R read code instead of classic /H hook code
|
||||
HOOK_ENGINE = 0x4000,
|
||||
HOOK_ADDITIONAL = 0x8000,
|
||||
HOOK_REMOVED = 0x10000, // hook was intentionally removed by the user
|
||||
};
|
||||
|
@ -68,7 +68,7 @@ DWORD WINAPI Pipe(LPVOID)
|
||||
case HOST_COMMAND_REMOVE_HOOK:
|
||||
{
|
||||
auto info = *(RemoveHookCmd*)buffer;
|
||||
RemoveHook(info.address, 0, true);
|
||||
RemoveHook(info.address, 0);
|
||||
}
|
||||
break;
|
||||
case HOST_COMMAND_FIND_HOOK:
|
||||
@ -196,9 +196,9 @@ void NewHook(HookParam hp, LPCSTR lpname, DWORD flag)
|
||||
}
|
||||
}
|
||||
|
||||
void RemoveHook(uint64_t addr, int maxOffset, bool markRemoved)
|
||||
void RemoveHook(uint64_t addr, int maxOffset)
|
||||
{
|
||||
for (auto& hook : *hooks) if (abs((long long)(hook.address - addr)) <= maxOffset) return hook.Clear(markRemoved);
|
||||
for (auto& hook : *hooks) if (abs((long long)(hook.address - addr)) <= maxOffset) return hook.Clear();
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
@ -12,7 +12,7 @@ void ConsoleOutput(LPCSTR text, ...);
|
||||
void NotifyHookFound(HookParam hp, wchar_t* text);
|
||||
void NotifyHookRemove(uint64_t addr, LPCSTR name);
|
||||
void NewHook(HookParam hp, LPCSTR name, DWORD flag = HOOK_ENGINE);
|
||||
void RemoveHook(uint64_t addr, int maxOffset = 9, bool markRemoved = false);
|
||||
void RemoveHook(uint64_t addr, int maxOffset = 9);
|
||||
|
||||
extern "C" // minhook library
|
||||
{
|
||||
|
@ -283,7 +283,7 @@ void TextHook::RemoveReadCode()
|
||||
CloseHandle(readerThread);
|
||||
}
|
||||
|
||||
void TextHook::Clear(bool markRemoved)
|
||||
void TextHook::Clear()
|
||||
{
|
||||
std::scoped_lock lock(viewMutex);
|
||||
if (address == 0) return;
|
||||
@ -291,7 +291,6 @@ void TextHook::Clear(bool markRemoved)
|
||||
else RemoveHookCode();
|
||||
NotifyHookRemove(address, hp.name);
|
||||
memset(this, 0, sizeof(TextHook)); // jichi 11/30/2013: This is the original code of ITH
|
||||
if (markRemoved) hp.type = HOOK_REMOVED;
|
||||
}
|
||||
|
||||
int TextHook::GetLength(uintptr_t base, uintptr_t in)
|
||||
|
@ -26,7 +26,7 @@ public:
|
||||
}; // Absolute address
|
||||
|
||||
bool Insert(HookParam hp, DWORD set_flag);
|
||||
void Clear(bool markRemoved = false);
|
||||
void Clear();
|
||||
|
||||
private:
|
||||
void Read();
|
||||
|
Loading…
x
Reference in New Issue
Block a user