mirror of
https://github.com/Artikash/Textractor.git
synced 2024-12-24 01:14:12 +08:00
bugfix read code
This commit is contained in:
parent
2c37a50f7b
commit
1312a80ddd
@ -448,13 +448,13 @@ DWORD WINAPI ReaderThread(LPVOID threadParam)
|
|||||||
{
|
{
|
||||||
TextHook* hook = (TextHook*)threadParam;
|
TextHook* hook = (TextHook*)threadParam;
|
||||||
BYTE buffer[PIPE_BUFFER_SIZE] = {};
|
BYTE buffer[PIPE_BUFFER_SIZE] = {};
|
||||||
char testChar1 = 0, testChar2 = 0; // Artikash 8/20/2018: two testChars in case the first character of the string is the same
|
|
||||||
unsigned int changeCount = 0;
|
unsigned int changeCount = 0;
|
||||||
|
int dataLen = 0;
|
||||||
const char* currentAddress = (char*)hook->hp.address;
|
const char* currentAddress = (char*)hook->hp.address;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
Sleep(1000);
|
Sleep(500);
|
||||||
if (testChar1 == *currentAddress && testChar2 == *(currentAddress + 3))
|
if (memcmp(buffer + HEADER_SIZE, currentAddress, dataLen) == 0)
|
||||||
{
|
{
|
||||||
changeCount = 0;
|
changeCount = 0;
|
||||||
continue;
|
continue;
|
||||||
@ -466,7 +466,6 @@ DWORD WINAPI ReaderThread(LPVOID threadParam)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int dataLen;
|
|
||||||
if (hook->hp.type & USING_UNICODE)
|
if (hook->hp.type & USING_UNICODE)
|
||||||
dataLen = wcslen((const wchar_t*)currentAddress) * 2;
|
dataLen = wcslen((const wchar_t*)currentAddress) * 2;
|
||||||
else
|
else
|
||||||
@ -478,9 +477,6 @@ DWORD WINAPI ReaderThread(LPVOID threadParam)
|
|||||||
memcpy(buffer + HEADER_SIZE, currentAddress, dataLen);
|
memcpy(buffer + HEADER_SIZE, currentAddress, dataLen);
|
||||||
DWORD unused;
|
DWORD unused;
|
||||||
WriteFile(::hookPipe, buffer, dataLen + HEADER_SIZE, &unused, nullptr);
|
WriteFile(::hookPipe, buffer, dataLen + HEADER_SIZE, &unused, nullptr);
|
||||||
|
|
||||||
testChar1 = *currentAddress;
|
|
||||||
testChar2 = *(currentAddress + 3);
|
|
||||||
}
|
}
|
||||||
hook->ClearHook();
|
hook->ClearHook();
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user