Testing Client patch
This commit is contained in:
parent
31e2fa1264
commit
13d584a24c
4 changed files with 16 additions and 11 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -3,6 +3,9 @@
|
||||||
##
|
##
|
||||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||||
|
|
||||||
|
# Personally customizable settings
|
||||||
|
Directory.Build.props
|
||||||
|
|
||||||
# User-specific files
|
# User-specific files
|
||||||
*.suo
|
*.suo
|
||||||
*.user
|
*.user
|
||||||
|
|
12
README.md
12
README.md
|
@ -10,11 +10,15 @@ In order to use the patches, do the following:
|
||||||
|
|
||||||
1. Get the patch DLLs: build them or get them from releases.
|
1. Get the patch DLLs: build them or get them from releases.
|
||||||
|
|
||||||
2. Put patch DLLs into SafeExamBrowser\Application.
|
2. Put patch DLLs into %appdata%\SafeExamBrowser\Application.
|
||||||
|
|
||||||
3. Get MonoMod and put all its files into SafeExamBrowser\Application.
|
3. Get MonoMod and put all its files into %appdata%\SafeExamBrowser\Application.
|
||||||
|
|
||||||
4. Run MonoMod on all relevant DLLs, eg. `.\MonoMod.exe SafeExamBrowser.Monitoring.dll`
|
4. Run MonoMod on all target DLLs, eg. `.\MonoMod.exe SafeExamBrowser.Monitoring.dll`.
|
||||||
|
Note that you might get an error about not being able to find dependencies, in this case you should set the environment variable 'MONOMOD_DEPENDENCY_MISSING_THROW' to '1'.
|
||||||
|
If you have to do this, make sure to doublecheck the patched DLLs with something like dnSpy so that they are correct.
|
||||||
|
|
||||||
|
5. Rename the patched DLLs once they have been patched correctly (MONOMODDED_xxxxx) and remove the MONOMODDED prefix, replacing the original files.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
@ -26,6 +30,8 @@ Set `ReferenceBasePath` to your SEB installation (SafeExamBrowser\Application).
|
||||||
|
|
||||||
If you want to separate your development/testing files from your actual SEB installation, I recommend copying the files in SafeExamBrowser\Application and the MonoMod files to their own directory.
|
If you want to separate your development/testing files from your actual SEB installation, I recommend copying the files in SafeExamBrowser\Application and the MonoMod files to their own directory.
|
||||||
|
|
||||||
|
Some targets (namely SafeExamBrowser.Client.exe) has private/internal members that we need to deal with, to do this we first publicize it using n-strip, and then reference to the stripped binary instead.
|
||||||
|
|
||||||
## Resources
|
## Resources
|
||||||
|
|
||||||
This depends on MonoMod and SafeExamBrowser.
|
This depends on MonoMod and SafeExamBrowser.
|
||||||
|
|
|
@ -94,10 +94,6 @@
|
||||||
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Logging.Contracts.dll</HintPath>
|
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.Logging.Contracts.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SafeExamBrowser.SystemComponents">
|
|
||||||
<HintPath>$(ReferenceBasePath)\SafeExamBrowser.SystemComponents.dll</HintPath>
|
|
||||||
<Private>False</Private>
|
|
||||||
</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>
|
<Private>False</Private>
|
||||||
|
|
|
@ -11,19 +11,19 @@ using SafeExamBrowser.Client.Contracts;
|
||||||
namespace SafeExamBrowser.Client
|
namespace SafeExamBrowser.Client
|
||||||
{
|
{
|
||||||
#pragma warning disable IDE1006 // Naming Styles
|
#pragma warning disable IDE1006 // Naming Styles
|
||||||
internal class patch_ClientController : ClientController
|
public class patch_ClientController : ClientController
|
||||||
#pragma warning restore IDE1006 // Naming Styles
|
#pragma warning restore IDE1006 // Naming Styles
|
||||||
{
|
{
|
||||||
public PatchLogger patchlogger;
|
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) { }
|
[MonoModIgnore] public 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 IDE1006 // Naming Styles
|
||||||
#pragma warning disable RECS0082 // Parameter has the same name as a member and hides it
|
#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);
|
[MonoModOriginal] public 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 RECS0082 // Parameter has the same name as a member and hides it
|
||||||
#pragma warning restore IDE1006 // Naming Styles
|
#pragma warning restore IDE1006 // Naming Styles
|
||||||
#pragma warning disable RECS0082 // Parameter has the same name as a member and hides it
|
#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)
|
[MonoModConstructor] public 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
|
#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);
|
orig_ClientController(actionCenter, applicationMonitor, context, coordinator, displayMonitor, explorerShell, fileSystemDialog, hashAlgorithm, logger, messageBox, networkAdapter, operations, runtime, shutdown, splashScreen, sentinel, taskbar, text, uiFactory);
|
||||||
|
|
Loading…
Reference in a new issue