public Main(RemoteHooking.IContext context, string channelName, VisualRenderType visualRenderType) { _visualRenderType = visualRenderType; // Connect to server object using provided channel name var @interface = RemoteHooking.IpcConnectClient <InjectorInterface>(channelName); Process = Process.GetProcessById(RemoteHooking.GetCurrentProcessId()); foreach (ProcessModule processModule in Process.Modules) { try { ModuleInfos.Add(processModule.ModuleName, new ModuleInfo { Name = processModule.ModuleName, MemorySize = processModule.ModuleMemorySize, Address = processModule.BaseAddress }); } catch { // ignored } } // If Ping fails then the Run method will be not be called @interface.Ping(); }
public bool Execute(ISerializable parameters, out ISerializable result) { var moduleInfos = new ModuleInfos(); var domain = AppDomain.CurrentDomain; uint domainId = (uint)domain.Id; var domainName = domain.FriendlyName; foreach (var assembly in domain.GetAssemblies()) { var assemblyName = assembly.GetName().Name; foreach (var module in assembly.GetLoadedModules()) { var moduleInfo = new ModuleInfo { Name = module.ScopeName, AssemblyName = assemblyName, DomainId = domainId, DomainName = domainName }; moduleInfos.Add(moduleInfo); } } result = moduleInfos; return(true); }