-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
38 lines (37 loc) · 1.51 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using Microsoft.Win32;
using Newtonsoft.Json.Linq;
using System.Text;
namespace FPSUnlock
{
internal class FPS
{
public static void Main()
{
var node = Registry.CurrentUser.OpenSubKey("Software")?.OpenSubKey("Cognosphere")?.OpenSubKey("Star Rail", true);
if (node != null)
{
var keyName = node.GetValueNames().FirstOrDefault(x => x.StartsWith("GraphicsSettings_Model"));
if (keyName == null)
{
Console.WriteLine("Failed to get registry content, try changing graphics settings in the game at least once, and try again.");
Console.ReadLine();
return;
}
var key = node.GetValue(keyName);
if (key == null)
{
Console.WriteLine("Failed to get registry content, try changing graphics settings in the game at least once, and try again");
Console.ReadLine();
return;
}
var value = Encoding.UTF8.GetString((byte[])key);
var json = JObject.Parse(value);
Console.WriteLine("Enter your preferred FPS");
json["FPS"] = Console.ReadLine();
node.SetValue(keyName, Encoding.UTF8.GetBytes(json.ToString(Newtonsoft.Json.Formatting.None)));
Console.WriteLine("Successfully patched FPS Unlock");
}
Console.ReadLine();
}
}
}