/[RomCheater]/trunk/RomCheater.Core/PluginInterfaces.cs
ViewVC logotype

Contents of /trunk/RomCheater.Core/PluginInterfaces.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 688 - (show annotations) (download)
Mon Jun 17 09:46:51 2013 UTC (6 years, 4 months ago) by william
File size: 5311 byte(s)

1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using WeifenLuo.WinFormsUI.Docking;
6 using System.Diagnostics;
7 using ManagedWinapi;
8
9 namespace RomCheater.Core
10 {
11 #region t
12 public interface IExposedPluginData :
13 IAcceptPEData,
14 IAcceptsPEData,
15 IAcceptsChangedProcess,
16 IAcceptsChangedConfig
17 {
18 void SetAcceptedProcess(Process proc);
19 void SetAcceptedConfig(IConfigPlugin config);
20 void SetAcceptedProcessAndConfig(IAcceptsProcessAndConfig iapc);
21 }
22 #endregion
23 #region IPluginBase
24 public interface IPluginBase : IPluginName, IPluginDescription, IPluginID, IToString, IPluginRefresh, IExposedPluginData
25 {
26 bool IsNullPlugin { get; }
27 bool IsGenericPlugin { get; }
28
29 void ReadProcessMemory(ulong MemoryAddress, ulong bytesToRead, out ulong bytesRead, out byte[] data);
30 void WriteProcessMemory(long MemoryAddress, byte[] bytesToWrite, out ulong bytesWritten);
31 List<MEMORY_REGION_INFORMATION> QueryMemoryRegions();
32 }
33 #region IPluginBase SubMembers
34 public interface IToString { string ToString(); }
35 public interface IPluginName { string Name { get; } }
36 public interface IPluginDescription { string Description { get; } }
37 public interface IPluginID { Guid ID { get; } }
38 public interface IPluginRefresh { void Reload(); void Reload(bool silent); }
39 #endregion
40 #endregion
41 #region IConfigPlugin
42 public interface IConfigPlugin : IPluginBase, IAcceptsReadOnlyMemoryRange, ISearchInProgress, IAcceptsMemorySearch
43 {
44 List<ProcContainer> ValidProcessesForPlugin { get; }
45 }
46 #endregion
47 #region IInputPlugin
48 public interface IInputPlugin : IPluginBase
49 {
50 }
51 #endregion
52 #region IWindowPlugin
53 public interface IWindowPlugin : IPluginBase
54 {
55 }
56 #endregion
57 #region IUserControlPlugin
58 public interface IUserControlPlugin : IPluginBase
59 {
60 void Show();
61 void Show(DockPanel dockPanel);
62 void Show(DockPanel dockPanel, DockState dockState);
63 void Config();
64 }
65 #endregion
66 #region IPluginLoader
67 public interface IPluginLoader
68 {
69 void LoadPlugins();
70 void LoadPlugins(bool silent);
71 List<IConfigPlugin> LoadedConfigPlugins { get; }
72 List<IInputPlugin> LoadedInputPlugins { get; }
73 List<IWindowPlugin> LoadedWindowPlugins { get; }
74 List<IUserControlPlugin> LoadedUserControlPlugins { get; }
75
76 IConfigPlugin GetConfigPlugin(string t);
77 IInputPlugin GetInputPlugin(string t);
78 IWindowPlugin GetWindowPlugin(string t);
79
80 string ToString();
81 }
82 #endregion
83 #region AcceptsPlugin
84 public interface IAcceptsPlugin<TPlugin>
85 where TPlugin : IPluginBase
86 {
87 TPlugin AcceptedPlugin { get; set; }
88 }
89 public interface IAcceptsConfig : IAcceptsPlugin<IConfigPlugin> { }
90 public interface IAcceptsProcess : IAcceptsProcess<Process> { }
91 public interface IAcceptsProcess<TProcess>
92 where TProcess : Process
93 {
94 TProcess AcceptedProcess { get; set; }
95 }
96 #endregion
97
98
99 public interface IAcceptsProcessAndConfig<TProcess> : IAcceptsConfig, IAcceptsProcess<TProcess> where TProcess : Process { }
100 public interface IAcceptsProcessAndConfig : IAcceptsProcess, IAcceptsConfig { }
101
102
103 public class AcceptedProcessAndConfig<TProcess> : IAcceptsProcessAndConfig<TProcess> where TProcess : Process
104 {
105 public AcceptedProcessAndConfig() : this(null, default(TProcess)) { }
106 public AcceptedProcessAndConfig(IConfigPlugin config, TProcess process) { AcceptedPlugin = config; AcceptedProcess = process; }
107 #region IAcceptsProcessAndConfig<TProcess> members
108 #endregion
109
110 #region IAcceptsPlugin<IConfigPlugin> Members
111 public IConfigPlugin AcceptedPlugin { get; set; }
112 #endregion
113
114 #region IAcceptsProcess<TProcess> Members
115 public TProcess AcceptedProcess { get; set; }
116 #endregion
117 }
118 public class AcceptedProcessAndConfig : IAcceptsProcessAndConfig
119 {
120 public AcceptedProcessAndConfig() : this(null, null) { }
121 public AcceptedProcessAndConfig(IConfigPlugin config, Process process) { AcceptedPlugin = config; AcceptedProcess = process; }
122
123 #region IAcceptsProcess<Process> Members
124 public Process AcceptedProcess { get; set; }
125 #endregion
126 #region IAcceptsPlugin<IConfigPlugin> Members
127 public IConfigPlugin AcceptedPlugin { get; set; }
128 #endregion
129 }
130
131 public interface IAcceptsProcessPID
132 {
133 int ProcessPID { get; set; }
134 }
135 public interface IAcceptsMemoryRange
136 {
137 ulong MemoryRangeStart { get; set; }
138 ulong MemoryRangeSize { get; set; }
139 }
140 public interface IAcceptsReadOnlyMemoryRange
141 {
142 ulong MemoryRangeStart { get; }
143 ulong MemoryRangeSize { get; }
144 }
145 public interface IOutputsData<TData> { TData Data { get; } }
146 public interface ISearchInProgress
147 {
148 bool SearchInProgess { get; }
149 Guid SearchGuid { get; }
150 }
151 }

  ViewVC Help
Powered by ViewVC 1.1.22