From eb4134247c7dabd4a99029acb9b159e2e133c1c0 Mon Sep 17 00:00:00 2001 From: Loudbook Date: Sun, 15 Sep 2024 10:58:20 -0400 Subject: [PATCH] Allow patches --- .../LogInspect/Inspectors/HJT/HjtInspector.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/loginspect/LogInspect/LogInspect/Inspectors/HJT/HjtInspector.cs b/loginspect/LogInspect/LogInspect/Inspectors/HJT/HjtInspector.cs index 7cf0a9a..3dda664 100644 --- a/loginspect/LogInspect/LogInspect/Inspectors/HJT/HjtInspector.cs +++ b/loginspect/LogInspect/LogInspect/Inspectors/HJT/HjtInspector.cs @@ -17,6 +17,20 @@ public HjtInspector() throw new Exception("Failed to deserialize HJT flags"); } + if (!File.Exists($"{Program.DataPath}/HjtPatches.json")) + { + File.WriteAllText($"{Program.DataPath}/HjtPatches.json", "[]"); + } + + var patchesJson = File.ReadAllText($"{Program.DataPath}/HjtPatches.json"); + var patches = JsonSerializer.Deserialize>(patchesJson); + + if (patches == null) + { + throw new Exception("Failed to deserialize HJT patches"); + } + + flags.AddRange(patches); _flags.AddRange(flags); }