mirror of
https://github.com/Artikash/Textractor.git
synced 2024-12-23 17:04:12 +08:00
more reliable shino hook
This commit is contained in:
parent
fbe190f39c
commit
0a50a9b70d
@ -5763,15 +5763,15 @@ int GetShinaRioVersion()
|
|||||||
if (hFile != INVALID_HANDLE_VALUE) {
|
if (hFile != INVALID_HANDLE_VALUE) {
|
||||||
//char *buffer,*version;//,*ptr;
|
//char *buffer,*version;//,*ptr;
|
||||||
enum { BufferSize = 0x40 };
|
enum { BufferSize = 0x40 };
|
||||||
char buffer[BufferSize];
|
char buffer[BufferSize]{};
|
||||||
DWORD DUMMY;
|
DWORD DUMMY;
|
||||||
ReadFile(hFile, buffer, BufferSize, &DUMMY, nullptr);
|
ReadFile(hFile, buffer, BufferSize, &DUMMY, nullptr);
|
||||||
CloseHandle(hFile);
|
CloseHandle(hFile);
|
||||||
if (buffer[0] == '[') {
|
//if (buffer[0] == '[') {
|
||||||
buffer[0x3f] = 0; // jichi 8/24/2013: prevent strstr from overflow
|
buffer[0x3f] = 0; // jichi 8/24/2013: prevent strstr from overflow
|
||||||
if (char *version = ::strstr(buffer, "v2."))
|
if (char *version = ::strstr(buffer, "v2."))
|
||||||
::sscanf(version + 3, "%d", &ret); // +3 to skip "v2."
|
::sscanf(version + 3, "%d", &ret); // +3 to skip "v2."
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user