Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIFILE Override v1.0.1 #862

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions mods/uifile-override.wh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// @id uifile-override
// @name UIFILE Override
// @description Override UIFILE resources
// @version 1.0
// @version 1.0.1
// @author xalejandro
// @github https://github.com/tetawaves
// @include *
Expand Down Expand Up @@ -174,7 +174,7 @@ BOOL Wh_ModInit() {
Wh_Log(L"Failed to load dui70.dll");
}

if (lstrcmpW(L"C:\\Windows\\explorer.exe", exePath)) {
if (lstrcmpiW(L"C:\\Windows\\explorer.exe", exePath)) {
return TRUE;
}

Expand All @@ -184,7 +184,7 @@ BOOL Wh_ModInit() {
return FALSE;
}

WindhawkUtils::SYMBOL_HOOK hooks[] = {
WindhawkUtils::SYMBOL_HOOK shell32DllHooks[] = {
{{L"long " STHISCALL " DUI_LoadUIFileFromResources(struct HINSTANCE__ "
"*,unsigned int,unsigned short * *)"},
(void**)&DUILoadUIFileFromResources_orig,
Expand All @@ -199,10 +199,16 @@ BOOL Wh_ModInit() {

};

if (!WindhawkUtils::HookSymbols(hShell32, hooks, 2)) {
if (!WindhawkUtils::HookSymbols(hShell32, shell32DllHooks, 2)) {
Wh_Log(L"Failed to hook shell32.dll");
return FALSE;
}

return TRUE;
}

void Wh_ModUninit(void) {
if (g_ShellStyleMod) {
FreeLibrary(g_ShellStyleMod);
}
}