Initial commit

This commit is contained in:
Stone_Red
2025-12-19 18:16:08 +01:00
commit e647916f78
25 changed files with 953 additions and 0 deletions
@@ -0,0 +1,18 @@
using System.Reflection;
using System.Runtime.Loader;
namespace RemoteExec.Server;
public class RemoteJobAssemblyLoadContext(string name) : AssemblyLoadContext(name, true)
{
public event EventHandler<RequestAssemblyEventArgs>? RequestAssembly;
protected override Assembly? Load(AssemblyName assemblyName)
{
RequestAssemblyEventArgs requestAssemblyEventArgs = new RequestAssemblyEventArgs(assemblyName);
RequestAssembly?.Invoke(this, requestAssemblyEventArgs);
return requestAssemblyEventArgs.GetAssemblyAsync().ConfigureAwait(false).GetAwaiter().GetResult();
}
}