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.Interfaces |
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 |
void RaisePluginFrameworkEvents(); |
34 |
|
35 |
IWebBrowserInterface WebBrowserInterface { get; } |
36 |
|
37 |
|
38 |
} |
39 |
#region IPluginBase SubMembers |
40 |
public interface IToString { string ToString(); } |
41 |
public interface IPluginName { string Name { get; } } |
42 |
public interface IPluginDescription { string Description { get; } } |
43 |
public interface IPluginID { Guid ID { get; } } |
44 |
public interface IPluginRefresh { void Reload(); void Reload(bool silent); } |
45 |
#endregion |
46 |
#endregion |
47 |
#region IConfigPlugin |
48 |
public interface IConfigPlugin : IPluginBase, IAcceptsReadOnlyMemoryRange, ISearchInProgress, IAcceptsMemorySearch |
49 |
{ |
50 |
List<ProcContainer> ValidProcessesForPlugin { get; } |
51 |
IWebBrowserProvider WebBrowserProvider { get; set; } |
52 |
} |
53 |
#endregion |
54 |
#region IInputPlugin |
55 |
public interface IInputPlugin : IPluginBase |
56 |
{ |
57 |
} |
58 |
#endregion |
59 |
#region IWindowPlugin |
60 |
public interface IWindowPlugin : IPluginBase |
61 |
{ |
62 |
} |
63 |
#endregion |
64 |
#region IUserControlPlugin |
65 |
public interface IUserControlPlugin : IPluginBase |
66 |
{ |
67 |
void Show(); |
68 |
void Show(DockPanel dockPanel); |
69 |
void Show(DockPanel dockPanel, DockState dockState); |
70 |
void Config(); |
71 |
|
72 |
void Activate(); |
73 |
void Close(); |
74 |
DockContentHandler DockHandler { get; set; } |
75 |
IDockContent DockContent { get; } |
76 |
string IDockContentTypeName { get; } |
77 |
} |
78 |
#endregion |
79 |
#region IPluginLoader |
80 |
public interface IPluginLoader |
81 |
{ |
82 |
void LoadPlugins(); |
83 |
void LoadPlugins(bool silent); |
84 |
List<IConfigPlugin> LoadedConfigPlugins { get; } |
85 |
List<IInputPlugin> LoadedInputPlugins { get; } |
86 |
List<IWindowPlugin> LoadedWindowPlugins { get; } |
87 |
List<IUserControlPlugin> LoadedUserControlPlugins { get; } |
88 |
|
89 |
IConfigPlugin GetConfigPlugin(string t); |
90 |
IInputPlugin GetInputPlugin(string t); |
91 |
IWindowPlugin GetWindowPlugin(string t); |
92 |
|
93 |
IConfigPlugin GetGenericConfigPlugin(); |
94 |
IInputPlugin GetGenericInputPlugin(); |
95 |
IWindowPlugin GetGenericWindowPlugin(); |
96 |
|
97 |
T GetPluginByName<T>(string name) where T : IPluginBase; |
98 |
T GetPluginByGuid<T>(string t) where T : IPluginBase; |
99 |
string[] GetKnownPluginGuids<T>() where T : IPluginBase; |
100 |
bool IsKnownPluginGuid<T>(string t, out T plugin) where T : IPluginBase; |
101 |
bool IsKnownPluginName<T>(string plugin_name, out T plugin) where T : IPluginBase; |
102 |
|
103 |
string ToString(); |
104 |
} |
105 |
#endregion |
106 |
#region AcceptsPlugin |
107 |
public interface IAcceptsPlugin<TPlugin> |
108 |
where TPlugin : IPluginBase |
109 |
{ |
110 |
TPlugin AcceptedPlugin { get; set; } |
111 |
} |
112 |
public interface IAcceptsConfig : IAcceptsPlugin<IConfigPlugin> { } |
113 |
public interface IAcceptsProcess : IAcceptsProcess<Process> { } |
114 |
public interface IAcceptsProcess<TProcess> |
115 |
where TProcess : Process |
116 |
{ |
117 |
TProcess AcceptedProcess { get; set; } |
118 |
} |
119 |
#endregion |
120 |
|
121 |
|
122 |
public interface IAcceptsProcessAndConfig<TProcess> : IAcceptsConfig, IAcceptsProcess<TProcess> where TProcess : Process { } |
123 |
public interface IAcceptsProcessAndConfig : IAcceptsProcess, IAcceptsConfig { } |
124 |
|
125 |
|
126 |
public class AcceptedProcessAndConfig<TProcess> : IAcceptsProcessAndConfig<TProcess> where TProcess : Process |
127 |
{ |
128 |
public AcceptedProcessAndConfig() : this(null, default(TProcess)) { } |
129 |
public AcceptedProcessAndConfig(IConfigPlugin config, TProcess process) { AcceptedPlugin = config; AcceptedProcess = process; } |
130 |
#region IAcceptsProcessAndConfig<TProcess> members |
131 |
#endregion |
132 |
|
133 |
#region IAcceptsPlugin<IConfigPlugin> Members |
134 |
public IConfigPlugin AcceptedPlugin { get; set; } |
135 |
#endregion |
136 |
|
137 |
#region IAcceptsProcess<TProcess> Members |
138 |
public TProcess AcceptedProcess { get; set; } |
139 |
#endregion |
140 |
} |
141 |
public class AcceptedProcessAndConfig : IAcceptsProcessAndConfig |
142 |
{ |
143 |
public AcceptedProcessAndConfig() : this(null, null) { } |
144 |
public AcceptedProcessAndConfig(IConfigPlugin config, Process process) { AcceptedPlugin = config; AcceptedProcess = process; } |
145 |
|
146 |
#region IAcceptsProcess<Process> Members |
147 |
public Process AcceptedProcess { get; set; } |
148 |
#endregion |
149 |
#region IAcceptsPlugin<IConfigPlugin> Members |
150 |
public IConfigPlugin AcceptedPlugin { get; set; } |
151 |
#endregion |
152 |
} |
153 |
|
154 |
public interface IAcceptsProcessPID |
155 |
{ |
156 |
int ProcessPID { get; set; } |
157 |
} |
158 |
public interface IAcceptsMemoryRange |
159 |
{ |
160 |
ulong MemoryRangeStart { get; set; } |
161 |
ulong MemoryRangeSize { get; set; } |
162 |
} |
163 |
public interface IAcceptsReadOnlyMemoryRange |
164 |
{ |
165 |
ulong MemoryRangeStart { get; } |
166 |
ulong MemoryRangeSize { get; } |
167 |
} |
168 |
public interface IOutputsData<TData> { TData Data { get; } } |
169 |
public interface ISearchInProgress |
170 |
{ |
171 |
bool SearchInProgess { get; } |
172 |
Guid SearchGuid { get; } |
173 |
} |
174 |
} |