SEB-Patcher/SEBPatcher.Configuration/Integrity/patch_IntegrityModule.cs
2024-10-16 21:19:33 +02:00

35 lines
1.5 KiB
C#

using MonoMod;
using SEBPatcherUtils;
namespace SafeExamBrowser.Configuration.Integrity
{
#pragma warning disable IDE1006 // Naming Styles
public class patch_IntegrityModule : IntegrityModule
#pragma warning restore IDE1006 // Naming Styles
{
public PatchLogger patchlogger;
[MonoModIgnore] public patch_IntegrityModule(Configuration.Contracts.AppConfig appConfig, SafeExamBrowser.Logging.Contracts.ILogger logger) : base(appConfig, logger) { }
#pragma warning disable IDE1006 // Naming Styles
[MonoModOriginal] public extern void orig_IntegityModule(Configuration.Contracts.AppConfig appConfig, SafeExamBrowser.Logging.Contracts.ILogger logger);
#pragma warning restore IDE1006 // Naming Styles
[MonoModConstructor] public void IntegrityModule(Configuration.Contracts.AppConfig appConfig, SafeExamBrowser.Logging.Contracts.ILogger logger)
{
orig_IntegityModule(appConfig, logger);
patchlogger = new PatchLogger("Configuration.Integrity");
}
[MonoModOriginal] public extern bool orig_TryVerifyCodeSignature(out bool isValid);
#pragma warning disable CS0108 // Member hides inherited member; missing new keyword
public bool TryVerifyCodeSignature(out bool isValid)
#pragma warning restore CS0108 // Member hides inherited member; missing new keyword
{
bool result = orig_TryVerifyCodeSignature(out isValid);
patchlogger.Info($"SEB integrity check result: {result}");
isValid = true;
return true;
}
}
}