Skip to content

Commit

Permalink
Fix a few lengths in antivm replacement code
Browse files Browse the repository at this point in the history
  • Loading branch information
KillerInstinct authored Nov 3, 2016
1 parent 0143581 commit 3c5ffc0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3c5ffc0

Please sign in to comment.