|
Post by anixx on Aug 31, 2024 13:41:53 GMT -8
Please, test:
// ==WindhawkMod== // @id fake-explorer-path // @name Fake Explorer path // @description Allows to run explorer.exe in taskbar mode from any location // @version 0.1 // @author Anixx // @github https://github.com/Anixx // @include explorer.exe // ==/WindhawkMod==
// ==WindhawkModReadme== /*
*/ // ==/WindhawkModReadme==
#include <windhawk_api.h> #include <windows.h>
typedef DWORD (WINAPI* GetModuleFileNameW_t)(HMODULE, LPWSTR, DWORD); GetModuleFileNameW_t pOriginalGetModuleFileNameW = NULL;
DWORD WINAPI HookedGetModuleFileNameW(HMODULE hModule, LPWSTR lpFilename, DWORD nSize) { // If the call is for the main executable, return the fake path if (hModule == NULL) { WCHAR systemRoot[MAX_PATH]; GetEnvironmentVariableW(L"SystemRoot", systemRoot, MAX_PATH); wsprintfW(lpFilename, L"%s\\explorer.exe", systemRoot); return lstrlenW(lpFilename); } // Otherwise, call the original function return pOriginalGetModuleFileNameW(hModule, lpFilename, nSize); }
// The mod is being initialized, load settings, hook functions, and do other // initialization stuff if required. BOOL Wh_ModInit(void) { Wh_Log(L"Init");
Wh_SetFunctionHook((void*)GetProcAddress(LoadLibrary(L"kernelbase.dll"), "GetModuleFileNameW"), (void*)HookedGetModuleFileNameW, (void**)&pOriginalGetModuleFileNameW);
return TRUE; }
// The mod is being unloaded, free all allocated resources. void Wh_ModUninit() { Wh_Log(L"Uninit"); }
Specifically, please test if on Win1124H2 it allows to run Win10 taskbar without modifying the system files.
|
|
|
Post by OrthodoxWin32 on Aug 31, 2024 16:01:22 GMT -8
anixx This mod is supposed to use the explorer.exe from which location?
|
|
tselim
Sophomore Member
entered a message
Posts: 143
OS: Windows 11 Pro 23H2
Theme: Aero10: Vista (Modified)
CPU: AMD Ryzen 5 Pro 4650G With Raedon Graphics
RAM: 11.8 GB
GPU: AMD Raedon (TM) Graphics
|
Post by tselim on Aug 31, 2024 16:05:55 GMT -8
Please, test:
// ==WindhawkMod== // @id fake-explorer-path // @name Fake Explorer path // @description Allows to run explorer.exe in taskbar mode from any location // @version 0.1 // @author Anixx // @github https://github.com/Anixx // @include explorer.exe // ==/WindhawkMod==
// ==WindhawkModReadme== /*
*/ // ==/WindhawkModReadme==
#include <windhawk_api.h> #include <windows.h>
typedef DWORD (WINAPI* GetModuleFileNameW_t)(HMODULE, LPWSTR, DWORD); GetModuleFileNameW_t pOriginalGetModuleFileNameW = NULL;
DWORD WINAPI HookedGetModuleFileNameW(HMODULE hModule, LPWSTR lpFilename, DWORD nSize) { // If the call is for the main executable, return the fake path if (hModule == NULL) { WCHAR systemRoot[MAX_PATH]; GetEnvironmentVariableW(L"SystemRoot", systemRoot, MAX_PATH); wsprintfW(lpFilename, L"%s\\explorer.exe", systemRoot); return lstrlenW(lpFilename); } // Otherwise, call the original function return pOriginalGetModuleFileNameW(hModule, lpFilename, nSize); }
// The mod is being initialized, load settings, hook functions, and do other // initialization stuff if required. BOOL Wh_ModInit(void) { Wh_Log(L"Init");
Wh_SetFunctionHook((void*)GetProcAddress(LoadLibrary(L"kernelbase.dll"), "GetModuleFileNameW"), (void*)HookedGetModuleFileNameW, (void**)&pOriginalGetModuleFileNameW);
return TRUE; }
// The mod is being unloaded, free all allocated resources. void Wh_ModUninit() { Wh_Log(L"Uninit"); }
Specifically, please test if on Win1124H2 it allows to run Win10 taskbar without modifying the system files.
I am confused on how to make this mod work.
|
|
|
Post by anixx on Aug 31, 2024 16:16:01 GMT -8
anixx This mod is supposed to use the explorer.exe from which location? You can run explorer.exe from any location and it will run in taskbar mode (if it is named explorer.exe and there is no explorer running yet).
|
|
|
Post by OrthodoxWin32 on Aug 31, 2024 16:18:42 GMT -8
You can run explorer.exe from any location and it will run in taskbar mode (if it is named explorer.exe and there is no explorer running yet). I see. I just didn't understand where to indicate the path of the explorer.exe
|
|
|
Post by anixx on Aug 31, 2024 16:28:56 GMT -8
You can run explorer.exe from any location and it will run in taskbar mode (if it is named explorer.exe and there is no explorer running yet). I see. I just didn't understand where to indicate the path of the explorer.exe You do not need to indicate it. You can run it from any location. For instance, from Task Manager.
|
|
|
Post by OrthodoxWin32 on Aug 31, 2024 16:32:12 GMT -8
You do not need to indicate it. You can run it from any location. For instance, from Task Manager. I'll try.
|
|
|
Post by anixx on Aug 31, 2024 16:39:45 GMT -8
You can run explorer.exe from any location and it will run in taskbar mode (if it is named explorer.exe and there is no explorer running yet). I see. I just didn't understand where to indicate the path of the explorer.exe You can change the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell to point to explore.exe located at any place and it will start as taskbar. I've just tested it.
On Win11 24H2 you can point to explorer.exe from Win10.
|
|
|
Post by anixx on Aug 31, 2024 17:12:32 GMT -8
To run it in Win10 mode, one has to copy or link the locale folder from Windows folder to the explorer.exe location. I managed to run explorer.exe from Win10 in taskbar mode on Windows 11.
|
|
|
Post by enderboy on Sept 1, 2024 4:27:56 GMT -8
Ah, I understand, it’s resource redirect but it redirects the entire application, just wondering, can you redirect the full shell32 dll using this method
|
|
|
Post by anixx on Sept 1, 2024 5:55:27 GMT -8
Ah, I understand, it’s resource redirect but it redirects the entire application, just wondering, can you redirect the full shell32 dll using this method Not exactly. The thing is, Explorer after being launched checks from what location it has been launched. If it is not C:\Windows (%Systemroot%), it starts as a window, not as taskbar. This mod allows to fool it to think it was launched from C:\Windows.
|
|