From 3c5ffc03ed0c9270918ea59767543a3c4a414eeb Mon Sep 17 00:00:00 2001 From: KillerInstinct Date: Thu, 3 Nov 2016 07:16:48 -0400 Subject: [PATCH] Fix a few lengths in antivm replacement code --- misc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc.c b/misc.c index 2122efb..8a79764 100644 --- a/misc.c +++ b/misc.c @@ -392,13 +392,13 @@ void perform_unicode_registry_fakery(PWCHAR keypath, LPVOID Data, ULONG DataLeng if (!wcsnicmp(keypath, L"HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor", 63) && !wcsicmp(keypath + wcslen(keypath) - wcslen(L"ProcessorNameString"), L"ProcessorNameString")) { replace_wstring_in_buf(Data, DataLength / sizeof(wchar_t), L"QEMU Virtual CPU version 2.0.0", L"Intel(R) Core(TM) i7 CPU @3GHz"); - replace_wstring_in_buf(Data, DataLength, L"Xeon(R) ", L"Core(TM)"); + replace_wstring_in_buf(Data, DataLength / sizeof(wchar_t), L"Xeon(R) ", L"Core(TM)"); } if (!wcsicmp(keypath, L"HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\SystemManufacturer") || !wcsicmp(keypath, L"HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\SystemProductName")) { - replace_wstring_in_buf(Data, DataLength, L"VMware", L"Lenovo"); - replace_wstring_in_buf(Data, DataLength, L"Virtual Platform", L"X230 ThinkPad PC"); + replace_wstring_in_buf(Data, DataLength / sizeof(wchar_t), L"VMware", L"Lenovo"); + replace_wstring_in_buf(Data, DataLength / sizeof(wchar_t), L"Virtual Platform", L"X230 ThinkPad PC"); } // fake the manufacturer name