Skip to content

Commit

Permalink
restruct: unlock GI 4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
emako committed Aug 4, 2024
1 parent ddc3f3b commit 9ce1421
Show file tree
Hide file tree
Showing 8 changed files with 368 additions and 750 deletions.
2 changes: 2 additions & 0 deletions build/setup_publish.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ echo [build app using vs2022]
cd ..\src\
dotnet restore
dotnet publish -c Release -p:PublishProfile=FolderProfile
msbuild Desktop\Fischless.UnityPatch\Fischless.UnityPatch.vcxproj /t:Rebuild /p:Configuration=Release /p:OutDir=".\x64\Release"
cd /d %~dp0

echo [pack app using 7z]
copy ..\src\Desktop\Fischless.UnityPatch\x64\Release\Fischless.UnityPatch.dll ..\src\Desktop\Fischless\bin\x64\Release\net8.0-windows10.0.22621.0\publish\win-x64\
del ..\src\Desktop\Fischless\bin\x64\Release\net8.0-windows10.0.22621.0\publish\win-x64\*.pdb
mkdir ..\src\Desktop\Fischless\bin\x64\Release\net8.0-windows10.0.22621.0\publish\win-x64\Plugins\
copy ..\src\Plugins\Fischless.Plugin.DisplayDefault\bin\x64\Release\net8.0-windows10.0.22621.0\publish\win-x64\Fischless.Plugin.DisplayDefault.dll ..\src\Desktop\Fischless\bin\x64\Release\net8.0-windows10.0.22621.0\publish\win-x64\Plugins
Expand Down
2 changes: 0 additions & 2 deletions src/Desktop/Fischless.Fetch/Launch/GILauncher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ public static async Task LaunchAsync(int? delayMs = null, GIRelaunchMethod relau
Verb = "runas",
});

#if false // Not stabled to unlock.
if (launchParameter.Fps > 60)
{
try
Expand All @@ -198,7 +197,6 @@ public static async Task LaunchAsync(int? delayMs = null, GIRelaunchMethod relau
{
}
}
#endif
}

public static async Task<bool> TryGetProcessAsync(Func<Process?, Task> callback = null!)
Expand Down
516 changes: 5 additions & 511 deletions src/Desktop/Fischless.Fetch/Unlocker/GameFpsUnlockerImpl.cs

Large diffs are not rendered by default.

553 changes: 332 additions & 221 deletions src/Desktop/Fischless.UnityPatch/pch.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Desktop/Fischless.UnityPatch/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "framework.h"

extern "C" {
__declspec(dllexport) DWORD64 inject_patch(LPVOID unity_module, DWORD64 unity_baseaddr, DWORD64 _ptr_fps, HANDLE Tar_handle, int FpsValue);
__declspec(dllexport) int unlock(int pid, int targetFPS);
}

#endif //PCH_H
6 changes: 3 additions & 3 deletions src/Desktop/Fischless/Fischless.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DefineConstants>$(DefineConstants);_DEMOPRO</DefineConstants>
<FileAlignment>512</FileAlignment>
<DefineConstants>$(DefineConstants);_DEMOPRO</DefineConstants>
<FileAlignment>512</FileAlignment>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<FileAlignment>512</FileAlignment>
<FileAlignment>512</FileAlignment>
</PropertyGroup>

<ItemGroup>
Expand Down
26 changes: 14 additions & 12 deletions src/Desktop/Fischless/ViewModels/Pages/PageHomeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,20 @@ private static async Task LaunchGameAsync(Contact contact)
.Verb("runas")
.Start()
.WaitForExit();

_ = Task.Run(async () =>
{
await Task.Delay(5000);

FluentProcess netsh2 = FluentProcess.Create()
.FileName("netsh")
.Arguments(@"advfirewall firewall delete rule name=""DIS_GENSHIN_NETWORK""")
.CreateNoWindow()
.UseShellExecute(false)
.Verb("runas")
.Start()
.WaitForExit();
});
}

if (Configurations.IsUseReShade.Get() && Directory.Exists(Configurations.ReShadePath.Get()))
Expand All @@ -245,18 +259,6 @@ private static async Task LaunchGameAsync(Contact contact)
ScreenHeight = Configurations.IsUseResolution.Get() ? Configurations.ResolutionHeight.Get() : null,
Fps = Configurations.IsUseFps.Get() ? Configurations.Fps.Get() : null,
});

await Task.Delay(3000);

// TODO: unlocker
FluentProcess netsh2 = FluentProcess.Create()
.FileName("netsh")
.Arguments(@"advfirewall firewall delete rule name=""DIS_GENSHIN_NETWORK""")
.CreateNoWindow()
.UseShellExecute(false)
.Verb("runas")
.Start()
.WaitForExit();
}
catch (Exception e)
{
Expand Down
11 changes: 11 additions & 0 deletions src/Fischless.sln
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fischless.SpaceX", "Indeed\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fischless.SnapAvatar", "Indeed\Fischless.SnapAvatar\Fischless.SnapAvatar.csproj", "{66225366-305B-449C-95C4-A9475101702F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Fischless.UnityPatch", "Desktop\Fischless.UnityPatch\Fischless.UnityPatch.vcxproj", "{DF20E855-D5FF-4157-BD9A-1713239DB85F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -418,6 +420,14 @@ Global
{66225366-305B-449C-95C4-A9475101702F}.Release|Any CPU.Build.0 = Release|x64
{66225366-305B-449C-95C4-A9475101702F}.Release|x64.ActiveCfg = Release|x64
{66225366-305B-449C-95C4-A9475101702F}.Release|x64.Build.0 = Release|x64
{DF20E855-D5FF-4157-BD9A-1713239DB85F}.Debug|Any CPU.ActiveCfg = Debug|x64
{DF20E855-D5FF-4157-BD9A-1713239DB85F}.Debug|Any CPU.Build.0 = Debug|x64
{DF20E855-D5FF-4157-BD9A-1713239DB85F}.Debug|x64.ActiveCfg = Debug|x64
{DF20E855-D5FF-4157-BD9A-1713239DB85F}.Debug|x64.Build.0 = Debug|x64
{DF20E855-D5FF-4157-BD9A-1713239DB85F}.Release|Any CPU.ActiveCfg = Release|x64
{DF20E855-D5FF-4157-BD9A-1713239DB85F}.Release|Any CPU.Build.0 = Release|x64
{DF20E855-D5FF-4157-BD9A-1713239DB85F}.Release|x64.ActiveCfg = Release|x64
{DF20E855-D5FF-4157-BD9A-1713239DB85F}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -462,6 +472,7 @@ Global
{ACFC4246-FB31-42CA-A5D9-48D25813F713} = {E5066E35-23C6-4F4E-8FDE-70EDE1745346}
{E8437A1D-F64F-440D-BFF2-BC97AFF0BE5E} = {E5066E35-23C6-4F4E-8FDE-70EDE1745346}
{66225366-305B-449C-95C4-A9475101702F} = {E5066E35-23C6-4F4E-8FDE-70EDE1745346}
{DF20E855-D5FF-4157-BD9A-1713239DB85F} = {2944494E-EB09-4387-9677-BB38A224A624}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
RESX_SortFileContentOnSave = True
Expand Down

0 comments on commit 9ce1421

Please sign in to comment.