mirror of
https://github.com/Artikash/Textractor.git
synced 2024-12-23 17:04:12 +08:00
fix nulls not being reset
This commit is contained in:
parent
0a50a9b70d
commit
aa3b9ee14f
@ -326,8 +326,10 @@ int TextHook::GetLength(uintptr_t base, uintptr_t in)
|
|||||||
int TextHook::HookStrlen(BYTE* data)
|
int TextHook::HookStrlen(BYTE* data)
|
||||||
{
|
{
|
||||||
BYTE* orig = data;
|
BYTE* orig = data;
|
||||||
for (int nullsRemaining = hp.null_length ? hp.null_length : hp.type & USING_UNICODE ? 2 : 1; nullsRemaining >= 0; ++data)
|
int nulls = hp.null_length ? hp.null_length : hp.type & USING_UNICODE ? 2 : 1;
|
||||||
|
for (int nullsRemaining = nulls; nullsRemaining >= 0; ++data)
|
||||||
if (*data == 0) nullsRemaining -= 1;
|
if (*data == 0) nullsRemaining -= 1;
|
||||||
|
else nullsRemaining = nulls;
|
||||||
return data - orig;
|
return data - orig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user