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 |
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 |
#endregion |
73 |
#region IPluginLoader |
74 |
public interface IPluginLoader |
75 |
{ |
76 |
void LoadPlugins(); |
77 |
void LoadPlugins(bool silent); |
78 |
List<IConfigPlugin> LoadedConfigPlugins { get; } |
79 |
List<IInputPlugin> LoadedInputPlugins { get; } |
80 |
List<IWindowPlugin> LoadedWindowPlugins { get; } |
81 |
List<IUserControlPlugin> LoadedUserControlPlugins { get; } |
82 |
|
83 |
IConfigPlugin GetConfigPlugin(string t); |
84 |
IInputPlugin GetInputPlugin(string t); |
85 |
IWindowPlugin GetWindowPlugin(string t); |
86 |
|
87 |
string ToString(); |
88 |
} |
89 |
#endregion |
90 |
#region AcceptsPlugin |
91 |
public interface IAcceptsPlugin<TPlugin> |
92 |
where TPlugin : IPluginBase |
93 |
{ |
94 |
TPlugin AcceptedPlugin { get; set; } |
95 |
} |
96 |
public interface IAcceptsConfig : IAcceptsPlugin<IConfigPlugin> { } |
97 |
public interface IAcceptsProcess : IAcceptsProcess<Process> { } |
98 |
public interface IAcceptsProcess<TProcess> |
99 |
where TProcess : Process |
100 |
{ |
101 |
TProcess AcceptedProcess { get; set; } |
102 |
} |
103 |
#endregion |
104 |
|
105 |
|
106 |
public interface IAcceptsProcessAndConfig<TProcess> : IAcceptsConfig, IAcceptsProcess<TProcess> where TProcess : Process { } |
107 |
public interface IAcceptsProcessAndConfig : IAcceptsProcess, IAcceptsConfig { } |
108 |
|
109 |
|
110 |
public class AcceptedProcessAndConfig<TProcess> : IAcceptsProcessAndConfig<TProcess> where TProcess : Process |
111 |
{ |
112 |
public AcceptedProcessAndConfig() : this(null, default(TProcess)) { } |
113 |
public AcceptedProcessAndConfig(IConfigPlugin config, TProcess process) { AcceptedPlugin = config; AcceptedProcess = process; } |
114 |
#region IAcceptsProcessAndConfig<TProcess> members |
115 |
#endregion |
116 |
|
117 |
#region IAcceptsPlugin<IConfigPlugin> Members |
118 |
public IConfigPlugin AcceptedPlugin { get; set; } |
119 |
#endregion |
120 |
|
121 |
#region IAcceptsProcess<TProcess> Members |
122 |
public TProcess AcceptedProcess { get; set; } |
123 |
#endregion |
124 |
} |
125 |
public class AcceptedProcessAndConfig : IAcceptsProcessAndConfig |
126 |
{ |
127 |
public AcceptedProcessAndConfig() : this(null, null) { } |
128 |
public AcceptedProcessAndConfig(IConfigPlugin config, Process process) { AcceptedPlugin = config; AcceptedProcess = process; } |
129 |
|
130 |
#region IAcceptsProcess<Process> Members |
131 |
public Process AcceptedProcess { get; set; } |
132 |
#endregion |
133 |
#region IAcceptsPlugin<IConfigPlugin> Members |
134 |
public IConfigPlugin AcceptedPlugin { get; set; } |
135 |
#endregion |
136 |
} |
137 |
|
138 |
public interface IAcceptsProcessPID |
139 |
{ |
140 |
int ProcessPID { get; set; } |
141 |
} |
142 |
public interface IAcceptsMemoryRange |
143 |
{ |
144 |
ulong MemoryRangeStart { get; set; } |
145 |
ulong MemoryRangeSize { get; set; } |
146 |
} |
147 |
public interface IAcceptsReadOnlyMemoryRange |
148 |
{ |
149 |
ulong MemoryRangeStart { get; } |
150 |
ulong MemoryRangeSize { get; } |
151 |
} |
152 |
public interface IOutputsData<TData> { TData Data { get; } } |
153 |
public interface ISearchInProgress |
154 |
{ |
155 |
bool SearchInProgess { get; } |
156 |
Guid SearchGuid { get; } |
157 |
} |
158 |
} |