mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
Fix Desc and All Access
This commit is contained in:
@@ -21,11 +21,11 @@ internal sealed class LaunchStatus
|
||||
{
|
||||
if (unlockerState.FindModuleResult == FindModuleResult.Ok)
|
||||
{
|
||||
return new(LaunchPhase.UnlockFpsSucceed, SH.ServiceGameLaunchPhaseUnlockFpsSucceed);
|
||||
return new(LaunchPhase.UnlockFpsSucceed, unlockerState.Description ?? SH.ServiceGameLaunchPhaseUnlockFpsSucceed);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new(LaunchPhase.UnlockFpsFailed, SH.ServiceGameLaunchPhaseUnlockFpsFailed);
|
||||
return new(LaunchPhase.UnlockFpsFailed, unlockerState.Description ?? SH.ServiceGameLaunchPhaseUnlockFpsFailed);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,10 +48,11 @@ internal static class GameFpsAddress
|
||||
return memory.IndexOf(part);
|
||||
}
|
||||
|
||||
private static unsafe bool UnsafeReadProcessMemory(HANDLE processId, nuint baseAddress, out nuint value)
|
||||
[SuppressMessage("", "SH002")]
|
||||
private static unsafe bool UnsafeReadProcessMemory(HANDLE hProcess, nuint baseAddress, out nuint value)
|
||||
{
|
||||
value = 0;
|
||||
bool result = ReadProcessMemory(processId, (void*)baseAddress, ref value, out _);
|
||||
bool result = ReadProcessMemory(hProcess, (void*)baseAddress, ref value, out _);
|
||||
HutaoException.ThrowIfNot(result, SH.ServiceGameUnlockerReadProcessMemoryPointerAddressFailed);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ internal sealed class GameFpsUnlocker : IGameFpsUnlocker
|
||||
{
|
||||
if (!context.GameProcess.HasExited && context.FpsAddress != 0U)
|
||||
{
|
||||
UnsafeWriteProcessMemory(context.GameProcess, context.FpsAddress, launchOptions.TargetFps);
|
||||
UnsafeWriteProcessMemory(context.AllAccess, context.FpsAddress, launchOptions.TargetFps);
|
||||
WIN32_ERROR error = GetLastError();
|
||||
if (error is not WIN32_ERROR.NO_ERROR)
|
||||
{
|
||||
@@ -75,9 +75,10 @@ internal sealed class GameFpsUnlocker : IGameFpsUnlocker
|
||||
}
|
||||
}
|
||||
|
||||
private static unsafe bool UnsafeWriteProcessMemory(System.Diagnostics.Process process, nuint baseAddress, int value)
|
||||
[SuppressMessage("", "SH002")]
|
||||
private static unsafe bool UnsafeWriteProcessMemory(HANDLE hProcess, nuint baseAddress, int value)
|
||||
{
|
||||
return WriteProcessMemory((Win32.Foundation.HANDLE)process.Handle, (void*)baseAddress, ref value, out _);
|
||||
return WriteProcessMemory(hProcess, (void*)baseAddress, ref value, out _);
|
||||
}
|
||||
|
||||
private static RequiredLocalModule LoadRequiredLocalModule(GameFileSystem gameFileSystem)
|
||||
|
||||
Reference in New Issue
Block a user