Skip to content

Commit ad41465

Browse files
authored
Merge branch 'valinet:master' into master
2 parents 440d9f8 + 5094108 commit ad41465

13 files changed

Lines changed: 324 additions & 92 deletions

File tree

CHANGELOG.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,31 @@ With this update, ExplorerPatcher is now officially compatible and supported on
4444
* ep_taskbar: Fixed tray icons not being saved.
4545
* ep_taskbar: Removed the Copilot button on 22H2.
4646

47-
ℹ️ **Important note:** Please include the following folders in your antivirus' exclusion list to prevent issues due to false positive detections:
48-
* `C:\Program Files\ExplorerPatcher`
49-
* `%APPDATA%\ExplorerPatcher`
50-
51-
For Defender, you can run the following script in PowerShell as an administrator:
52-
```ps1
53-
Add-MpPreference -ExclusionPath "C:\Program Files\ExplorerPatcher"
54-
Add-MpPreference -ExclusionPath "$env:APPDATA\ExplorerPatcher"
55-
```
47+
##### 5
48+
49+
* Taskbar10: Fixed jump list positioning patch on latest builds with `TaskbarJumplistOnHover` feature flag. (#3615) (351a020)
50+
* Taskbar11: Fixed Task Manager menu entry doing nothing on 24H2+. (#3021, #3556) (060066c)
51+
* Start10: Fixed symbols mechanism when custom `StartUI_.dll` is used. (0f38628)
52+
* Start10: Increased reliability of ARM64 patterns for restoring the animations and fixing positioning. (#3566) (2ea3894)
53+
* ep_taskbar: Fixed the task band not having a handle when the taskbar is unlocked.
54+
* ep_taskbar: Fixed scroll arrows in window list popups (`ExtendedUI`) having weird appearance and behavior.
55+
56+
> [!WARNING]
57+
> Please include the following folders in your antivirus' exclusion list to prevent issues due to false positive detections:
58+
> * `C:\Program Files\ExplorerPatcher`
59+
> * `%APPDATA%\ExplorerPatcher`
60+
> * `C:\Windows\dxgi.dll`
61+
> * `C:\Windows\SystemApps\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy`
62+
> * `C:\Windows\SystemApps\ShellExperienceHost_cw5n1h2txyewy`
63+
>
64+
> For Defender, you can run the following script in PowerShell as an administrator:
65+
> ```ps1
66+
> Add-MpPreference -ExclusionPath "C:\Program Files\ExplorerPatcher"
67+
> Add-MpPreference -ExclusionPath "$env:APPDATA\ExplorerPatcher"
68+
> Add-MpPreference -ExclusionPath "C:\Windows\dxgi.dll"
69+
> Add-MpPreference -ExclusionPath "C:\Windows\SystemApps\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy"
70+
> Add-MpPreference -ExclusionPath "C:\Windows\SystemApps\ShellExperienceHost_cw5n1h2txyewy"
71+
> ```
5672
5773
**A little request from us:** Because the development of EP's taskbar implementation took a lot of effort for 8 consecutive months, and that an ARM64 device to support the making and testing of ARM64 builds is not cheap, it would be really, really appreciated if you can [donate @Amrsatrio via Ko-fi](https://ko-fi.com/amrsatrio) 🙏
5874

ExplorerPatcher/TwinUIPatches.cpp

Lines changed: 186 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,20 +1623,43 @@ BOOL FixStartMenuAnimation(LPMODULEINFO mi)
16231623
matchVtable += 7 + *(int*)(matchVtable + 3);
16241624
}
16251625
#elif defined(_M_ARM64)
1626-
// ```
1627-
// 69 22 04 A9 ?? ?? 00 ?? 08 81 ?? 91 60 A2 01 91 68 32 00 F9
1628-
// ^^^^^^^^^^^+^^^^^^^^^^^
1626+
// * Pattern for Nickel
1627+
// ```
1628+
// 69 A2 03 A9 ?? ?? 00 ?? 08 ?? ?? 91 ?? ?? 00 ?? 29 ?? ?? 91 68 32 00 F9
1629+
// ^^^^^^^^^^^+^^^^^^^^^^^
1630+
// ```
1631+
// Ref: CStartExperienceManager::CStartExperienceManager()
16291632
PBYTE matchVtable = (PBYTE)FindPattern(
16301633
mi->lpBaseOfDll,
16311634
mi->SizeOfImage,
1632-
"\x69\x22\x04\xA9\x00\x00\x00\x00\x08\x81\x00\x91\x60\xA2\x01\x91\x68\x32\x00\xF9",
1633-
"xxxx??x?xx?xxxxxxxxx"
1635+
"\x69\xA2\x03\xA9\x00\x00\x00\x00\x08\x00\x00\x91\x00\x00\x00\x00\x29\x00\x00\x91\x68\x32\x00\xF9",
1636+
"xxxx??x?x??x??x?x??xxxxx"
16341637
);
16351638
if (matchVtable)
16361639
{
16371640
matchVtable += 4;
16381641
matchVtable = (PBYTE)ARM64_DecodeADRL((UINT_PTR)matchVtable, *(DWORD*)matchVtable, *(DWORD*)(matchVtable + 4));
16391642
}
1643+
else
1644+
{
1645+
// * Pattern for Germanium
1646+
// ```
1647+
// 69 22 04 A9 ?? ?? 00 ?? 08 ?? ?? 91 60 A2 01 91 68 32 00 F9
1648+
// ^^^^^^^^^^^+^^^^^^^^^^^
1649+
// ```
1650+
// Ref: CStartExperienceManager::CStartExperienceManager()
1651+
matchVtable = (PBYTE)FindPattern(
1652+
mi->lpBaseOfDll,
1653+
mi->SizeOfImage,
1654+
"\x69\x22\x04\xA9\x00\x00\x00\x00\x08\x00\x00\x91\x60\xA2\x01\x91\x68\x32\x00\xF9",
1655+
"xxxx??x?x??xxxxxxxxx"
1656+
);
1657+
if (matchVtable)
1658+
{
1659+
matchVtable += 4;
1660+
matchVtable = (PBYTE)ARM64_DecodeADRL((UINT_PTR)matchVtable, *(DWORD*)matchVtable, *(DWORD*)(matchVtable + 4));
1661+
}
1662+
}
16401663
#endif
16411664
if (matchVtable)
16421665
{
@@ -1811,24 +1834,63 @@ BOOL FixStartMenuAnimation(LPMODULEINFO mi)
18111834
matchGetMonitorInformation += 5 + *(int*)(matchGetMonitorInformation + 1);
18121835
}
18131836
#elif defined(_M_ARM64)
1814-
// * Pattern for 261xx:
1837+
// * Pattern for 226xx
18151838
// ```
1816-
// E2 82 00 91 E1 03 13 AA E0 03 14 AA ?? ?? ?? ??
1839+
// E3 ?? 00 91 E2 ?? 00 91 E0 03 13 AA ?? ?? ?? ?? F4 03 00 2A
18171840
// ^^^^^^^^^^^
18181841
// ```
1819-
// * Different patterns needed for 226xx and 262xx+
18201842
// Ref: CStartExperienceManager::PositionMenu()
18211843
PBYTE matchGetMonitorInformation = (PBYTE)FindPattern(
18221844
mi->lpBaseOfDll,
18231845
mi->SizeOfImage,
1824-
"\xE2\x82\x00\x91\xE1\x03\x13\xAA\xE0\x03\x14\xAA",
1825-
"xxxxxxxxxxxx"
1846+
"\xE3\x00\x00\x91\xE2\x00\x00\x91\xE0\x03\x13\xAA\x00\x00\x00\x00\xF4\x03\x00\x2A",
1847+
"x?xxx?xxxxxx????xxxx"
18261848
);
18271849
if (matchGetMonitorInformation)
18281850
{
18291851
matchGetMonitorInformation += 12;
18301852
matchGetMonitorInformation = (PBYTE)ARM64_FollowBL((DWORD*)matchGetMonitorInformation);
18311853
}
1854+
if (!matchGetMonitorInformation)
1855+
{
1856+
// * Pattern for 26100.1, 265, 470, 560, 670, 712, 751, 863, 1000, 1150
1857+
// ```
1858+
// E2 82 00 91 E1 03 13 AA E0 03 14 AA ?? ?? ?? ??
1859+
// ^^^^^^^^^^^
1860+
// ```
1861+
// Ref: CStartExperienceManager::PositionMenu()
1862+
matchGetMonitorInformation = (PBYTE)FindPattern(
1863+
mi->lpBaseOfDll,
1864+
mi->SizeOfImage,
1865+
"\xE2\x82\x00\x91\xE1\x03\x13\xAA\xE0\x03\x14\xAA",
1866+
"xxxxxxxxxxxx"
1867+
);
1868+
if (matchGetMonitorInformation)
1869+
{
1870+
matchGetMonitorInformation += 12;
1871+
matchGetMonitorInformation = (PBYTE)ARM64_FollowBL((DWORD*)matchGetMonitorInformation);
1872+
}
1873+
}
1874+
if (!matchGetMonitorInformation)
1875+
{
1876+
// * Pattern for 26100.961, 1252, 1301, 1330, 1340, 1350, 1591, ...
1877+
// ```
1878+
// FF 02 00 39 E2 82 00 91 E0 03 13 AA ?? ?? ?? ??
1879+
// ^^^^^^^^^^^
1880+
// ```
1881+
// Ref: CStartExperienceManager::PositionMenu()
1882+
matchGetMonitorInformation = (PBYTE)FindPattern(
1883+
mi->lpBaseOfDll,
1884+
mi->SizeOfImage,
1885+
"\xFF\x02\x00\x39\xE2\x82\x00\x91\xE0\x03\x13\xAA",
1886+
"xxxxxxxxxxx"
1887+
);
1888+
if (matchGetMonitorInformation)
1889+
{
1890+
matchGetMonitorInformation += 12;
1891+
matchGetMonitorInformation = (PBYTE)ARM64_FollowBL((DWORD*)matchGetMonitorInformation);
1892+
}
1893+
}
18321894
#endif
18331895
if (matchGetMonitorInformation)
18341896
{
@@ -1877,26 +1939,41 @@ BOOL FixStartMenuAnimation(LPMODULEINFO mi)
18771939
#elif defined(_M_ARM64)
18781940
// * Pattern 1, used when all arguments are available:
18791941
// ```
1880-
// Not implemented
1881-
//
1882-
// ```
1883-
// * Pattern 2, used when a4, a5, and a6 are optimized out (e.g. 26020, 26058):
1884-
// ```
1885-
// 82 02 0B 32 67 ?? ?? 91 60 ?? ?? 91 ?? ?? ?? ?? E3 03 00 2A
1942+
// 04 00 80 D2 03 00 80 D2 60 C2 05 91 ?? ?? ?? ?? E3 03 00 2A
18861943
// ^^^^^^^^^^^
18871944
// ```
18881945
// Ref: CJumpViewExperienceManager::OnViewUncloaking()
18891946
PBYTE matchAnimationBegin = (PBYTE)FindPattern(
18901947
mi->lpBaseOfDll,
18911948
mi->SizeOfImage,
1892-
"\x82\x02\x0B\x32\x67\x00\x00\x91\x60\x00\x00\x91\x00\x00\x00\x00\xE3\x03\x00\x2A",
1893-
"xxxxx??xx??x????xxxx"
1949+
"\x04\x00\x80\xD2\x03\x00\x80\xD2\x60\xC2\x05\x91\x00\x00\x00\x00\xE3\x03\x00\x2A",
1950+
"xxxxxxxxxxxx????xxxx"
18941951
);
18951952
if (matchAnimationBegin)
18961953
{
18971954
matchAnimationBegin += 12;
18981955
matchAnimationBegin = (PBYTE)ARM64_FollowBL((DWORD*)matchAnimationBegin);
18991956
}
1957+
else
1958+
{
1959+
// * Pattern 2, used when a4, a5, and a6 are optimized out (e.g. 26020, 26058):
1960+
// ```
1961+
// 82 02 0B 32 67 ?? ?? 91 60 ?? ?? 91 ?? ?? ?? ?? E3 03 00 2A
1962+
// ^^^^^^^^^^^
1963+
// ```
1964+
// Ref: CJumpViewExperienceManager::OnViewUncloaking()
1965+
matchAnimationBegin = (PBYTE)FindPattern(
1966+
mi->lpBaseOfDll,
1967+
mi->SizeOfImage,
1968+
"\x82\x02\x0B\x32\x67\x00\x00\x91\x60\x00\x00\x91\x00\x00\x00\x00\xE3\x03\x00\x2A",
1969+
"xxxxx??xx??x????xxxx"
1970+
);
1971+
if (matchAnimationBegin)
1972+
{
1973+
matchAnimationBegin += 12;
1974+
matchAnimationBegin = (PBYTE)ARM64_FollowBL((DWORD*)matchAnimationBegin);
1975+
}
1976+
}
19001977
#endif
19011978
if (matchAnimationBegin)
19021979
{
@@ -2414,6 +2491,11 @@ namespace ABI::Windows::UI::Xaml
24142491
};
24152492
}
24162493

2494+
static struct
2495+
{
2496+
int jumpViewExperienceManager_rcWorkArea;
2497+
} g_JVPositioningPatchOffsets;
2498+
24172499
HRESULT CJumpViewExperienceManager_CalcWindowPosition(
24182500
RECT rcWork,
24192501
POINT ptAnchor,
@@ -2571,7 +2653,7 @@ HRESULT CJumpViewExperienceManager_EnsureWindowPositionHook(void* _this, CSingle
25712653
RETURN_IF_FAILED(CJumpViewExperienceManager_GetMonitorInformation(
25722654
_this, ptAnchor, &rcWorkArea, &dpi,
25732655
(EDGEUI_TRAYSTUCKPLACE*)((PBYTE)_this + 0x1F0))); // 850
2574-
*((RECT*)((PBYTE)_this + 0x200)) = rcWorkArea;
2656+
*((RECT*)((PBYTE)_this + g_JVPositioningPatchOffsets.jumpViewExperienceManager_rcWorkArea)) = rcWorkArea;
25752657

25762658
int width, height;
25772659
ExperienceManagerUtils::ScaleByDPI(&experience->_desiredSize, dpi, &width, &height);
@@ -2600,14 +2682,14 @@ BOOL FixJumpViewPositioning(MODULEINFO* mi)
26002682
"xxxxxxxxxxxxx"
26012683
);
26022684
#elif defined(_M_ARM64)
2603-
// 08 B0 41 B9 89 0B 80 52
2604-
// ^^^^^^^^^^^
2685+
// ?? ?? 41 B9 89 0B 80 52 A8 01 00 34 1F 05 00 71 20 01 00 54 1F 09 00 71 A0 00 00 54 1F 0D 00 71 01 01 00 54 69 0B 80 52
2686+
// ^^^^^^^^^^^ Important instr. to distinguish from MeetNowExperienceManager::OnViewUncloaking() in GE > !!!!!!!!!!!
26052687
// Ref: CJumpViewExperienceManager::OnViewCloaking()
26062688
PBYTE matchOffsetTrayStuckPlace = (PBYTE)FindPattern(
26072689
mi->lpBaseOfDll,
26082690
mi->SizeOfImage,
2609-
"\x08\xB0\x41\xB9\x89\x0B\x80\x52",
2610-
"xxxxxxxx"
2691+
"\x41\xB9\x89\x0B\x80\x52\xA8\x01\x00\x34\x1F\x05\x00\x71\x20\x01\x00\x54\x1F\x09\x00\x71\xA0\x00\x00\x54\x1F\x0D\x00\x71\x01\x01\x00\x54\x69\x0B\x80\x52",
2692+
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
26112693
);
26122694
#endif
26132695
if (matchOffsetTrayStuckPlace)
@@ -2618,30 +2700,60 @@ BOOL FixJumpViewPositioning(MODULEINFO* mi)
26182700
// RECT CJumpViewExperienceManager::m_rcWorkArea
26192701
PBYTE matchOffsetRcWorkArea = nullptr;
26202702
#if defined(_M_X64)
2621-
// 48 8B 53 70 48 8D 83 C0 01 00 00
2703+
// 48 8B 53 70 48 8D 83 ?? ?? ?? ??
26222704
// -- ^^^^^^^^^^^
26232705
// Ref: CJumpViewExperienceManager::OnViewUncloaking()
2706+
// Note: The ref function belongs to SingleViewShellExperienceEventHandler so `this` is +0x40.
2707+
// As long as the above sanity check passes, hardcoding it should be fine.
26242708
if (matchOffsetTrayStuckPlace)
26252709
{
26262710
matchOffsetRcWorkArea = (PBYTE)FindPattern(
26272711
matchOffsetTrayStuckPlace + 13,
26282712
256,
2629-
"\x48\x8B\x53\x70\x48\x8D\x83\xC0\x01\x00\x00",
2630-
"xxxxxxxxxxx"
2713+
"\x48\x8B\x53\x70\x48\x8D\x83",
2714+
"xxxxxxx"
26312715
);
2716+
if (matchOffsetRcWorkArea)
2717+
{
2718+
g_JVPositioningPatchOffsets.jumpViewExperienceManager_rcWorkArea = 0x40 + *(int*)(matchOffsetRcWorkArea + 7);
2719+
}
26322720
}
26332721
#elif defined(_M_ARM64)
2634-
// 01 38 40 F9 07 00 07 91
2635-
// ----------- ^^^^^^^^^^^
2636-
// Ref: CJumpViewExperienceManager::OnViewCloaking()
26372722
if (matchOffsetTrayStuckPlace)
26382723
{
2724+
// Without Feature_TaskbarJumplistOnHover (48980211)
2725+
// 01 38 40 F9 07 00 07 91
2726+
// ----------- ^^^^^^^^^^^
2727+
// If this matches then the offset of m_rcWorkArea is +0x200
2728+
// Ref: CJumpViewExperienceManager::OnViewCloaking()
26392729
matchOffsetRcWorkArea = (PBYTE)FindPattern(
2640-
matchOffsetTrayStuckPlace + 8,
2730+
matchOffsetTrayStuckPlace + 38,
26412731
128,
26422732
"\x01\x38\x40\xF9\x07\x00\x07\x91",
26432733
"xxxxxxxx"
26442734
);
2735+
if (matchOffsetRcWorkArea)
2736+
{
2737+
g_JVPositioningPatchOffsets.jumpViewExperienceManager_rcWorkArea = 0x200;
2738+
}
2739+
if (!matchOffsetRcWorkArea)
2740+
{
2741+
// With Feature_TaskbarJumplistOnHover (48980211)
2742+
// 22 01 03 32 67 32 07 91
2743+
// ^^^^^^^^^^^
2744+
// If this matches then the offset of m_rcWorkArea is +0x20C
2745+
// Ref: CJumpViewExperienceManager::OnViewCloaking()
2746+
matchOffsetRcWorkArea = (PBYTE)FindPattern(
2747+
matchOffsetTrayStuckPlace + 38,
2748+
128,
2749+
"\x22\x01\x03\x32\x67\x32\x07\x91",
2750+
"xxxxxxxx"
2751+
);
2752+
if (matchOffsetRcWorkArea)
2753+
{
2754+
g_JVPositioningPatchOffsets.jumpViewExperienceManager_rcWorkArea = 0x20C;
2755+
}
2756+
}
26452757
}
26462758
#endif
26472759
if (matchOffsetRcWorkArea)
@@ -2651,6 +2763,7 @@ BOOL FixJumpViewPositioning(MODULEINFO* mi)
26512763

26522764
// CJumpViewExperienceManager::EnsureWindowPosition()
26532765
#if defined(_M_X64)
2766+
// Base Nickel and Germanium
26542767
// 8D 4E C0 48 8B ?? E8 ?? ?? ?? ?? 8B
26552768
// ^^^^^^^^^^^
26562769
// Ref: CJumpViewExperienceManager::OnViewPropertiesChanging()
@@ -2665,15 +2778,54 @@ BOOL FixJumpViewPositioning(MODULEINFO* mi)
26652778
matchEnsureWindowPosition += 6;
26662779
matchEnsureWindowPosition += 5 + *(int*)(matchEnsureWindowPosition + 1);
26672780
}
2781+
if (!matchEnsureWindowPosition)
2782+
{
2783+
// Nickel with Feature_TaskbarJumplistOnHover (48980211)
2784+
// - 22621.3930, 3936, 4000, 4010, 4076, 4082, 4110, 4145, ...
2785+
// 4C 8D 76 C0 48 8B D3 49 8B CE E8 ?? ?? ?? ?? 8B
2786+
// ^^^^^^^^^^^
2787+
// Ref: CJumpViewExperienceManager::OnViewPropertiesChanging()
2788+
matchEnsureWindowPosition = (PBYTE)FindPattern(
2789+
mi->lpBaseOfDll,
2790+
mi->SizeOfImage,
2791+
"\x4C\x8D\x76\xC0\x48\x8B\xD3\x49\x8B\xCE\xE8\x00\x00\x00\x00\x8B",
2792+
"xxxxxxxxxxx????x"
2793+
);
2794+
if (matchEnsureWindowPosition)
2795+
{
2796+
matchEnsureWindowPosition += 10;
2797+
matchEnsureWindowPosition += 5 + *(int*)(matchEnsureWindowPosition + 1);
2798+
}
2799+
}
2800+
if (!matchEnsureWindowPosition)
2801+
{
2802+
// Germanium with Feature_TaskbarJumplistOnHover (48980211)
2803+
// - 26100.1350, 1591, ...
2804+
// 48 8B D7 49 8D 4E C0 E8 ?? ?? ?? ?? 8B
2805+
// ^^^^^^^^^^^
2806+
// Ref: CJumpViewExperienceManager::OnViewPropertiesChanging()
2807+
matchEnsureWindowPosition = (PBYTE)FindPattern(
2808+
mi->lpBaseOfDll,
2809+
mi->SizeOfImage,
2810+
"\x48\x8B\xD7\x49\x8D\x4E\xC0\xE8\x00\x00\x00\x00\x8B",
2811+
"xxxxxxxx????x"
2812+
);
2813+
if (matchEnsureWindowPosition)
2814+
{
2815+
matchEnsureWindowPosition += 7;
2816+
matchEnsureWindowPosition += 5 + *(int*)(matchEnsureWindowPosition + 1);
2817+
}
2818+
}
26682819
#elif defined(_M_ARM64)
2669-
// E1 03 15 AA 80 02 01 D1 ?? ?? ?? ?? F3 03 00 2A
2670-
// ^^^^^^^^^^^
2820+
// E1 03 ?? AA ?? 02 01 D1 ?? ?? ?? ?? ?? 03 00 2A
2821+
// !! ^^^^^^^^^^^
2822+
// Do not change this to a wildcard, this byte is important
26712823
// Ref: CJumpViewExperienceManager::OnViewPropertiesChanging()
26722824
PBYTE matchEnsureWindowPosition = (PBYTE)FindPattern(
26732825
mi->lpBaseOfDll,
26742826
mi->SizeOfImage,
2675-
"\xE1\x03\x15\xAA\x80\x02\x01\xD1\x00\x00\x00\x00\xF3\x03\x00\x2A",
2676-
"xxxxxxxx????xxxx"
2827+
"\xE1\x03\x00\xAA\x00\x02\x01\xD1\x00\x00\x00\x00\x00\x03\x00\x2A",
2828+
"xx?x?xxx?????xxx"
26772829
);
26782830
if (matchEnsureWindowPosition)
26792831
{

0 commit comments

Comments
 (0)