From d51445201b28e9a42d015ce2815e11face6e41e2 Mon Sep 17 00:00:00 2001 From: zeffy Date: Wed, 4 Oct 2017 16:36:53 -0700 Subject: [PATCH] fix wiki links in CONTRIBUTING.md, add links to Italian translation --- CONTRIBUTING.md | 2 +- README.md | 2 +- wufuc/dllmain.c | 6 +++--- wufuc/patchwua.c | 40 ++++++++++++++++++++-------------------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1fc58b0..3b1c9e8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing guidelines -**English** | [русский](translations/CONTRIBUTING.ru-RU.md) | [Français](translations/CONTRIBUTING.fr-FR.md) | [Deutsch](translations/CONTRIBUTING.de-DE.md) | [Magyar](translations/CONTRIBUTING.hu-HU.md) | [Portuguese (Brazil)](translations/CONTRIBUTING.pt-BR.md) +**English** | [русский](../../wiki/CONTRIBUTING-(русский)) | [Français](../../wiki/CONTRIBUTING-(Français)) | [Deutsch](../../wiki/CONTRIBUTING-(Deutsch)) | [Magyar](../../wiki/CONTRIBUTING-(Magyar)) | [Português Brasileiro](../../wiki/CONTRIBUTING-(Português-Brasileiro)) | [Italiano](../../wiki/CONTRIBUTING-(Italiano)) ## Reporting an issue [![](https://isitmaintained.com/badge/resolution/zeffy/wufuc.svg)](https://isitmaintained.com/project/zeffy/wufuc) diff --git a/README.md b/README.md index 556a1fc..07bddec 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # wufuc [![](https://ci.appveyor.com/api/projects/status/0s2unkpokttyslf0?svg=true)](https://ci.appveyor.com/project/zeffy/wufuc) [![](https://isitmaintained.com/badge/resolution/zeffy/wufuc.svg)](https://isitmaintained.com/project/zeffy/wufuc) -**English** | [русский](../../wiki/README-(русский)) | [Français](../../wiki/README-(Français)) | [Deutsch](../../wiki/CONTRIBUTING-(Deutsch)) | [Magyar](../../wiki/README-(Magyar)) | [Português Brasileiro](../../wiki/README-(Português-Brasileiro)) +**English** | [русский](../../wiki/README-(русский)) | [Français](../../wiki/README-(Français)) | [Deutsch](../../wiki/README-(Deutsch)) | [Magyar](../../wiki/README-(Magyar)) | [Português Brasileiro](../../wiki/README-(Português-Brasileiro)) | [Italiano](../../wiki/README-(Italiano)) Disables the "Unsupported Hardware" message in Windows Update, and allows you to continue installing updates on Windows 7 and 8.1 systems with Intel Kaby Lake, AMD Ryzen, or other unsupported processors. diff --git a/wufuc/dllmain.c b/wufuc/dllmain.c index ac88a3e..a6fbb76 100644 --- a/wufuc/dllmain.c +++ b/wufuc/dllmain.c @@ -15,10 +15,10 @@ RTL_VERIFIER_THUNK_DESCRIPTOR g_vfK32ThunkDescriptors[] = { RTL_VERIFIER_DLL_DESCRIPTOR g_vfDllDescriptors[] = { { L"kernel32.dll", 0, NULL, g_vfK32ThunkDescriptors }, { 0 } }; -RTL_VERIFIER_DLL_DESCRIPTOR g_vfNullDllDescriptor[] = { { 0 } }; +RTL_VERIFIER_DLL_DESCRIPTOR g_vfNullDllDescriptor = { 0 }; RTL_VERIFIER_PROVIDER_DESCRIPTOR g_vfProviderDescriptor = { sizeof(RTL_VERIFIER_PROVIDER_DESCRIPTOR), - g_vfNullDllDescriptor, + &g_vfNullDllDescriptor, //(RTL_VERIFIER_DLL_LOAD_CALLBACK)&VerifierDllLoadCallback, //(RTL_VERIFIER_DLL_UNLOAD_CALLBACK)&VerifierDllUnloadCallback }; @@ -47,7 +47,7 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv &QueryTable, NULL, NULL); - + // TODO: check status and maybe fix implementation? idk... if ( !RtlCompareUnicodeString(&NtCurrentPeb()->ProcessParameters->CommandLine, &ImagePath, TRUE) ) g_vfProviderDescriptor.ProviderDlls = g_vfDllDescriptors; diff --git a/wufuc/patchwua.c b/wufuc/patchwua.c index 7a81348..b77f888 100644 --- a/wufuc/patchwua.c +++ b/wufuc/patchwua.c @@ -11,22 +11,24 @@ #include #include +#ifdef _M_AMD64 static const PatchSet X64PatchSet = { "FFF3 4883EC?? 33DB 391D???????? 7508 8B05????????", 0xA, 0x12 }; +#elif defined(_M_IX86) static const PatchSet Win7X86PatchSet = { "833D????????00 743E E8???????? A3????????", 0x2, 0xF }; static const PatchSet Win81X86PatchSet = { "8BFF 51 833D????????00 7507 A1????????", 0x5, 0xD }; +#endif bool calculate_pointers(uintptr_t lpfn, const PatchSet *ps, LPBOOL *ppba, LPBOOL *ppbb) { - size_t bits = sizeof(uintptr_t) * 8; - if ( bits == 64 ) { - *ppba = (LPBOOL)(lpfn + ps->Offset1 + sizeof(uint32_t) + *(uint32_t *)(lpfn + ps->Offset1)); - *ppbb = (LPBOOL)(lpfn + ps->Offset2 + sizeof(uint32_t) + *(uint32_t *)(lpfn + ps->Offset2)); - return true; - } else if ( bits == 32 ) { - *ppba = (LPBOOL)(*(uintptr_t *)(lpfn + ps->Offset1)); - *ppbb = (LPBOOL)(*(uintptr_t *)(lpfn + ps->Offset2)); - return true; - } +#ifdef _M_AMD64 + *ppba = (LPBOOL)(lpfn + ps->Offset1 + sizeof(uint32_t) + *(uint32_t *)(lpfn + ps->Offset1)); + *ppbb = (LPBOOL)(lpfn + ps->Offset2 + sizeof(uint32_t) + *(uint32_t *)(lpfn + ps->Offset2)); + return true; +#elif defined(_M_IX86) + *ppba = (LPBOOL)(*(uintptr_t *)(lpfn + ps->Offset1)); + *ppbb = (LPBOOL)(*(uintptr_t *)(lpfn + ps->Offset2)); + return true; +#endif return false; } @@ -35,16 +37,14 @@ bool patch_wua(void *lpBaseOfDll, size_t SizeOfImage, wchar_t *fname) bool result = false; const PatchSet *pps; - size_t bits = sizeof(uintptr_t) * 8; - if ( bits == 64 ) - pps = &X64PatchSet; - else if ( bits == 32 && verify_winver(6, 1, 0, 0, 0, VER_EQUAL, VER_EQUAL, 0, 0, 0) ) +#ifdef _M_AMD64 + pps = &X64PatchSet; +#elif defined(_M_IX86) + if ( verify_winver(6, 1, 0, 0, 0, VER_EQUAL, VER_EQUAL, 0, 0, 0) ) pps = &Win7X86PatchSet; - else if ( bits == 32 && verify_winver(6, 3, 0, 0, 0, VER_EQUAL, VER_EQUAL, 0, 0, 0) ) + else if ( verify_winver(6, 3, 0, 0, 0, VER_EQUAL, VER_EQUAL, 0, 0, 0) ) pps = &Win81X86PatchSet; - else - goto L_ret; - +#endif unsigned char *ptr = patternfind(lpBaseOfDll, SizeOfImage, pps->Pattern); if ( !ptr ) { trace(L"No pattern match! (couldn't patch)"); @@ -57,7 +57,7 @@ bool patch_wua(void *lpBaseOfDll, size_t SizeOfImage, wchar_t *fname) if ( *pba == TRUE ) { if ( VirtualProtect(pba, sizeof(BOOL), PAGE_READWRITE, &flOldProtect) ) { *pba = FALSE; - trace(L"Patched boolean A at %ls!%p: %08X", fname, pba, *pba); + trace(L"Patched value a at %ls!%p: %08X", fname, pba, *pba); if ( !VirtualProtect(pba, sizeof(BOOL), flOldProtect, &flOldProtect) ) trace(L"Failed to restore memory region permissions at %ls!%p (error code=%08X)", fname, pba, GetLastError()); } else trace(L"Failed to change memory region permissions at %ls!%p (error code=%08X)", fname, pba, GetLastError()); @@ -65,7 +65,7 @@ bool patch_wua(void *lpBaseOfDll, size_t SizeOfImage, wchar_t *fname) if ( *pbb == FALSE ) { if ( VirtualProtect(pbb, sizeof(BOOL), PAGE_READWRITE, &flOldProtect) ) { *pbb = TRUE; - trace(L"Patched boolean B at %ls!%p: %08X", fname, pbb, *pbb); + trace(L"Patched value b at %ls!%p: %08X", fname, pbb, *pbb); if ( !VirtualProtect(pbb, sizeof(BOOL), flOldProtect, &flOldProtect) ) trace(L"Failed to restore memory region permissions at %ls!%p: (error code=%08X)", fname, pbb, GetLastError()); } else trace(L"Failed to change memory region permissions at %ls!%p (error code=%08X)", fname, pbb, GetLastError());