This commit is contained in:
DismissedLight
2024-07-22 13:38:25 +08:00
parent 78726cd2ea
commit ebbaf0e36a
4 changed files with 12 additions and 6 deletions

View File

@@ -29,7 +29,7 @@ internal static class GameFpsAddress
offsetToExecutable += index;
nuint rip = localModule.Executable.Address + (uint)offsetToExecutable;
rip += 5U;
rip += 5U; // advanced to [call jumpCall]
rip += (nuint)(*(int*)(rip + 1U) + 5);
if (*(byte*)rip is ASM_JMP)
@@ -57,6 +57,8 @@ internal static class GameFpsAddress
private static int IndexOfPattern(in ReadOnlySpan<byte> span, out int patternLength)
{
// B9 3C 00 00 00 E8
// mov ecx, 60 : B9 3C 00 00 00
// call ...
ReadOnlySpan<byte> part = [0xB9, 0x3C, 0x00, 0x00, 0x00, 0xE8];
patternLength = part.Length;
return span.IndexOf(part);

View File

@@ -22,8 +22,8 @@ internal sealed class NotifyIconXamlHostWindow : Window, IWindowNeedEraseBackgro
{
Content = new Border();
this.SetLayered();
this.SetToolWindow();
this.SetExStyleLayered();
this.SetExStyleToolWindow();
AppWindow.Title = "SnapHutaoNotifyIconXamlHost";
AppWindow.IsShownInSwitchers = false;
@@ -54,7 +54,7 @@ internal sealed class NotifyIconXamlHostWindow : Window, IWindowNeedEraseBackgro
flyout.ShowAt(Content, new()
{
Placement = FlyoutPlacementMode.Auto,
ShowMode = FlyoutShowMode.Transient,
ShowMode = FlyoutShowMode.Standard,
});
}

View File

@@ -84,7 +84,7 @@ internal static class WindowExtension
ShowWindow(window.GetWindowHandle(), SHOW_WINDOW_CMD.SW_HIDE);
}
public static void SetLayered(this Window window, bool full = true)
public static void SetExStyleLayered(this Window window, bool full = true)
{
HWND hwnd = (HWND)WindowNative.GetWindowHandle(window);
nint style = GetWindowLongPtrW(hwnd, WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE);
@@ -97,7 +97,7 @@ internal static class WindowExtension
}
}
public static void SetToolWindow(this Window window)
public static void SetExStyleToolWindow(this Window window)
{
HWND hwnd = (HWND)WindowNative.GetWindowHandle(window);
nint style = GetWindowLongPtrW(hwnd, WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE);

View File

@@ -72,6 +72,10 @@ internal static class HttpRequestMessageBuilderExtension
ProcessException(messageBuilder, ex);
logger.LogWarning(ex, RequestErrorMessage, builder.RequestUri);
}
catch (OperationCanceledException)
{
showInfo = false;
}
catch (Exception ex)
{
ProcessException(messageBuilder, ex);