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