Integrate SafeExamBrowser.Client
This commit is contained in:
parent
b2e2d340b7
commit
31e2fa1264
12 changed files with 264 additions and 5 deletions
|
@ -36,6 +36,8 @@ SafeExamBrowser: [https://safeexambrowser.org/download_en.html](https://safeexam
|
||||||
|
|
||||||
MonoMod: [https://github.com/MonoMod/MonoMod](https://github.com/MonoMod/MonoMod)
|
MonoMod: [https://github.com/MonoMod/MonoMod](https://github.com/MonoMod/MonoMod)
|
||||||
|
|
||||||
|
stripping/publicizing for development: [https://github.com/bbepis/NStrip](https://github.com/bbepis/NStrip)
|
||||||
|
|
||||||
**Learning Resources**
|
**Learning Resources**
|
||||||
|
|
||||||
SafeExamBrowser sourcecode: [https://github.com/SafeExamBrowser/seb-win-refactoring](https://github.com/SafeExamBrowser/seb-win-refactoring)
|
SafeExamBrowser sourcecode: [https://github.com/SafeExamBrowser/seb-win-refactoring](https://github.com/SafeExamBrowser/seb-win-refactoring)
|
||||||
|
@ -44,6 +46,8 @@ MonoMod API documentation: [https://monomod.github.io/api/index.html](https://mo
|
||||||
|
|
||||||
MonoMod step-by-step example implementation: [https://github.com/TROYTRON/ti-mods/blob/main/tutorials/MonoMod%20Guide.md](https://github.com/TROYTRON/ti-mods/blob/main/tutorials/MonoMod%20Guide.md)
|
MonoMod step-by-step example implementation: [https://github.com/TROYTRON/ti-mods/blob/main/tutorials/MonoMod%20Guide.md](https://github.com/TROYTRON/ti-mods/blob/main/tutorials/MonoMod%20Guide.md)
|
||||||
|
|
||||||
|
Example patch by MonoMod: [https://monomod.dev/docs/README.Patcher.html](https://monomod.dev/docs/README.Patcher.html)
|
||||||
|
|
||||||
dnSpy decomp/analysis tool: [https://github.com/dnSpyEx/dnSpy](https://github.com/dnSpyEx/dnSpy)
|
dnSpy decomp/analysis tool: [https://github.com/dnSpyEx/dnSpy](https://github.com/dnSpyEx/dnSpy)
|
||||||
|
|
||||||
sandbox for testing modifications (if you cant host a seb server): [https://sandbox.moodledemo.net](https://sandbox.moodledemo.net)
|
sandbox for testing modifications (if you cant host a seb server): [https://sandbox.moodledemo.net](https://sandbox.moodledemo.net)
|
||||||
|
|
26
SEBPatcher.Client/Properties/AssemblyInfo.cs
Normal file
26
SEBPatcher.Client/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
|
// Information about this assembly is defined by the following attributes.
|
||||||
|
// Change them to the values specific to your project.
|
||||||
|
|
||||||
|
[assembly: AssemblyTitle("SEBPatcher.Client")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("")]
|
||||||
|
[assembly: AssemblyCopyright("${AuthorCopyright}")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||||
|
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||||
|
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||||
|
|
||||||
|
[assembly: AssemblyVersion("1.0.*")]
|
||||||
|
|
||||||
|
// The following attributes are used to specify the signing key for the assembly,
|
||||||
|
// if desired. See the Mono documentation for more information about signing.
|
||||||
|
|
||||||
|
//[assembly: AssemblyDelaySign(false)]
|
||||||
|
//[assembly: AssemblyKeyFile("")]
|
142
SEBPatcher.Client/SEBPatcher.Client.csproj
Normal file
142
SEBPatcher.Client/SEBPatcher.Client.csproj
Normal file
|
@ -0,0 +1,142 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{48A5F9AC-B556-4F24-990C-017E485790D2}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<RootNamespace>SEBPatcher.Client</RootNamespace>
|
||||||
|
<AssemblyName>SafeExamBrowser.Client.SEBPatcher.mm</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<ConsolePause>false</ConsolePause>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release</OutputPath>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<ConsolePause>false</ConsolePause>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="MonoMod">
|
||||||
|
<HintPath>$(ReferenceBasePath)\MonoMod.exe</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="0Harmony">
|
||||||
|
<HintPath>$(ReferenceBasePath)\0Harmony.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Mono.Cecil">
|
||||||
|
<HintPath>$(ReferenceBasePath)\Mono.Cecil.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Mono.Cecil.Mdb">
|
||||||
|
<HintPath>$(ReferenceBasePath)\Mono.Cecil.Mdb.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Mono.Cecil.Pdb">
|
||||||
|
<HintPath>$(ReferenceBasePath)\Mono.Cecil.Pdb.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Mono.Cecil.Rocks">
|
||||||
|
<HintPath>$(ReferenceBasePath)\Mono.Cecil.Rocks.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MonoMod.Common">
|
||||||
|
<HintPath>$(ReferenceBasePath)\MonoMod.Common.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MonoMod.RuntimeDetour">
|
||||||
|
<HintPath>$(ReferenceBasePath)\MonoMod.RuntimeDetour.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MonoMod.UnitTest">
|
||||||
|
<HintPath>$(ReferenceBasePath)\MonoMod.UnitTest.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MonoMod.Utils">
|
||||||
|
<HintPath>$(ReferenceBasePath)\MonoMod.Utils.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.Client-nstrip">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Client-nstrip.exe</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.UserInterface.Contracts">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.UserInterface.Contracts.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.Monitoring.Contracts">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Monitoring.Contracts.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.WindowsApi">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.WindowsApi.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.WindowsApi.Contracts">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.WindowsApi.Contracts.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.Configuration">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Configuration.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.Configuration.Contracts">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Configuration.Contracts.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.Logging">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Logging.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.Logging.Contracts">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Logging.Contracts.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.SystemComponents">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.SystemComponents.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.SystemComponents.Contracts">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.SystemComponents.Contracts.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.Core">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Core.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.Core.Contracts">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Core.Contracts.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.Communication.Contracts">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Communication.Contracts.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.Communication">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Communication.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.I18n">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.I18n.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SafeExamBrowser.I18n.Contracts">
|
||||||
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.I18n.Contracts.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="patch_ClientController.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\SEBPatcherUtils\SEBPatcherUtils.csproj">
|
||||||
|
<Project>{82F861DC-D8C7-46F9-AA60-B67CF43712D5}</Project>
|
||||||
|
<Name>SEBPatcherUtils</Name>
|
||||||
|
<Private>False</Private>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
34
SEBPatcher.Client/patch_ClientController.cs
Normal file
34
SEBPatcher.Client/patch_ClientController.cs
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
using System;
|
||||||
|
using MonoMod;
|
||||||
|
using SEBPatcherUtils;
|
||||||
|
using System.Security.Permissions;
|
||||||
|
using SafeExamBrowser.Client.Contracts;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618 // Type or member is obsolete
|
||||||
|
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
|
||||||
|
#pragma warning restore CS0618 // Type or member is obsolete
|
||||||
|
|
||||||
|
namespace SafeExamBrowser.Client
|
||||||
|
{
|
||||||
|
#pragma warning disable IDE1006 // Naming Styles
|
||||||
|
internal class patch_ClientController : ClientController
|
||||||
|
#pragma warning restore IDE1006 // Naming Styles
|
||||||
|
{
|
||||||
|
public PatchLogger patchlogger;
|
||||||
|
|
||||||
|
[MonoModIgnore] internal patch_ClientController(SafeExamBrowser.UserInterface.Contracts.Shell.IActionCenter actionCenter, SafeExamBrowser.Monitoring.Contracts.Applications.IApplicationMonitor applicationMonitor, ClientContext context, ICoordinator coordinator, SafeExamBrowser.Monitoring.Contracts.Display.IDisplayMonitor displayMonitor, SafeExamBrowser.WindowsApi.Contracts.IExplorerShell explorerShell, SafeExamBrowser.UserInterface.Contracts.FileSystemDialog.IFileSystemDialog fileSystemDialog, SafeExamBrowser.Configuration.Contracts.Cryptography.IHashAlgorithm hashAlgorithm, SafeExamBrowser.Logging.Contracts.ILogger logger, SafeExamBrowser.UserInterface.Contracts.MessageBox.IMessageBox messageBox, SafeExamBrowser.SystemComponents.Contracts.Network.INetworkAdapter networkAdapter, SafeExamBrowser.Core.Contracts.OperationModel.IOperationSequence operations, SafeExamBrowser.Communication.Contracts.Proxies.IRuntimeProxy runtime, Action shutdown, SafeExamBrowser.UserInterface.Contracts.Windows.ISplashScreen splashScreen, SafeExamBrowser.Monitoring.Contracts.System.ISystemSentinel sentinel, SafeExamBrowser.UserInterface.Contracts.Shell.ITaskbar taskbar, SafeExamBrowser.I18n.Contracts.IText text, SafeExamBrowser.UserInterface.Contracts.IUserInterfaceFactory uiFactory) : base(actionCenter, applicationMonitor, context, coordinator, displayMonitor, explorerShell, fileSystemDialog, hashAlgorithm, logger, messageBox, networkAdapter, operations, runtime, shutdown, splashScreen, sentinel, taskbar, text, uiFactory) { }
|
||||||
|
#pragma warning disable IDE1006 // Naming Styles
|
||||||
|
#pragma warning disable RECS0082 // Parameter has the same name as a member and hides it
|
||||||
|
[MonoModOriginal] internal extern void orig_ClientController(SafeExamBrowser.UserInterface.Contracts.Shell.IActionCenter actionCenter, SafeExamBrowser.Monitoring.Contracts.Applications.IApplicationMonitor applicationMonitor, ClientContext context, ICoordinator coordinator, SafeExamBrowser.Monitoring.Contracts.Display.IDisplayMonitor displayMonitor, SafeExamBrowser.WindowsApi.Contracts.IExplorerShell explorerShell, SafeExamBrowser.UserInterface.Contracts.FileSystemDialog.IFileSystemDialog fileSystemDialog, SafeExamBrowser.Configuration.Contracts.Cryptography.IHashAlgorithm hashAlgorithm, SafeExamBrowser.Logging.Contracts.ILogger logger, SafeExamBrowser.UserInterface.Contracts.MessageBox.IMessageBox messageBox, SafeExamBrowser.SystemComponents.Contracts.Network.INetworkAdapter networkAdapter, SafeExamBrowser.Core.Contracts.OperationModel.IOperationSequence operations, SafeExamBrowser.Communication.Contracts.Proxies.IRuntimeProxy runtime, Action shutdown, SafeExamBrowser.UserInterface.Contracts.Windows.ISplashScreen splashScreen, SafeExamBrowser.Monitoring.Contracts.System.ISystemSentinel sentinel, SafeExamBrowser.UserInterface.Contracts.Shell.ITaskbar taskbar, SafeExamBrowser.I18n.Contracts.IText text, SafeExamBrowser.UserInterface.Contracts.IUserInterfaceFactory uiFactory);
|
||||||
|
#pragma warning restore RECS0082 // Parameter has the same name as a member and hides it
|
||||||
|
#pragma warning restore IDE1006 // Naming Styles
|
||||||
|
#pragma warning disable RECS0082 // Parameter has the same name as a member and hides it
|
||||||
|
[MonoModConstructor] internal void ClientController(SafeExamBrowser.UserInterface.Contracts.Shell.IActionCenter actionCenter, SafeExamBrowser.Monitoring.Contracts.Applications.IApplicationMonitor applicationMonitor, ClientContext context, ICoordinator coordinator, SafeExamBrowser.Monitoring.Contracts.Display.IDisplayMonitor displayMonitor, SafeExamBrowser.WindowsApi.Contracts.IExplorerShell explorerShell, SafeExamBrowser.UserInterface.Contracts.FileSystemDialog.IFileSystemDialog fileSystemDialog, SafeExamBrowser.Configuration.Contracts.Cryptography.IHashAlgorithm hashAlgorithm, SafeExamBrowser.Logging.Contracts.ILogger logger, SafeExamBrowser.UserInterface.Contracts.MessageBox.IMessageBox messageBox, SafeExamBrowser.SystemComponents.Contracts.Network.INetworkAdapter networkAdapter, SafeExamBrowser.Core.Contracts.OperationModel.IOperationSequence operations, SafeExamBrowser.Communication.Contracts.Proxies.IRuntimeProxy runtime, Action shutdown, SafeExamBrowser.UserInterface.Contracts.Windows.ISplashScreen splashScreen, SafeExamBrowser.Monitoring.Contracts.System.ISystemSentinel sentinel, SafeExamBrowser.UserInterface.Contracts.Shell.ITaskbar taskbar, SafeExamBrowser.I18n.Contracts.IText text, SafeExamBrowser.UserInterface.Contracts.IUserInterfaceFactory uiFactory)
|
||||||
|
#pragma warning restore RECS0082 // Parameter has the same name as a member and hides it
|
||||||
|
{
|
||||||
|
orig_ClientController(actionCenter, applicationMonitor, context, coordinator, displayMonitor, explorerShell, fileSystemDialog, hashAlgorithm, logger, messageBox, networkAdapter, operations, runtime, shutdown, splashScreen, sentinel, taskbar, text, uiFactory);
|
||||||
|
patchlogger = new PatchLogger("Client.ClientController");
|
||||||
|
patchlogger.Info("Client loaded!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,15 +1,18 @@
|
||||||
using System;
|
using MonoMod;
|
||||||
using MonoMod;
|
|
||||||
using SEBPatcherUtils;
|
using SEBPatcherUtils;
|
||||||
|
|
||||||
namespace SafeExamBrowser.Configuration.Integrity
|
namespace SafeExamBrowser.Configuration.Integrity
|
||||||
{
|
{
|
||||||
|
#pragma warning disable IDE1006 // Naming Styles
|
||||||
public class patch_IntegrityModule : IntegrityModule
|
public class patch_IntegrityModule : IntegrityModule
|
||||||
|
#pragma warning restore IDE1006 // Naming Styles
|
||||||
{
|
{
|
||||||
public PatchLogger patchlogger;
|
public PatchLogger patchlogger;
|
||||||
|
|
||||||
[MonoModIgnore] public patch_IntegrityModule(Configuration.Contracts.AppConfig appConfig, SafeExamBrowser.Logging.Contracts.ILogger logger) : base(appConfig, logger) { }
|
[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);
|
[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)
|
[MonoModConstructor] public void IntegrityModule(Configuration.Contracts.AppConfig appConfig, SafeExamBrowser.Logging.Contracts.ILogger logger)
|
||||||
{
|
{
|
||||||
orig_IntegityModule(appConfig, logger);
|
orig_IntegityModule(appConfig, logger);
|
|
@ -60,17 +60,20 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SafeExamBrowser.Configuration">
|
<Reference Include="SafeExamBrowser.Configuration">
|
||||||
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Configuration.dll</HintPath>
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Configuration.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SafeExamBrowser.Logging.Contracts">
|
<Reference Include="SafeExamBrowser.Logging.Contracts">
|
||||||
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Logging.Contracts.dll</HintPath>
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Logging.Contracts.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SafeExamBrowser.Configuration.Contracts">
|
<Reference Include="SafeExamBrowser.Configuration.Contracts">
|
||||||
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Configuration.Contracts.dll</HintPath>
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Configuration.Contracts.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="patch_IntegrityModule.cs" />
|
<Compile Include="Integrity\patch_IntegrityModule.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\SEBPatcherUtils\SEBPatcherUtils.csproj">
|
<ProjectReference Include="..\SEBPatcherUtils\SEBPatcherUtils.csproj">
|
||||||
|
@ -78,5 +81,8 @@
|
||||||
<Name>SEBPatcherUtils</Name>
|
<Name>SEBPatcherUtils</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Integrity\" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
|
@ -15,7 +15,9 @@ namespace SafeExamBrowser.Monitoring.Display
|
||||||
public PatchLogger patchlogger;
|
public PatchLogger patchlogger;
|
||||||
|
|
||||||
[MonoModIgnore] public patch_DisplayMonitor(ILogger logger, INativeMethods nativeMethods, ISystemInfo systemInfo) : base(logger, nativeMethods, systemInfo) { }
|
[MonoModIgnore] public patch_DisplayMonitor(ILogger logger, INativeMethods nativeMethods, ISystemInfo systemInfo) : base(logger, nativeMethods, systemInfo) { }
|
||||||
|
#pragma warning disable IDE1006 // Naming Styles
|
||||||
[MonoModOriginal] public extern void orig_DisplayMonitor(ILogger logger, INativeMethods nativeMethods, ISystemInfo systemInfo);
|
[MonoModOriginal] public extern void orig_DisplayMonitor(ILogger logger, INativeMethods nativeMethods, ISystemInfo systemInfo);
|
||||||
|
#pragma warning restore IDE1006 // Naming Styles
|
||||||
[MonoModConstructor] public void DisplayMonitor(ILogger logger, INativeMethods nativeMethods, ISystemInfo systemInfo)
|
[MonoModConstructor] public void DisplayMonitor(ILogger logger, INativeMethods nativeMethods, ISystemInfo systemInfo)
|
||||||
{
|
{
|
||||||
orig_DisplayMonitor(logger, nativeMethods, systemInfo);
|
orig_DisplayMonitor(logger, nativeMethods, systemInfo);
|
||||||
|
@ -30,7 +32,7 @@ namespace SafeExamBrowser.Monitoring.Display
|
||||||
#pragma warning restore CS0108 // Member hides inherited member; missing new keyword
|
#pragma warning restore CS0108 // Member hides inherited member; missing new keyword
|
||||||
{
|
{
|
||||||
ValidationResult result = orig_ValidateConfiguration(settings);
|
ValidationResult result = orig_ValidateConfiguration(settings);
|
||||||
|
|
||||||
patchlogger.Info($"SEB display validation result: {result}");
|
patchlogger.Info($"SEB display validation result: {result}");
|
||||||
|
|
||||||
return new ValidationResult
|
return new ValidationResult
|
||||||
|
|
26
SEBPatcher.Monitoring/Keyboard/patch_KeyboardInterceptor.cs
Normal file
26
SEBPatcher.Monitoring/Keyboard/patch_KeyboardInterceptor.cs
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
using System;
|
||||||
|
using MonoMod;
|
||||||
|
using SEBPatcherUtils;
|
||||||
|
using SafeExamBrowser.Logging.Contracts;
|
||||||
|
using SafeExamBrowser.Settings.Monitoring;
|
||||||
|
using SafeExamBrowser.WindowsApi.Contracts;
|
||||||
|
|
||||||
|
namespace SafeExamBrowser.Monitoring.Keyboard
|
||||||
|
{
|
||||||
|
#pragma warning disable IDE1006 // Naming Styles
|
||||||
|
public class patch_KeyboardInterceptor : KeyboardInterceptor
|
||||||
|
#pragma warning restore IDE1006 // Naming Styles
|
||||||
|
{
|
||||||
|
public PatchLogger patchlogger;
|
||||||
|
|
||||||
|
[MonoModIgnore] public patch_KeyboardInterceptor(ILogger logger, INativeMethods nativeMethods, KeyboardSettings settings) : base(logger, nativeMethods, settings) { }
|
||||||
|
#pragma warning disable IDE1006 // Naming Styles
|
||||||
|
[MonoModOriginal] public extern void orig_KeyboardInterceptor(ILogger logger, INativeMethods nativeMethods, KeyboardSettings settings);
|
||||||
|
#pragma warning restore IDE1006 // Naming Styles
|
||||||
|
[MonoModConstructor] public void KeyboardInterceptor(ILogger logger, INativeMethods nativeMethods, KeyboardSettings settings)
|
||||||
|
{
|
||||||
|
orig_KeyboardInterceptor(logger, nativeMethods, settings);
|
||||||
|
patchlogger = new PatchLogger("Monitoring.Keyboard.KeyboardInterceptor");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -51,12 +51,15 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SafeExamBrowser.Logging.Contracts">
|
<Reference Include="SafeExamBrowser.Logging.Contracts">
|
||||||
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Logging.Contracts.dll</HintPath>
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Logging.Contracts.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SafeExamBrowser.Monitoring">
|
<Reference Include="SafeExamBrowser.Monitoring">
|
||||||
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Monitoring.dll</HintPath>
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Monitoring.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SafeExamBrowser.SystemComponents.Contracts">
|
<Reference Include="SafeExamBrowser.SystemComponents.Contracts">
|
||||||
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.SystemComponents.Contracts.dll</HintPath>
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.SystemComponents.Contracts.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="0Harmony">
|
<Reference Include="0Harmony">
|
||||||
<HintPath>$(ReferenceBasePath)\0Harmony.dll</HintPath>
|
<HintPath>$(ReferenceBasePath)\0Harmony.dll</HintPath>
|
||||||
|
@ -69,12 +72,15 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SafeExamBrowser.WindowsApi.Contracts">
|
<Reference Include="SafeExamBrowser.WindowsApi.Contracts">
|
||||||
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.WindowsApi.Contracts.dll</HintPath>
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.WindowsApi.Contracts.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SafeExamBrowser.Settings">
|
<Reference Include="SafeExamBrowser.Settings">
|
||||||
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Settings.dll</HintPath>
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Settings.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SafeExamBrowser.Monitoring.Contracts">
|
<Reference Include="SafeExamBrowser.Monitoring.Contracts">
|
||||||
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Monitoring.Contracts.dll</HintPath>
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Monitoring.Contracts.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -83,9 +89,11 @@
|
||||||
<Compile Include="patch_Clipboard.cs" />
|
<Compile Include="patch_Clipboard.cs" />
|
||||||
<Compile Include="patch_RemoteSessionDetector.cs" />
|
<Compile Include="patch_RemoteSessionDetector.cs" />
|
||||||
<Compile Include="Display\patch_DisplayMonitor.cs" />
|
<Compile Include="Display\patch_DisplayMonitor.cs" />
|
||||||
|
<Compile Include="Keyboard\patch_KeyboardInterceptor.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Display\" />
|
<Folder Include="Display\" />
|
||||||
|
<Folder Include="Keyboard\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\SEBPatcherUtils\SEBPatcherUtils.csproj">
|
<ProjectReference Include="..\SEBPatcherUtils\SEBPatcherUtils.csproj">
|
||||||
|
|
|
@ -11,7 +11,9 @@ namespace SafeExamBrowser.Monitoring
|
||||||
public PatchLogger patchlogger;
|
public PatchLogger patchlogger;
|
||||||
|
|
||||||
[MonoModIgnore] public patch_Clipboard(ILogger logger, SafeExamBrowser.WindowsApi.Contracts.INativeMethods nativeMethods, int timeout_ms = 50) : base(logger, nativeMethods, timeout_ms) { }
|
[MonoModIgnore] public patch_Clipboard(ILogger logger, SafeExamBrowser.WindowsApi.Contracts.INativeMethods nativeMethods, int timeout_ms = 50) : base(logger, nativeMethods, timeout_ms) { }
|
||||||
|
#pragma warning disable IDE1006 // Naming Styles
|
||||||
[MonoModOriginal] public extern void orig_Clipboard(ILogger logger, SafeExamBrowser.WindowsApi.Contracts.INativeMethods nativeMethods, int timeout_ms = 50);
|
[MonoModOriginal] public extern void orig_Clipboard(ILogger logger, SafeExamBrowser.WindowsApi.Contracts.INativeMethods nativeMethods, int timeout_ms = 50);
|
||||||
|
#pragma warning restore IDE1006 // Naming Styles
|
||||||
[MonoModConstructor] public void Clipboard(ILogger logger, SafeExamBrowser.WindowsApi.Contracts.INativeMethods nativeMethods, int timeout_ms = 50)
|
[MonoModConstructor] public void Clipboard(ILogger logger, SafeExamBrowser.WindowsApi.Contracts.INativeMethods nativeMethods, int timeout_ms = 50)
|
||||||
{
|
{
|
||||||
orig_Clipboard(logger, nativeMethods, timeout_ms);
|
orig_Clipboard(logger, nativeMethods, timeout_ms);
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace SafeExamBrowser.Monitoring
|
||||||
[MonoModConstructor] public void VirtualMachineDetector(ILogger logger, IRegistry registry, ISystemInfo systemInfo)
|
[MonoModConstructor] public void VirtualMachineDetector(ILogger logger, IRegistry registry, ISystemInfo systemInfo)
|
||||||
{
|
{
|
||||||
orig_VirtualMachineDetector(logger, registry, systemInfo);
|
orig_VirtualMachineDetector(logger, registry, systemInfo);
|
||||||
patchlogger = new PatchLogger("MonitoringVirtualMachineDetector");
|
patchlogger = new PatchLogger("Monitoring.VirtualMachineDetector");
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma warning disable IDE1006 // Naming Styles
|
#pragma warning disable IDE1006 // Naming Styles
|
||||||
|
|
|
@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SEBPatcher.Configuration",
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SEBPatcherUtils", "SEBPatcherUtils\SEBPatcherUtils.csproj", "{82F861DC-D8C7-46F9-AA60-B67CF43712D5}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SEBPatcherUtils", "SEBPatcherUtils\SEBPatcherUtils.csproj", "{82F861DC-D8C7-46F9-AA60-B67CF43712D5}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SEBPatcher.Client", "SEBPatcher.Client\SEBPatcher.Client.csproj", "{48A5F9AC-B556-4F24-990C-017E485790D2}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
@ -25,5 +27,9 @@ Global
|
||||||
{82F861DC-D8C7-46F9-AA60-B67CF43712D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{82F861DC-D8C7-46F9-AA60-B67CF43712D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{82F861DC-D8C7-46F9-AA60-B67CF43712D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{82F861DC-D8C7-46F9-AA60-B67CF43712D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{82F861DC-D8C7-46F9-AA60-B67CF43712D5}.Release|Any CPU.Build.0 = Release|Any CPU
|
{82F861DC-D8C7-46F9-AA60-B67CF43712D5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{48A5F9AC-B556-4F24-990C-017E485790D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{48A5F9AC-B556-4F24-990C-017E485790D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{48A5F9AC-B556-4F24-990C-017E485790D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{48A5F9AC-B556-4F24-990C-017E485790D2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|
Loading…
Reference in a new issue