Skip to content
This repository has been archived by the owner on Apr 15, 2022. It is now read-only.

Commit

Permalink
add a version check for LeSetupAnsiOemCodeHashNodes()
Browse files Browse the repository at this point in the history
  • Loading branch information
fotile96 committed Aug 23, 2021
1 parent 752dd0b commit c1c43a7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions LocaleEmulator/Hooks/Kernel32Hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,17 @@ void* GetKthCallTarget(void* start_offset, DWORD parse_range_each, int K) {
typedef DWORD(__stdcall* pSetupAnsiOemCodeHashNodes)();

NTSTATUS LeSetupAnsiOemCodeHashNodes() {

RTL_OSVERSIONINFOW osvi;

ZeroMemory(&osvi, sizeof(RTL_OSVERSIONINFOW));
osvi.dwOSVersionInfoSize = sizeof(RTL_OSVERSIONINFOW);

RtlGetVersion(&osvi);
if (osvi.dwMajorVersion < 10 || osvi.dwBuildNumber < 19042)
return STATUS_SUCCESS; // does not need this trick for older versions.


PLDR_MODULE Kernel = FindLdrModuleByName(&USTR(L"KERNELBASE.dll"));
if (Kernel == nullptr)
return STATUS_PROCEDURE_NOT_FOUND;
Expand Down

0 comments on commit c1c43a7

Please sign in to comment.