forked from Public-Mirror/Textractor
no more auto removing read hooks
This commit is contained in:
parent
3d88f2b9ec
commit
b0eeca5b36
@ -238,30 +238,14 @@ bool TextHook::InsertHookCode()
|
|||||||
void TextHook::Read()
|
void TextHook::Read()
|
||||||
{
|
{
|
||||||
BYTE buffer[TEXT_BUFFER_SIZE] = {};
|
BYTE buffer[TEXT_BUFFER_SIZE] = {};
|
||||||
int changeCount = 0, dataLen = 1;
|
int dataLen = 1;
|
||||||
__try
|
__try
|
||||||
{
|
{
|
||||||
while (WaitForSingleObject(readerEvent, 500) == WAIT_TIMEOUT)
|
while (WaitForSingleObject(readerEvent, 500) == WAIT_TIMEOUT) if (memcmp(buffer, location, dataLen) != 0) if (int currentLen = HookStrlen((BYTE*)location))
|
||||||
{
|
{
|
||||||
if (memcmp(buffer, location, dataLen) == 0)
|
dataLen = min(currentLen, TEXT_BUFFER_SIZE);
|
||||||
{
|
memcpy(buffer, location, dataLen);
|
||||||
changeCount = 0;
|
TextOutput({ GetCurrentProcessId(), address, 0, 0 }, buffer, dataLen);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (++changeCount > 10)
|
|
||||||
{
|
|
||||||
ConsoleOutput(GARBAGE_MEMORY);
|
|
||||||
Clear();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (int currentLen = HookStrlen((BYTE*)location))
|
|
||||||
{
|
|
||||||
dataLen = min(currentLen, TEXT_BUFFER_SIZE);
|
|
||||||
memcpy(buffer, location, dataLen);
|
|
||||||
TextOutput({ GetCurrentProcessId(), address, 0, 0 }, buffer, dataLen);
|
|
||||||
}
|
|
||||||
else changeCount = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
__except (EXCEPTION_EXECUTE_HANDLER)
|
__except (EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user