├── .gitignore
├── MEMAPI Debugger.sln
├── MEMAPI Debugger
├── App.config
├── Dialogs
│ ├── AddHardwareBreakpointDialog.Designer.cs
│ ├── AddHardwareBreakpointDialog.cs
│ ├── AddHardwareBreakpointDialog.resx
│ ├── HardwareBreakpointDialog.Designer.cs
│ ├── HardwareBreakpointDialog.cs
│ ├── HardwareBreakpointDialog.resx
│ ├── MemoryRangeDialog.Designer.cs
│ ├── MemoryRangeDialog.cs
│ ├── MemoryRangeDialog.resx
│ ├── MixedValueDialog.Designer.cs
│ ├── MixedValueDialog.cs
│ ├── MixedValueDialog.resx
│ ├── PS4Dialog.Designer.cs
│ ├── PS4Dialog.cs
│ ├── PS4Dialog.resx
│ ├── ProcessDialog.Designer.cs
│ ├── ProcessDialog.cs
│ ├── ProcessDialog.resx
│ ├── SelectTargetDialog.Designer.cs
│ ├── SelectTargetDialog.cs
│ ├── SelectTargetDialog.resx
│ ├── StringDialog.Designer.cs
│ ├── StringDialog.cs
│ └── StringDialog.resx
├── FodyWeavers.xml
├── Forms
│ ├── BreakpointsForm.Designer.cs
│ ├── BreakpointsForm.cs
│ ├── BreakpointsForm.resx
│ ├── ConsoleForm.Designer.cs
│ ├── ConsoleForm.cs
│ ├── ConsoleForm.resx
│ ├── DisassemblyForm.Designer.cs
│ ├── DisassemblyForm.cs
│ ├── DisassemblyForm.resx
│ ├── KernelForm.Designer.cs
│ ├── KernelForm.cs
│ ├── KernelForm.resx
│ ├── MainForm.Designer.cs
│ ├── MainForm.cs
│ ├── MainForm.resx
│ ├── MemoryForm.Designer.cs
│ ├── MemoryForm.cs
│ ├── MemoryForm.resx
│ ├── RegistersForm.Designer.cs
│ ├── RegistersForm.cs
│ ├── RegistersForm.resx
│ ├── SearchForm.Designer.cs
│ ├── SearchForm.cs
│ └── SearchForm.resx
├── Helper.cs
├── MEMAPI Debugger.csproj
├── PS4.cs
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── Resource.cs
├── Resources
│ ├── DejaVuSansMono.ttf
│ ├── icons
│ │ ├── attach.png
│ │ ├── attach_eboot.png
│ │ ├── blue_cog.png
│ │ ├── breakpoint.png
│ │ ├── breakpoint_pointer.png
│ │ ├── close_document.png
│ │ ├── connect.png
│ │ ├── connected.png
│ │ ├── detach.png
│ │ ├── disconnect.png
│ │ ├── disconnected.png
│ │ ├── document.png
│ │ ├── document_info.png
│ │ ├── exit.png
│ │ ├── folder_open.png
│ │ ├── gear.png
│ │ ├── gears.png
│ │ ├── loading.png
│ │ ├── lock.png
│ │ ├── logo.ico
│ │ ├── logo.png
│ │ ├── new_document.png
│ │ ├── notify.png
│ │ ├── patreon_icon.png
│ │ ├── pause.png
│ │ ├── play.png
│ │ ├── pointer.png
│ │ ├── ps4.png
│ │ ├── refresh.png
│ │ ├── right_arrow_stop.png
│ │ ├── save.png
│ │ ├── save_as.png
│ │ ├── send.png
│ │ ├── step.png
│ │ ├── stop.png
│ │ ├── terminal.png
│ │ ├── timer_off.png
│ │ ├── timer_on.png
│ │ ├── transparent.png
│ │ ├── unlock.png
│ │ ├── window.png
│ │ ├── window_breakpoints.png
│ │ ├── window_disassembly.png
│ │ ├── window_kernels.png
│ │ ├── window_memory.png
│ │ ├── window_registers.png
│ │ └── window_search.png
│ └── memapi-server.bin
├── logo.ico
└── packages.config
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Dd]ebugPublic/
19 | [Rr]elease/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | bld/
24 | [Bb]in/
25 | [Oo]bj/
26 | [Ll]og/
27 |
28 | # Visual Studio 2015/2017 cache/options directory
29 | .vs/
30 | # Uncomment if you have tasks that create the project's static files in wwwroot
31 | #wwwroot/
32 |
33 | # Visual Studio 2017 auto generated files
34 | Generated\ Files/
35 |
36 | # MSTest test Results
37 | [Tt]est[Rr]esult*/
38 | [Bb]uild[Ll]og.*
39 |
40 | # NUNIT
41 | *.VisualState.xml
42 | TestResult.xml
43 |
44 | # Build Results of an ATL Project
45 | [Dd]ebugPS/
46 | [Rr]eleasePS/
47 | dlldata.c
48 |
49 | # Benchmark Results
50 | BenchmarkDotNet.Artifacts/
51 |
52 | # .NET Core
53 | project.lock.json
54 | project.fragment.lock.json
55 | artifacts/
56 |
57 | # StyleCop
58 | StyleCopReport.xml
59 |
60 | # Files built by Visual Studio
61 | *_i.c
62 | *_p.c
63 | *_h.h
64 | *.ilk
65 | *.meta
66 | *.obj
67 | *.iobj
68 | *.pch
69 | *.pdb
70 | *.ipdb
71 | *.pgc
72 | *.pgd
73 | *.rsp
74 | *.sbr
75 | *.tlb
76 | *.tli
77 | *.tlh
78 | *.tmp
79 | *.tmp_proj
80 | *_wpftmp.csproj
81 | *.log
82 | *.vspscc
83 | *.vssscc
84 | .builds
85 | *.pidb
86 | *.svclog
87 | *.scc
88 |
89 | # Chutzpah Test files
90 | _Chutzpah*
91 |
92 | # Visual C++ cache files
93 | ipch/
94 | *.aps
95 | *.ncb
96 | *.opendb
97 | *.opensdf
98 | *.sdf
99 | *.cachefile
100 | *.VC.db
101 | *.VC.VC.opendb
102 |
103 | # Visual Studio profiler
104 | *.psess
105 | *.vsp
106 | *.vspx
107 | *.sap
108 |
109 | # Visual Studio Trace Files
110 | *.e2e
111 |
112 | # TFS 2012 Local Workspace
113 | $tf/
114 |
115 | # Guidance Automation Toolkit
116 | *.gpState
117 |
118 | # ReSharper is a .NET coding add-in
119 | _ReSharper*/
120 | *.[Rr]e[Ss]harper
121 | *.DotSettings.user
122 |
123 | # JustCode is a .NET coding add-in
124 | .JustCode
125 |
126 | # TeamCity is a build add-in
127 | _TeamCity*
128 |
129 | # DotCover is a Code Coverage Tool
130 | *.dotCover
131 |
132 | # AxoCover is a Code Coverage Tool
133 | .axoCover/*
134 | !.axoCover/settings.json
135 |
136 | # Visual Studio code coverage results
137 | *.coverage
138 | *.coveragexml
139 |
140 | # NCrunch
141 | _NCrunch_*
142 | .*crunch*.local.xml
143 | nCrunchTemp_*
144 |
145 | # MightyMoose
146 | *.mm.*
147 | AutoTest.Net/
148 |
149 | # Web workbench (sass)
150 | .sass-cache/
151 |
152 | # Installshield output folder
153 | [Ee]xpress/
154 |
155 | # DocProject is a documentation generator add-in
156 | DocProject/buildhelp/
157 | DocProject/Help/*.HxT
158 | DocProject/Help/*.HxC
159 | DocProject/Help/*.hhc
160 | DocProject/Help/*.hhk
161 | DocProject/Help/*.hhp
162 | DocProject/Help/Html2
163 | DocProject/Help/html
164 |
165 | # Click-Once directory
166 | publish/
167 |
168 | # Publish Web Output
169 | *.[Pp]ublish.xml
170 | *.azurePubxml
171 | # Note: Comment the next line if you want to checkin your web deploy settings,
172 | # but database connection strings (with potential passwords) will be unencrypted
173 | *.pubxml
174 | *.publishproj
175 |
176 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
177 | # checkin your Azure Web App publish settings, but sensitive information contained
178 | # in these scripts will be unencrypted
179 | PublishScripts/
180 |
181 | # NuGet Packages
182 | *.nupkg
183 | # The packages folder can be ignored because of Package Restore
184 | **/[Pp]ackages/*
185 | # except build/, which is used as an MSBuild target.
186 | !**/[Pp]ackages/build/
187 | # Uncomment if necessary however generally it will be regenerated when needed
188 | #!**/[Pp]ackages/repositories.config
189 | # NuGet v3's project.json files produces more ignorable files
190 | *.nuget.props
191 | *.nuget.targets
192 |
193 | # Microsoft Azure Build Output
194 | csx/
195 | *.build.csdef
196 |
197 | # Microsoft Azure Emulator
198 | ecf/
199 | rcf/
200 |
201 | # Windows Store app package directories and files
202 | AppPackages/
203 | BundleArtifacts/
204 | Package.StoreAssociation.xml
205 | _pkginfo.txt
206 | *.appx
207 |
208 | # Visual Studio cache files
209 | # files ending in .cache can be ignored
210 | *.[Cc]ache
211 | # but keep track of directories ending in .cache
212 | !*.[Cc]ache/
213 |
214 | # Others
215 | ClientBin/
216 | ~$*
217 | *~
218 | *.dbmdl
219 | *.dbproj.schemaview
220 | *.jfm
221 | *.pfx
222 | *.publishsettings
223 | orleans.codegen.cs
224 |
225 | # Including strong name files can present a security risk
226 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
227 | #*.snk
228 |
229 | # Since there are multiple workflows, uncomment next line to ignore bower_components
230 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
231 | #bower_components/
232 |
233 | # RIA/Silverlight projects
234 | Generated_Code/
235 |
236 | # Backup & report files from converting an old project file
237 | # to a newer Visual Studio version. Backup files are not needed,
238 | # because we have git ;-)
239 | _UpgradeReport_Files/
240 | Backup*/
241 | UpgradeLog*.XML
242 | UpgradeLog*.htm
243 | ServiceFabricBackup/
244 | *.rptproj.bak
245 |
246 | # SQL Server files
247 | *.mdf
248 | *.ldf
249 | *.ndf
250 |
251 | # Business Intelligence projects
252 | *.rdl.data
253 | *.bim.layout
254 | *.bim_*.settings
255 | *.rptproj.rsuser
256 |
257 | # Microsoft Fakes
258 | FakesAssemblies/
259 |
260 | # GhostDoc plugin setting file
261 | *.GhostDoc.xml
262 |
263 | # Node.js Tools for Visual Studio
264 | .ntvs_analysis.dat
265 | node_modules/
266 |
267 | # Visual Studio 6 build log
268 | *.plg
269 |
270 | # Visual Studio 6 workspace options file
271 | *.opt
272 |
273 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
274 | *.vbw
275 |
276 | # Visual Studio LightSwitch build output
277 | **/*.HTMLClient/GeneratedArtifacts
278 | **/*.DesktopClient/GeneratedArtifacts
279 | **/*.DesktopClient/ModelManifest.xml
280 | **/*.Server/GeneratedArtifacts
281 | **/*.Server/ModelManifest.xml
282 | _Pvt_Extensions
283 |
284 | # Paket dependency manager
285 | .paket/paket.exe
286 | paket-files/
287 |
288 | # FAKE - F# Make
289 | .fake/
290 |
291 | # JetBrains Rider
292 | .idea/
293 | *.sln.iml
294 |
295 | # CodeRush personal settings
296 | .cr/personal
297 |
298 | # Python Tools for Visual Studio (PTVS)
299 | __pycache__/
300 | *.pyc
301 |
302 | # Cake - Uncomment if you are using it
303 | # tools/**
304 | # !tools/packages.config
305 |
306 | # Tabs Studio
307 | *.tss
308 |
309 | # Telerik's JustMock configuration file
310 | *.jmconfig
311 |
312 | # BizTalk build output
313 | *.btp.cs
314 | *.btm.cs
315 | *.odx.cs
316 | *.xsd.cs
317 |
318 | # OpenCover UI analysis results
319 | OpenCover/
320 |
321 | # Azure Stream Analytics local run output
322 | ASALocalRun/
323 |
324 | # MSBuild Binary and Structured Log
325 | *.binlog
326 |
327 | # NVidia Nsight GPU debugger configuration file
328 | *.nvuser
329 |
330 | # MFractors (Xamarin productivity tool) working folder
331 | .mfractor/
332 |
333 | # Local History for Visual Studio
334 | .localhistory/
--------------------------------------------------------------------------------
/MEMAPI Debugger.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27703.2042
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MEMAPI Debugger", "MEMAPI Debugger\MEMAPI Debugger.csproj", "{D0A07807-E46F-4699-92C2-C71C007E4A52}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {D0A07807-E46F-4699-92C2-C71C007E4A52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {D0A07807-E46F-4699-92C2-C71C007E4A52}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {D0A07807-E46F-4699-92C2-C71C007E4A52}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {D0A07807-E46F-4699-92C2-C71C007E4A52}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {8DDD5329-2061-4194-8847-8E6DA94F3AB7}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/AddHardwareBreakpointDialog.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MEMAPI_Debugger.Dialogs
2 | {
3 | partial class AddHardwareBreakpointDialog
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.radioButtonExecute = new System.Windows.Forms.RadioButton();
32 | this.radioButtonReadWrite = new System.Windows.Forms.RadioButton();
33 | this.radioButtonWrite = new System.Windows.Forms.RadioButton();
34 | this.textBoxAddress = new System.Windows.Forms.TextBox();
35 | this.comboBoxLength = new System.Windows.Forms.ComboBox();
36 | this.labelAddress = new System.Windows.Forms.Label();
37 | this.labelLength = new System.Windows.Forms.Label();
38 | this.buttonCancel = new System.Windows.Forms.Button();
39 | this.buttonAdd = new System.Windows.Forms.Button();
40 | this.SuspendLayout();
41 | //
42 | // radioButtonExecute
43 | //
44 | this.radioButtonExecute.AutoSize = true;
45 | this.radioButtonExecute.Location = new System.Drawing.Point(66, 65);
46 | this.radioButtonExecute.Name = "radioButtonExecute";
47 | this.radioButtonExecute.Size = new System.Drawing.Size(64, 17);
48 | this.radioButtonExecute.TabIndex = 2;
49 | this.radioButtonExecute.TabStop = true;
50 | this.radioButtonExecute.Text = "Execute";
51 | this.radioButtonExecute.UseVisualStyleBackColor = true;
52 | //
53 | // radioButtonReadWrite
54 | //
55 | this.radioButtonReadWrite.AutoSize = true;
56 | this.radioButtonReadWrite.Checked = true;
57 | this.radioButtonReadWrite.Location = new System.Drawing.Point(139, 65);
58 | this.radioButtonReadWrite.Name = "radioButtonReadWrite";
59 | this.radioButtonReadWrite.Size = new System.Drawing.Size(87, 17);
60 | this.radioButtonReadWrite.TabIndex = 3;
61 | this.radioButtonReadWrite.TabStop = true;
62 | this.radioButtonReadWrite.Text = "Read / Write";
63 | this.radioButtonReadWrite.UseVisualStyleBackColor = true;
64 | //
65 | // radioButtonWrite
66 | //
67 | this.radioButtonWrite.AutoSize = true;
68 | this.radioButtonWrite.Location = new System.Drawing.Point(237, 65);
69 | this.radioButtonWrite.Name = "radioButtonWrite";
70 | this.radioButtonWrite.Size = new System.Drawing.Size(50, 17);
71 | this.radioButtonWrite.TabIndex = 4;
72 | this.radioButtonWrite.TabStop = true;
73 | this.radioButtonWrite.Text = "Write";
74 | this.radioButtonWrite.UseVisualStyleBackColor = true;
75 | //
76 | // textBoxAddress
77 | //
78 | this.textBoxAddress.Location = new System.Drawing.Point(66, 12);
79 | this.textBoxAddress.Name = "textBoxAddress";
80 | this.textBoxAddress.Size = new System.Drawing.Size(223, 20);
81 | this.textBoxAddress.TabIndex = 0;
82 | //
83 | // comboBoxLength
84 | //
85 | this.comboBoxLength.FormattingEnabled = true;
86 | this.comboBoxLength.Items.AddRange(new object[] {
87 | "1 Byte",
88 | "2 Bytes",
89 | "4 Bytes",
90 | "8 Bytes"});
91 | this.comboBoxLength.Location = new System.Drawing.Point(66, 38);
92 | this.comboBoxLength.Name = "comboBoxLength";
93 | this.comboBoxLength.Size = new System.Drawing.Size(221, 21);
94 | this.comboBoxLength.TabIndex = 1;
95 | //
96 | // labelAddress
97 | //
98 | this.labelAddress.AutoSize = true;
99 | this.labelAddress.Location = new System.Drawing.Point(12, 15);
100 | this.labelAddress.Name = "labelAddress";
101 | this.labelAddress.Size = new System.Drawing.Size(48, 13);
102 | this.labelAddress.TabIndex = 5;
103 | this.labelAddress.Text = "Address:";
104 | //
105 | // labelLength
106 | //
107 | this.labelLength.AutoSize = true;
108 | this.labelLength.Location = new System.Drawing.Point(17, 41);
109 | this.labelLength.Name = "labelLength";
110 | this.labelLength.Size = new System.Drawing.Size(43, 13);
111 | this.labelLength.TabIndex = 6;
112 | this.labelLength.Text = "Length:";
113 | //
114 | // buttonCancel
115 | //
116 | this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
117 | this.buttonCancel.Location = new System.Drawing.Point(214, 88);
118 | this.buttonCancel.Name = "buttonCancel";
119 | this.buttonCancel.Size = new System.Drawing.Size(75, 23);
120 | this.buttonCancel.TabIndex = 6;
121 | this.buttonCancel.Text = "Cancel";
122 | this.buttonCancel.UseVisualStyleBackColor = true;
123 | //
124 | // buttonAdd
125 | //
126 | this.buttonAdd.Location = new System.Drawing.Point(66, 88);
127 | this.buttonAdd.Name = "buttonAdd";
128 | this.buttonAdd.Size = new System.Drawing.Size(75, 23);
129 | this.buttonAdd.TabIndex = 5;
130 | this.buttonAdd.Text = "Add";
131 | this.buttonAdd.UseVisualStyleBackColor = true;
132 | this.buttonAdd.Click += new System.EventHandler(this.buttonAdd_Click);
133 | //
134 | // AddHardwareBreakpointDialog
135 | //
136 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
137 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
138 | this.ClientSize = new System.Drawing.Size(302, 119);
139 | this.Controls.Add(this.buttonCancel);
140 | this.Controls.Add(this.buttonAdd);
141 | this.Controls.Add(this.labelLength);
142 | this.Controls.Add(this.labelAddress);
143 | this.Controls.Add(this.comboBoxLength);
144 | this.Controls.Add(this.textBoxAddress);
145 | this.Controls.Add(this.radioButtonWrite);
146 | this.Controls.Add(this.radioButtonReadWrite);
147 | this.Controls.Add(this.radioButtonExecute);
148 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
149 | this.MaximizeBox = false;
150 | this.MinimizeBox = false;
151 | this.Name = "AddHardwareBreakpointDialog";
152 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
153 | this.Text = "Add Hardware Breakpoint";
154 | this.ResumeLayout(false);
155 | this.PerformLayout();
156 |
157 | }
158 |
159 | #endregion
160 |
161 | private System.Windows.Forms.RadioButton radioButtonExecute;
162 | private System.Windows.Forms.RadioButton radioButtonReadWrite;
163 | private System.Windows.Forms.RadioButton radioButtonWrite;
164 | private System.Windows.Forms.TextBox textBoxAddress;
165 | private System.Windows.Forms.ComboBox comboBoxLength;
166 | private System.Windows.Forms.Label labelAddress;
167 | private System.Windows.Forms.Label labelLength;
168 | private System.Windows.Forms.Button buttonCancel;
169 | private System.Windows.Forms.Button buttonAdd;
170 | }
171 | }
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/AddHardwareBreakpointDialog.cs:
--------------------------------------------------------------------------------
1 | using MEMAPI;
2 | using System;
3 | using System.Windows.Forms;
4 |
5 | namespace MEMAPI_Debugger.Dialogs
6 | {
7 | public partial class AddHardwareBreakpointDialog : Form
8 | {
9 | public HardwareBreakpoint breakpoint { get; set; }
10 |
11 | public AddHardwareBreakpointDialog()
12 | {
13 | InitializeComponent();
14 | breakpoint = new HardwareBreakpoint();
15 | }
16 |
17 | private void buttonAdd_Click(object sender, EventArgs e)
18 | {
19 | ulong address = 0;
20 | try
21 | {
22 | address = Convert.ToUInt64(textBoxAddress.Text, 16);
23 | }
24 | catch
25 | {
26 | showError("Address is in an invalid format.");
27 | return;
28 | }
29 |
30 | if (comboBoxLength.SelectedIndex == -1)
31 | {
32 | showError("Invalid length selected.");
33 | return;
34 | }
35 |
36 | breakpoint.Address = address;
37 |
38 | if (radioButtonExecute.Checked)
39 | breakpoint.Type = HardwareBreakpoint.Flags.EXECUTE;
40 | else if (radioButtonReadWrite.Checked)
41 | breakpoint.Type = HardwareBreakpoint.Flags.READ_WRITE;
42 | else if (radioButtonWrite.Checked)
43 | breakpoint.Type = HardwareBreakpoint.Flags.WRITE;
44 |
45 | switch (comboBoxLength.SelectedIndex)
46 | {
47 | case 0:
48 | breakpoint.ByteLength = HardwareBreakpoint.Length.ONE;
49 | break;
50 | case 1:
51 | breakpoint.ByteLength = HardwareBreakpoint.Length.TWO;
52 | break;
53 | case 2:
54 | breakpoint.ByteLength = HardwareBreakpoint.Length.FOUR;
55 | break;
56 | case 3:
57 | breakpoint.ByteLength = HardwareBreakpoint.Length.EIGHT;
58 | break;
59 | }
60 |
61 | // Close dialog
62 | DialogResult = DialogResult.OK;
63 | Close();
64 | }
65 |
66 | private void showError(string msg)
67 | {
68 | MessageBox.Show(msg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/AddHardwareBreakpointDialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/HardwareBreakpointDialog.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MEMAPI_Debugger.Dialogs
2 | {
3 | partial class HardwareBreakpointDialog
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | this.listViewBreakpoints = new System.Windows.Forms.ListView();
33 | this.columnHeaderIndex = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
34 | this.columnHeaderAddress = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
35 | this.columnHeaderLength = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
36 | this.columnHeaderType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
37 | this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
38 | this.addToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
39 | this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
40 | this.seperator = new System.Windows.Forms.Label();
41 | this.buttonCancel = new System.Windows.Forms.Button();
42 | this.buttonOk = new System.Windows.Forms.Button();
43 | this.contextMenuStrip.SuspendLayout();
44 | this.SuspendLayout();
45 | //
46 | // listViewBreakpoints
47 | //
48 | this.listViewBreakpoints.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
49 | this.columnHeaderIndex,
50 | this.columnHeaderAddress,
51 | this.columnHeaderLength,
52 | this.columnHeaderType});
53 | this.listViewBreakpoints.ContextMenuStrip = this.contextMenuStrip;
54 | this.listViewBreakpoints.FullRowSelect = true;
55 | this.listViewBreakpoints.Location = new System.Drawing.Point(12, 12);
56 | this.listViewBreakpoints.MultiSelect = false;
57 | this.listViewBreakpoints.Name = "listViewBreakpoints";
58 | this.listViewBreakpoints.Size = new System.Drawing.Size(400, 194);
59 | this.listViewBreakpoints.TabIndex = 0;
60 | this.listViewBreakpoints.UseCompatibleStateImageBehavior = false;
61 | this.listViewBreakpoints.View = System.Windows.Forms.View.Details;
62 | //
63 | // columnHeaderIndex
64 | //
65 | this.columnHeaderIndex.Text = "Index";
66 | this.columnHeaderIndex.Width = 0;
67 | //
68 | // columnHeaderAddress
69 | //
70 | this.columnHeaderAddress.Text = "Address";
71 | this.columnHeaderAddress.Width = 200;
72 | //
73 | // columnHeaderLength
74 | //
75 | this.columnHeaderLength.Text = "Length";
76 | this.columnHeaderLength.Width = 90;
77 | //
78 | // columnHeaderType
79 | //
80 | this.columnHeaderType.Text = "Type";
81 | this.columnHeaderType.Width = 105;
82 | //
83 | // contextMenuStrip
84 | //
85 | this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
86 | this.addToolStripMenuItem,
87 | this.removeToolStripMenuItem});
88 | this.contextMenuStrip.Name = "contextMenuStrip";
89 | this.contextMenuStrip.Size = new System.Drawing.Size(118, 48);
90 | this.contextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip_Opening);
91 | //
92 | // addToolStripMenuItem
93 | //
94 | this.addToolStripMenuItem.Name = "addToolStripMenuItem";
95 | this.addToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
96 | this.addToolStripMenuItem.Text = "Add";
97 | this.addToolStripMenuItem.Click += new System.EventHandler(this.addToolStripMenuItem_Click);
98 | //
99 | // removeToolStripMenuItem
100 | //
101 | this.removeToolStripMenuItem.Enabled = false;
102 | this.removeToolStripMenuItem.Name = "removeToolStripMenuItem";
103 | this.removeToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
104 | this.removeToolStripMenuItem.Text = "Remove";
105 | this.removeToolStripMenuItem.Click += new System.EventHandler(this.removeToolStripMenuItem_Click);
106 | //
107 | // seperator
108 | //
109 | this.seperator.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
110 | this.seperator.Location = new System.Drawing.Point(12, 214);
111 | this.seperator.Name = "seperator";
112 | this.seperator.Size = new System.Drawing.Size(400, 2);
113 | this.seperator.TabIndex = 7;
114 | //
115 | // buttonCancel
116 | //
117 | this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
118 | this.buttonCancel.Location = new System.Drawing.Point(216, 219);
119 | this.buttonCancel.Name = "buttonCancel";
120 | this.buttonCancel.Size = new System.Drawing.Size(75, 23);
121 | this.buttonCancel.TabIndex = 2;
122 | this.buttonCancel.Text = "Cancel";
123 | this.buttonCancel.UseVisualStyleBackColor = true;
124 | //
125 | // buttonOk
126 | //
127 | this.buttonOk.Location = new System.Drawing.Point(135, 219);
128 | this.buttonOk.Name = "buttonOk";
129 | this.buttonOk.Size = new System.Drawing.Size(75, 23);
130 | this.buttonOk.TabIndex = 1;
131 | this.buttonOk.Text = "OK";
132 | this.buttonOk.UseVisualStyleBackColor = true;
133 | this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click);
134 | //
135 | // HardwareBreakpointDialog
136 | //
137 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
138 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
139 | this.ClientSize = new System.Drawing.Size(425, 250);
140 | this.Controls.Add(this.buttonCancel);
141 | this.Controls.Add(this.buttonOk);
142 | this.Controls.Add(this.seperator);
143 | this.Controls.Add(this.listViewBreakpoints);
144 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
145 | this.MaximizeBox = false;
146 | this.MinimizeBox = false;
147 | this.Name = "HardwareBreakpointDialog";
148 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
149 | this.Text = "Hardware Breakpoints";
150 | this.contextMenuStrip.ResumeLayout(false);
151 | this.ResumeLayout(false);
152 |
153 | }
154 |
155 | #endregion
156 |
157 | private System.Windows.Forms.ListView listViewBreakpoints;
158 | private System.Windows.Forms.ColumnHeader columnHeaderAddress;
159 | private System.Windows.Forms.ColumnHeader columnHeaderType;
160 | private System.Windows.Forms.ContextMenuStrip contextMenuStrip;
161 | private System.Windows.Forms.ToolStripMenuItem addToolStripMenuItem;
162 | private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem;
163 | private System.Windows.Forms.Label seperator;
164 | private System.Windows.Forms.Button buttonCancel;
165 | private System.Windows.Forms.Button buttonOk;
166 | private System.Windows.Forms.ColumnHeader columnHeaderLength;
167 | private System.Windows.Forms.ColumnHeader columnHeaderIndex;
168 | }
169 | }
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/HardwareBreakpointDialog.cs:
--------------------------------------------------------------------------------
1 | using MEMAPI;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Data;
6 | using System.Drawing;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 | using System.Windows.Forms;
11 |
12 | namespace MEMAPI_Debugger.Dialogs
13 | {
14 | public partial class HardwareBreakpointDialog : Form
15 | {
16 | public List breakpoints{ get; set; }
17 |
18 | public HardwareBreakpointDialog()
19 | {
20 | InitializeComponent();
21 | breakpoints = new List();
22 | }
23 |
24 | public void updateList()
25 | {
26 | refresh();
27 | }
28 |
29 | private void refresh()
30 | {
31 | listViewBreakpoints.Items.Clear();
32 | for (int i = 0; i < breakpoints.Count; i++)
33 | listViewBreakpoints.Items.Add(new ListViewItem(breakpoints[i].toArray()));
34 | }
35 |
36 | private void contextMenuStrip_Opening(object sender, CancelEventArgs e)
37 | {
38 | addToolStripMenuItem.Enabled = listViewBreakpoints.Items.Count < 4;
39 | removeToolStripMenuItem.Enabled = listViewBreakpoints.SelectedItems.Count > 0;
40 | }
41 |
42 | private void addToolStripMenuItem_Click(object sender, EventArgs e)
43 | {
44 | if (breakpoints.Count >= 4)
45 | {
46 | MessageBox.Show("You can only have a maximum of 4 hardware breakpoints set.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
47 | return;
48 | }
49 |
50 | AddHardwareBreakpointDialog dialog = new AddHardwareBreakpointDialog();
51 | if (dialog.ShowDialog() == DialogResult.OK)
52 | {
53 | dialog.breakpoint.Index = breakpoints.Count;
54 | breakpoints.Add(dialog.breakpoint);
55 | refresh();
56 | }
57 | }
58 |
59 | private void removeToolStripMenuItem_Click(object sender, EventArgs e)
60 | {
61 | if (listViewBreakpoints.SelectedItems.Count == 0)
62 | return;
63 |
64 | breakpoints.RemoveAt(Convert.ToInt32(listViewBreakpoints.SelectedItems[0].SubItems[0].Text));
65 |
66 | refresh();
67 | }
68 |
69 | private void buttonOk_Click(object sender, EventArgs e)
70 | {
71 | // Close dialog
72 | DialogResult = DialogResult.OK;
73 | Close();
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/HardwareBreakpointDialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/MemoryRangeDialog.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MEMAPI_Debugger.Dialogs
2 | {
3 | partial class MemoryRangeDialog
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.textBoxFrom = new System.Windows.Forms.TextBox();
32 | this.textBoxTo = new System.Windows.Forms.TextBox();
33 | this.labelTo = new System.Windows.Forms.Label();
34 | this.buttonCancel = new System.Windows.Forms.Button();
35 | this.buttonOk = new System.Windows.Forms.Button();
36 | this.SuspendLayout();
37 | //
38 | // textBoxFrom
39 | //
40 | this.textBoxFrom.Location = new System.Drawing.Point(12, 12);
41 | this.textBoxFrom.Name = "textBoxFrom";
42 | this.textBoxFrom.Size = new System.Drawing.Size(255, 20);
43 | this.textBoxFrom.TabIndex = 0;
44 | this.textBoxFrom.Text = "0x0000000000000000";
45 | //
46 | // textBoxTo
47 | //
48 | this.textBoxTo.Location = new System.Drawing.Point(12, 51);
49 | this.textBoxTo.Name = "textBoxTo";
50 | this.textBoxTo.Size = new System.Drawing.Size(255, 20);
51 | this.textBoxTo.TabIndex = 1;
52 | this.textBoxTo.Text = "0x0000000000000000";
53 | //
54 | // labelTo
55 | //
56 | this.labelTo.AutoSize = true;
57 | this.labelTo.Location = new System.Drawing.Point(120, 35);
58 | this.labelTo.Name = "labelTo";
59 | this.labelTo.Size = new System.Drawing.Size(20, 13);
60 | this.labelTo.TabIndex = 3;
61 | this.labelTo.Text = "To";
62 | //
63 | // buttonCancel
64 | //
65 | this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
66 | this.buttonCancel.Location = new System.Drawing.Point(142, 78);
67 | this.buttonCancel.Name = "buttonCancel";
68 | this.buttonCancel.Size = new System.Drawing.Size(125, 23);
69 | this.buttonCancel.TabIndex = 3;
70 | this.buttonCancel.Text = "Cancel";
71 | this.buttonCancel.UseVisualStyleBackColor = true;
72 | //
73 | // buttonOk
74 | //
75 | this.buttonOk.Location = new System.Drawing.Point(12, 78);
76 | this.buttonOk.Name = "buttonOk";
77 | this.buttonOk.Size = new System.Drawing.Size(125, 23);
78 | this.buttonOk.TabIndex = 2;
79 | this.buttonOk.Text = "OK";
80 | this.buttonOk.UseVisualStyleBackColor = true;
81 | this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click);
82 | //
83 | // MemoryRangeDialog
84 | //
85 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
86 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
87 | this.ClientSize = new System.Drawing.Size(279, 110);
88 | this.Controls.Add(this.buttonCancel);
89 | this.Controls.Add(this.buttonOk);
90 | this.Controls.Add(this.labelTo);
91 | this.Controls.Add(this.textBoxTo);
92 | this.Controls.Add(this.textBoxFrom);
93 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
94 | this.MaximizeBox = false;
95 | this.MinimizeBox = false;
96 | this.Name = "MemoryRangeDialog";
97 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
98 | this.Text = "Memory Range";
99 | this.ResumeLayout(false);
100 | this.PerformLayout();
101 |
102 | }
103 |
104 | #endregion
105 |
106 | private System.Windows.Forms.TextBox textBoxFrom;
107 | private System.Windows.Forms.TextBox textBoxTo;
108 | private System.Windows.Forms.Label labelTo;
109 | private System.Windows.Forms.Button buttonCancel;
110 | private System.Windows.Forms.Button buttonOk;
111 | }
112 | }
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/MemoryRangeDialog.cs:
--------------------------------------------------------------------------------
1 | using MEMAPI;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Data;
6 | using System.Drawing;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 | using System.Windows.Forms;
11 |
12 | namespace MEMAPI_Debugger.Dialogs
13 | {
14 | public partial class MemoryRangeDialog : Form
15 | {
16 | public MemoryRange Range { get; set; }
17 |
18 | public MemoryRangeDialog()
19 | {
20 | InitializeComponent();
21 | Range = new MemoryRange();
22 | }
23 |
24 | public void updateFields()
25 | {
26 | textBoxFrom.Text = "0x" + Helper.ulongToString(Range.Start, false);
27 | textBoxTo.Text = "0x" + Helper.ulongToString(Range.End, false);
28 | }
29 |
30 | private void buttonOk_Click(object sender, EventArgs e)
31 | {
32 | MemoryRange tempRange = new MemoryRange();
33 | try
34 | {
35 | ulong start = Convert.ToUInt64(textBoxFrom.Text, 16);
36 | ulong end = Convert.ToUInt64(textBoxTo.Text, 16);
37 |
38 | if (start >= end)
39 | {
40 | MessageBox.Show("End address must be after the start address.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
41 | return;
42 | }
43 |
44 | tempRange = new MemoryRange(start, end);
45 | }
46 | catch
47 | {
48 | MessageBox.Show("Memory range is not valid.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
49 | return;
50 | }
51 | Range = tempRange;
52 |
53 | // Close dialog
54 | DialogResult = DialogResult.OK;
55 | Close();
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/MemoryRangeDialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/MixedValueDialog.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MEMAPI_Debugger.Dialogs
2 | {
3 | partial class MixedValueDialog
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.textBoxValue = new System.Windows.Forms.TextBox();
32 | this.comboBoxType = new System.Windows.Forms.ComboBox();
33 | this.buttonCancel = new System.Windows.Forms.Button();
34 | this.buttonOk = new System.Windows.Forms.Button();
35 | this.SuspendLayout();
36 | //
37 | // textBoxValue
38 | //
39 | this.textBoxValue.Location = new System.Drawing.Point(12, 12);
40 | this.textBoxValue.Name = "textBoxValue";
41 | this.textBoxValue.Size = new System.Drawing.Size(255, 20);
42 | this.textBoxValue.TabIndex = 0;
43 | //
44 | // comboBoxType
45 | //
46 | this.comboBoxType.FormattingEnabled = true;
47 | this.comboBoxType.Items.AddRange(new object[] {
48 | "Bytes",
49 | "Integer",
50 | "Short",
51 | "Long",
52 | "Float",
53 | "Double",
54 | "String",
55 | "Unsigned Integer",
56 | "Unsigned Short",
57 | "Unsigned Long"});
58 | this.comboBoxType.Location = new System.Drawing.Point(12, 38);
59 | this.comboBoxType.Name = "comboBoxType";
60 | this.comboBoxType.Size = new System.Drawing.Size(255, 21);
61 | this.comboBoxType.TabIndex = 1;
62 | //
63 | // buttonCancel
64 | //
65 | this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
66 | this.buttonCancel.Location = new System.Drawing.Point(142, 65);
67 | this.buttonCancel.Name = "buttonCancel";
68 | this.buttonCancel.Size = new System.Drawing.Size(125, 23);
69 | this.buttonCancel.TabIndex = 3;
70 | this.buttonCancel.Text = "Cancel";
71 | this.buttonCancel.UseVisualStyleBackColor = true;
72 | //
73 | // buttonOk
74 | //
75 | this.buttonOk.Location = new System.Drawing.Point(12, 65);
76 | this.buttonOk.Name = "buttonOk";
77 | this.buttonOk.Size = new System.Drawing.Size(125, 23);
78 | this.buttonOk.TabIndex = 2;
79 | this.buttonOk.Text = "OK";
80 | this.buttonOk.UseVisualStyleBackColor = true;
81 | this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click);
82 | //
83 | // MixedValueDialog
84 | //
85 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
86 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
87 | this.ClientSize = new System.Drawing.Size(281, 100);
88 | this.Controls.Add(this.buttonCancel);
89 | this.Controls.Add(this.buttonOk);
90 | this.Controls.Add(this.comboBoxType);
91 | this.Controls.Add(this.textBoxValue);
92 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
93 | this.MaximizeBox = false;
94 | this.MinimizeBox = false;
95 | this.Name = "MixedValueDialog";
96 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
97 | this.ResumeLayout(false);
98 | this.PerformLayout();
99 |
100 | }
101 |
102 | #endregion
103 |
104 | private System.Windows.Forms.TextBox textBoxValue;
105 | private System.Windows.Forms.ComboBox comboBoxType;
106 | private System.Windows.Forms.Button buttonCancel;
107 | private System.Windows.Forms.Button buttonOk;
108 | }
109 | }
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/MixedValueDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace MEMAPI_Debugger.Dialogs
12 | {
13 | public partial class MixedValueDialog : Form
14 | {
15 | public object Variable { get; set; }
16 | public Type VariableType { get; set; }
17 |
18 | public MixedValueDialog(string title)
19 | {
20 | InitializeComponent();
21 | Text = title;
22 | }
23 |
24 | private void buttonOk_Click(object sender, EventArgs e)
25 | {
26 | if (comboBoxType.SelectedIndex == -1)
27 | {
28 | MessageBox.Show("You must select a valid variable type.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
29 | return;
30 | }
31 | try
32 | {
33 | switch (comboBoxType.SelectedIndex)
34 | {
35 | case 0:
36 | Variable = Helper.stringToByteArray(textBoxValue.Text.Replace(" ", ""));
37 | VariableType = typeof(byte[]);
38 | break;
39 | case 1:
40 | Variable = Convert.ToInt32(textBoxValue.Text);
41 | VariableType = typeof(int);
42 | break;
43 | case 2:
44 | Variable = Convert.ToInt16(textBoxValue.Text);
45 | VariableType = typeof(short);
46 | break;
47 | case 3:
48 | Variable = Convert.ToInt64(textBoxValue.Text);
49 | VariableType = typeof(long);
50 | break;
51 | case 4:
52 | Variable = Convert.ToSingle(textBoxValue.Text);
53 | VariableType = typeof(float);
54 | break;
55 | case 5:
56 | Variable = Convert.ToDouble(textBoxValue.Text);
57 | VariableType = typeof(double);
58 | break;
59 | case 6:
60 | Variable = textBoxValue.Text;
61 | VariableType = typeof(string);
62 | break;
63 | case 7:
64 | Variable = Convert.ToUInt32(textBoxValue.Text);
65 | VariableType = typeof(uint);
66 | break;
67 | case 8:
68 | Variable = Convert.ToUInt16(textBoxValue.Text);
69 | VariableType = typeof(ushort);
70 | break;
71 | case 9:
72 | Variable = Convert.ToUInt64(textBoxValue.Text);
73 | VariableType = typeof(ulong);
74 | break;
75 | }
76 | }
77 | catch
78 | {
79 | MessageBox.Show("Value is in an invalid format.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
80 | return;
81 | }
82 |
83 | // Close dialog
84 | DialogResult = DialogResult.OK;
85 | Close();
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/MixedValueDialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/PS4Dialog.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MEMAPI_Debugger.Dialogs
2 | {
3 | partial class PS4Dialog
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.button1 = new System.Windows.Forms.Button();
32 | this.button2 = new System.Windows.Forms.Button();
33 | this.textBoxName = new System.Windows.Forms.TextBox();
34 | this.textBoxIpAddress = new System.Windows.Forms.TextBox();
35 | this.labelName = new System.Windows.Forms.Label();
36 | this.labelIpAddress = new System.Windows.Forms.Label();
37 | this.SuspendLayout();
38 | //
39 | // button1
40 | //
41 | this.button1.Location = new System.Drawing.Point(78, 64);
42 | this.button1.Name = "button1";
43 | this.button1.Size = new System.Drawing.Size(75, 23);
44 | this.button1.TabIndex = 2;
45 | this.button1.Text = "Save";
46 | this.button1.UseVisualStyleBackColor = true;
47 | this.button1.Click += new System.EventHandler(this.button1_Click);
48 | //
49 | // button2
50 | //
51 | this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
52 | this.button2.Location = new System.Drawing.Point(193, 64);
53 | this.button2.Name = "button2";
54 | this.button2.Size = new System.Drawing.Size(75, 23);
55 | this.button2.TabIndex = 3;
56 | this.button2.Text = "Cancel";
57 | this.button2.UseVisualStyleBackColor = true;
58 | //
59 | // textBoxName
60 | //
61 | this.textBoxName.Location = new System.Drawing.Point(78, 12);
62 | this.textBoxName.MaxLength = 32;
63 | this.textBoxName.Name = "textBoxName";
64 | this.textBoxName.Size = new System.Drawing.Size(190, 20);
65 | this.textBoxName.TabIndex = 0;
66 | //
67 | // textBoxIpAddress
68 | //
69 | this.textBoxIpAddress.Location = new System.Drawing.Point(78, 38);
70 | this.textBoxIpAddress.MaxLength = 16;
71 | this.textBoxIpAddress.Name = "textBoxIpAddress";
72 | this.textBoxIpAddress.Size = new System.Drawing.Size(190, 20);
73 | this.textBoxIpAddress.TabIndex = 1;
74 | //
75 | // labelName
76 | //
77 | this.labelName.AutoSize = true;
78 | this.labelName.Location = new System.Drawing.Point(31, 15);
79 | this.labelName.Name = "labelName";
80 | this.labelName.Size = new System.Drawing.Size(41, 13);
81 | this.labelName.TabIndex = 4;
82 | this.labelName.Text = "Name: ";
83 | //
84 | // labelIpAddress
85 | //
86 | this.labelIpAddress.AutoSize = true;
87 | this.labelIpAddress.Location = new System.Drawing.Point(11, 41);
88 | this.labelIpAddress.Name = "labelIpAddress";
89 | this.labelIpAddress.Size = new System.Drawing.Size(61, 13);
90 | this.labelIpAddress.TabIndex = 5;
91 | this.labelIpAddress.Text = "IP Address:";
92 | //
93 | // PS4Dialog
94 | //
95 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
96 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
97 | this.ClientSize = new System.Drawing.Size(287, 97);
98 | this.Controls.Add(this.labelIpAddress);
99 | this.Controls.Add(this.labelName);
100 | this.Controls.Add(this.textBoxIpAddress);
101 | this.Controls.Add(this.textBoxName);
102 | this.Controls.Add(this.button2);
103 | this.Controls.Add(this.button1);
104 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
105 | this.MaximizeBox = false;
106 | this.MinimizeBox = false;
107 | this.Name = "PS4Dialog";
108 | this.ShowIcon = false;
109 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
110 | this.Text = "PS4";
111 | this.ResumeLayout(false);
112 | this.PerformLayout();
113 |
114 | }
115 |
116 | #endregion
117 |
118 | private System.Windows.Forms.Button button1;
119 | private System.Windows.Forms.Button button2;
120 | private System.Windows.Forms.TextBox textBoxName;
121 | private System.Windows.Forms.TextBox textBoxIpAddress;
122 | private System.Windows.Forms.Label labelName;
123 | private System.Windows.Forms.Label labelIpAddress;
124 | }
125 | }
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/PS4Dialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace MEMAPI_Debugger.Dialogs
12 | {
13 | public partial class PS4Dialog : Form
14 | {
15 | public PS4 ps4 { get; set; }
16 |
17 | public PS4Dialog()
18 | {
19 | InitializeComponent();
20 | ps4 = new PS4();
21 | }
22 |
23 | public void updateFields()
24 | {
25 | textBoxIpAddress.Text = ps4.IP;
26 | textBoxName.Text = ps4.Name;
27 | }
28 |
29 | private void button1_Click(object sender, EventArgs e)
30 | {
31 | if (textBoxIpAddress.Text == "" || textBoxName.Text == "")
32 | {
33 | MessageBox.Show("Name or IP Address is empty.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
34 | return;
35 | }
36 | ps4.IP = textBoxIpAddress.Text;
37 | ps4.Name = textBoxName.Text;
38 |
39 | // Close dialog
40 | DialogResult = DialogResult.OK;
41 | Close();
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/PS4Dialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/ProcessDialog.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MEMAPI_Debugger.Dialogs
2 | {
3 | partial class ProcessDialog
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | this.listViewProcesses = new System.Windows.Forms.ListView();
33 | this.columnHeaderId = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
34 | this.columnHeaderName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
35 | this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
36 | this.refreshToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
37 | this.buttonOk = new System.Windows.Forms.Button();
38 | this.buttonCancel = new System.Windows.Forms.Button();
39 | this.buttonRefresh = new System.Windows.Forms.Button();
40 | this.contextMenuStrip.SuspendLayout();
41 | this.SuspendLayout();
42 | //
43 | // listViewProcesses
44 | //
45 | this.listViewProcesses.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
46 | this.columnHeaderId,
47 | this.columnHeaderName});
48 | this.listViewProcesses.ContextMenuStrip = this.contextMenuStrip;
49 | this.listViewProcesses.FullRowSelect = true;
50 | this.listViewProcesses.Location = new System.Drawing.Point(12, 12);
51 | this.listViewProcesses.MultiSelect = false;
52 | this.listViewProcesses.Name = "listViewProcesses";
53 | this.listViewProcesses.Size = new System.Drawing.Size(410, 403);
54 | this.listViewProcesses.TabIndex = 0;
55 | this.listViewProcesses.UseCompatibleStateImageBehavior = false;
56 | this.listViewProcesses.View = System.Windows.Forms.View.Details;
57 | this.listViewProcesses.ColumnWidthChanging += new System.Windows.Forms.ColumnWidthChangingEventHandler(this.listViewProcesses_ColumnWidthChanging);
58 | this.listViewProcesses.SelectedIndexChanged += new System.EventHandler(this.listViewProcesses_SelectedIndexChanged);
59 | this.listViewProcesses.DoubleClick += new System.EventHandler(this.listViewProcesses_DoubleClick);
60 | //
61 | // columnHeaderId
62 | //
63 | this.columnHeaderId.Text = "Id";
64 | //
65 | // columnHeaderName
66 | //
67 | this.columnHeaderName.Text = "Name";
68 | this.columnHeaderName.Width = 305;
69 | //
70 | // contextMenuStrip
71 | //
72 | this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
73 | this.refreshToolStripMenuItem});
74 | this.contextMenuStrip.Name = "contextMenuStrip";
75 | this.contextMenuStrip.Size = new System.Drawing.Size(114, 26);
76 | //
77 | // refreshToolStripMenuItem
78 | //
79 | this.refreshToolStripMenuItem.Name = "refreshToolStripMenuItem";
80 | this.refreshToolStripMenuItem.Size = new System.Drawing.Size(113, 22);
81 | this.refreshToolStripMenuItem.Text = "Refresh";
82 | this.refreshToolStripMenuItem.Click += new System.EventHandler(this.refreshToolStripMenuItem_Click);
83 | //
84 | // buttonOk
85 | //
86 | this.buttonOk.Location = new System.Drawing.Point(12, 421);
87 | this.buttonOk.Name = "buttonOk";
88 | this.buttonOk.Size = new System.Drawing.Size(132, 23);
89 | this.buttonOk.TabIndex = 1;
90 | this.buttonOk.Text = "OK";
91 | this.buttonOk.UseVisualStyleBackColor = true;
92 | this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click);
93 | //
94 | // buttonCancel
95 | //
96 | this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
97 | this.buttonCancel.Location = new System.Drawing.Point(151, 421);
98 | this.buttonCancel.Name = "buttonCancel";
99 | this.buttonCancel.Size = new System.Drawing.Size(132, 23);
100 | this.buttonCancel.TabIndex = 2;
101 | this.buttonCancel.Text = "Cancel";
102 | this.buttonCancel.UseVisualStyleBackColor = true;
103 | //
104 | // buttonRefresh
105 | //
106 | this.buttonRefresh.Location = new System.Drawing.Point(290, 421);
107 | this.buttonRefresh.Name = "buttonRefresh";
108 | this.buttonRefresh.Size = new System.Drawing.Size(132, 23);
109 | this.buttonRefresh.TabIndex = 3;
110 | this.buttonRefresh.Text = "Refresh";
111 | this.buttonRefresh.UseVisualStyleBackColor = true;
112 | this.buttonRefresh.Click += new System.EventHandler(this.buttonRefresh_Click);
113 | //
114 | // ProcessDialog
115 | //
116 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
117 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
118 | this.ClientSize = new System.Drawing.Size(434, 452);
119 | this.Controls.Add(this.buttonRefresh);
120 | this.Controls.Add(this.buttonCancel);
121 | this.Controls.Add(this.buttonOk);
122 | this.Controls.Add(this.listViewProcesses);
123 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
124 | this.MaximizeBox = false;
125 | this.MinimizeBox = false;
126 | this.Name = "ProcessDialog";
127 | this.ShowIcon = false;
128 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
129 | this.Text = "Processes";
130 | this.contextMenuStrip.ResumeLayout(false);
131 | this.ResumeLayout(false);
132 |
133 | }
134 |
135 | #endregion
136 |
137 | private System.Windows.Forms.ListView listViewProcesses;
138 | private System.Windows.Forms.ColumnHeader columnHeaderId;
139 | private System.Windows.Forms.ColumnHeader columnHeaderName;
140 | private System.Windows.Forms.Button buttonOk;
141 | private System.Windows.Forms.Button buttonCancel;
142 | private System.Windows.Forms.Button buttonRefresh;
143 | private System.Windows.Forms.ContextMenuStrip contextMenuStrip;
144 | private System.Windows.Forms.ToolStripMenuItem refreshToolStripMenuItem;
145 | }
146 | }
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/ProcessDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using MEMAPI;
11 |
12 | namespace MEMAPI_Debugger.Dialogs
13 | {
14 | public partial class ProcessDialog : Form
15 | {
16 | public Process process { get; set; }
17 |
18 | private List processes;
19 |
20 | public ProcessDialog()
21 | {
22 | InitializeComponent();
23 | process = null;
24 | refresh();
25 | }
26 |
27 | private void refresh()
28 | {
29 | API.ErrorCode error;
30 | processes = API.getProcesses(out error);
31 |
32 | listViewProcesses.Items.Clear();
33 | for (int i = processes.Count - 1; i >= 0; i--)
34 | listViewProcesses.Items.Add(new ListViewItem(processes[i].toArray()));
35 | }
36 |
37 | private void buttonOk_Click(object sender, EventArgs e)
38 | {
39 | if (process == null)
40 | {
41 | MessageBox.Show("No Process has been selected.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
42 | return;
43 | }
44 |
45 | // Close dialog
46 | DialogResult = DialogResult.OK;
47 | Close();
48 | }
49 |
50 | private void buttonRefresh_Click(object sender, EventArgs e)
51 | {
52 | refresh();
53 | }
54 |
55 | private void refreshToolStripMenuItem_Click(object sender, EventArgs e)
56 | {
57 | refresh();
58 | }
59 |
60 | private void listViewProcesses_SelectedIndexChanged(object sender, EventArgs e)
61 | {
62 | if (listViewProcesses.SelectedItems.Count == 0)
63 | return;
64 |
65 | ListViewItem item = listViewProcesses.SelectedItems[0];
66 | process = new Process(Convert.ToInt32(item.SubItems[0].Text), item.SubItems[1].Text);
67 | }
68 |
69 | private void listViewProcesses_DoubleClick(object sender, EventArgs e)
70 | {
71 | if (process == null)
72 | return;
73 |
74 | // Close dialog
75 | DialogResult = DialogResult.OK;
76 | Close();
77 | }
78 |
79 | private void listViewProcesses_ColumnWidthChanging(object sender, ColumnWidthChangingEventArgs e)
80 | {
81 | // Disable column resizing
82 | e.Cancel = true;
83 | e.NewWidth = listViewProcesses.Columns[e.ColumnIndex].Width;
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/ProcessDialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/SelectTargetDialog.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MEMAPI_Debugger.Dialogs
2 | {
3 | partial class SelectTargetDialog
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | this.buttonOk = new System.Windows.Forms.Button();
33 | this.buttonCancel = new System.Windows.Forms.Button();
34 | this.listViewPS4s = new System.Windows.Forms.ListView();
35 | this.columnHeaderName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
36 | this.columnHeaderIp = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
37 | this.columnHeaderStatus = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
38 | this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
39 | this.addToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
40 | this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
41 | this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
42 | this.buttonRefresh = new System.Windows.Forms.Button();
43 | this.buttonFindTargets = new System.Windows.Forms.Button();
44 | this.seperator = new System.Windows.Forms.Label();
45 | this.backgroundWorkerFindTargets = new System.ComponentModel.BackgroundWorker();
46 | this.statusStrip = new System.Windows.Forms.StatusStrip();
47 | this.toolStripProgressBar = new System.Windows.Forms.ToolStripProgressBar();
48 | this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
49 | this.contextMenuStrip.SuspendLayout();
50 | this.statusStrip.SuspendLayout();
51 | this.SuspendLayout();
52 | //
53 | // buttonOk
54 | //
55 | this.buttonOk.Location = new System.Drawing.Point(12, 244);
56 | this.buttonOk.Name = "buttonOk";
57 | this.buttonOk.Size = new System.Drawing.Size(75, 23);
58 | this.buttonOk.TabIndex = 1;
59 | this.buttonOk.Text = "OK";
60 | this.buttonOk.UseVisualStyleBackColor = true;
61 | this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click);
62 | //
63 | // buttonCancel
64 | //
65 | this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
66 | this.buttonCancel.Location = new System.Drawing.Point(93, 244);
67 | this.buttonCancel.Name = "buttonCancel";
68 | this.buttonCancel.Size = new System.Drawing.Size(75, 23);
69 | this.buttonCancel.TabIndex = 2;
70 | this.buttonCancel.Text = "Cancel";
71 | this.buttonCancel.UseVisualStyleBackColor = true;
72 | //
73 | // listViewPS4s
74 | //
75 | this.listViewPS4s.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
76 | this.columnHeaderName,
77 | this.columnHeaderIp,
78 | this.columnHeaderStatus});
79 | this.listViewPS4s.ContextMenuStrip = this.contextMenuStrip;
80 | this.listViewPS4s.FullRowSelect = true;
81 | this.listViewPS4s.Location = new System.Drawing.Point(12, 12);
82 | this.listViewPS4s.MultiSelect = false;
83 | this.listViewPS4s.Name = "listViewPS4s";
84 | this.listViewPS4s.Size = new System.Drawing.Size(320, 213);
85 | this.listViewPS4s.TabIndex = 0;
86 | this.listViewPS4s.UseCompatibleStateImageBehavior = false;
87 | this.listViewPS4s.View = System.Windows.Forms.View.Details;
88 | this.listViewPS4s.ColumnWidthChanging += new System.Windows.Forms.ColumnWidthChangingEventHandler(this.listViewPS4s_ColumnWidthChanging);
89 | this.listViewPS4s.SelectedIndexChanged += new System.EventHandler(this.listViewPS4s_SelectedIndexChanged);
90 | this.listViewPS4s.DoubleClick += new System.EventHandler(this.listViewPS4s_DoubleClick);
91 | //
92 | // columnHeaderName
93 | //
94 | this.columnHeaderName.Text = "Name";
95 | this.columnHeaderName.Width = 115;
96 | //
97 | // columnHeaderIp
98 | //
99 | this.columnHeaderIp.Text = "IP Address";
100 | this.columnHeaderIp.Width = 120;
101 | //
102 | // columnHeaderStatus
103 | //
104 | this.columnHeaderStatus.Text = "Status";
105 | this.columnHeaderStatus.Width = 80;
106 | //
107 | // contextMenuStrip
108 | //
109 | this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
110 | this.addToolStripMenuItem,
111 | this.editToolStripMenuItem,
112 | this.removeToolStripMenuItem});
113 | this.contextMenuStrip.Name = "contextMenuStrip";
114 | this.contextMenuStrip.Size = new System.Drawing.Size(118, 70);
115 | this.contextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip_Opening);
116 | //
117 | // addToolStripMenuItem
118 | //
119 | this.addToolStripMenuItem.Name = "addToolStripMenuItem";
120 | this.addToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
121 | this.addToolStripMenuItem.Text = "Add";
122 | this.addToolStripMenuItem.Click += new System.EventHandler(this.addToolStripMenuItem_Click);
123 | //
124 | // editToolStripMenuItem
125 | //
126 | this.editToolStripMenuItem.Name = "editToolStripMenuItem";
127 | this.editToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
128 | this.editToolStripMenuItem.Text = "Edit";
129 | this.editToolStripMenuItem.Click += new System.EventHandler(this.editToolStripMenuItem_Click);
130 | //
131 | // removeToolStripMenuItem
132 | //
133 | this.removeToolStripMenuItem.Name = "removeToolStripMenuItem";
134 | this.removeToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
135 | this.removeToolStripMenuItem.Text = "Remove";
136 | this.removeToolStripMenuItem.Click += new System.EventHandler(this.removeToolStripMenuItem_Click);
137 | //
138 | // buttonRefresh
139 | //
140 | this.buttonRefresh.Location = new System.Drawing.Point(174, 244);
141 | this.buttonRefresh.Name = "buttonRefresh";
142 | this.buttonRefresh.Size = new System.Drawing.Size(75, 23);
143 | this.buttonRefresh.TabIndex = 3;
144 | this.buttonRefresh.Text = "Refresh";
145 | this.buttonRefresh.UseVisualStyleBackColor = true;
146 | this.buttonRefresh.Click += new System.EventHandler(this.buttonRefresh_Click);
147 | //
148 | // buttonFindTargets
149 | //
150 | this.buttonFindTargets.Location = new System.Drawing.Point(257, 244);
151 | this.buttonFindTargets.Name = "buttonFindTargets";
152 | this.buttonFindTargets.Size = new System.Drawing.Size(75, 23);
153 | this.buttonFindTargets.TabIndex = 4;
154 | this.buttonFindTargets.Text = "Find Targets";
155 | this.buttonFindTargets.UseVisualStyleBackColor = true;
156 | this.buttonFindTargets.Click += new System.EventHandler(this.buttonFindTargets_Click);
157 | //
158 | // seperator
159 | //
160 | this.seperator.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
161 | this.seperator.Location = new System.Drawing.Point(12, 234);
162 | this.seperator.Name = "seperator";
163 | this.seperator.Size = new System.Drawing.Size(320, 2);
164 | this.seperator.TabIndex = 6;
165 | //
166 | // backgroundWorkerFindTargets
167 | //
168 | this.backgroundWorkerFindTargets.WorkerReportsProgress = true;
169 | this.backgroundWorkerFindTargets.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorkerFindTargets_DoWork);
170 | this.backgroundWorkerFindTargets.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorkerFindTargets_ProgressChanged);
171 | this.backgroundWorkerFindTargets.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorkerFindTargets_RunWorkerCompleted);
172 | //
173 | // statusStrip
174 | //
175 | this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
176 | this.toolStripProgressBar,
177 | this.toolStripStatusLabel});
178 | this.statusStrip.Location = new System.Drawing.Point(0, 249);
179 | this.statusStrip.Name = "statusStrip";
180 | this.statusStrip.Size = new System.Drawing.Size(344, 22);
181 | this.statusStrip.SizingGrip = false;
182 | this.statusStrip.TabIndex = 7;
183 | this.statusStrip.Text = "statusStrip";
184 | this.statusStrip.Visible = false;
185 | //
186 | // toolStripProgressBar
187 | //
188 | this.toolStripProgressBar.Maximum = 256;
189 | this.toolStripProgressBar.Name = "toolStripProgressBar";
190 | this.toolStripProgressBar.Size = new System.Drawing.Size(100, 16);
191 | //
192 | // toolStripStatusLabel
193 | //
194 | this.toolStripStatusLabel.Name = "toolStripStatusLabel";
195 | this.toolStripStatusLabel.Size = new System.Drawing.Size(23, 17);
196 | this.toolStripStatusLabel.Text = "0%";
197 | //
198 | // SelectTargetDialog
199 | //
200 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
201 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
202 | this.ClientSize = new System.Drawing.Size(344, 271);
203 | this.Controls.Add(this.statusStrip);
204 | this.Controls.Add(this.seperator);
205 | this.Controls.Add(this.buttonFindTargets);
206 | this.Controls.Add(this.buttonRefresh);
207 | this.Controls.Add(this.listViewPS4s);
208 | this.Controls.Add(this.buttonCancel);
209 | this.Controls.Add(this.buttonOk);
210 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
211 | this.MaximizeBox = false;
212 | this.MinimizeBox = false;
213 | this.Name = "SelectTargetDialog";
214 | this.ShowIcon = false;
215 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
216 | this.Text = "Select Target";
217 | this.contextMenuStrip.ResumeLayout(false);
218 | this.statusStrip.ResumeLayout(false);
219 | this.statusStrip.PerformLayout();
220 | this.ResumeLayout(false);
221 | this.PerformLayout();
222 |
223 | }
224 |
225 | #endregion
226 |
227 | private System.Windows.Forms.Button buttonOk;
228 | private System.Windows.Forms.Button buttonCancel;
229 | private System.Windows.Forms.ListView listViewPS4s;
230 | private System.Windows.Forms.ColumnHeader columnHeaderName;
231 | private System.Windows.Forms.ColumnHeader columnHeaderIp;
232 | private System.Windows.Forms.ColumnHeader columnHeaderStatus;
233 | private System.Windows.Forms.Button buttonRefresh;
234 | private System.Windows.Forms.Button buttonFindTargets;
235 | private System.Windows.Forms.Label seperator;
236 | private System.ComponentModel.BackgroundWorker backgroundWorkerFindTargets;
237 | private System.Windows.Forms.StatusStrip statusStrip;
238 | private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar;
239 | private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel;
240 | private System.Windows.Forms.ContextMenuStrip contextMenuStrip;
241 | private System.Windows.Forms.ToolStripMenuItem addToolStripMenuItem;
242 | private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
243 | private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem;
244 | }
245 | }
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/SelectTargetDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.IO;
7 | using System.Linq;
8 | using System.Net;
9 | using System.Net.NetworkInformation;
10 | using System.Net.Sockets;
11 | using System.Runtime.Serialization.Formatters.Binary;
12 | using System.Text;
13 | using System.Threading.Tasks;
14 | using System.Windows.Forms;
15 |
16 | namespace MEMAPI_Debugger.Dialogs
17 | {
18 | public partial class SelectTargetDialog : Form
19 | {
20 | public string IP { get; set; }
21 |
22 | private List ps4s;
23 |
24 | public SelectTargetDialog()
25 | {
26 | InitializeComponent();
27 | ps4s = new List();
28 | loadPS4s();
29 | refresh();
30 | }
31 |
32 | private void loadPS4s()
33 | {
34 | ps4s.Clear();
35 |
36 | if (Properties.Settings.Default.ps4s == null || Properties.Settings.Default.ps4s == "")
37 | return;
38 |
39 | try
40 | {
41 | using (MemoryStream ms = new MemoryStream(Convert.FromBase64String(Properties.Settings.Default.ps4s)))
42 | {
43 | BinaryFormatter bf = new BinaryFormatter();
44 | ps4s = (List)bf.Deserialize(ms);
45 | }
46 | }
47 | catch
48 | {
49 | Properties.Settings.Default.ps4s = "";
50 | Properties.Settings.Default.Save();
51 | }
52 | }
53 |
54 | private void savePS4s()
55 | {
56 | using (MemoryStream ms = new MemoryStream())
57 | {
58 | BinaryFormatter bf = new BinaryFormatter();
59 | bf.Serialize(ms, ps4s);
60 | ms.Position = 0;
61 | byte[] buffer = new byte[(int)ms.Length];
62 | ms.Read(buffer, 0, buffer.Length);
63 | Properties.Settings.Default.ps4s = Convert.ToBase64String(buffer);
64 | Properties.Settings.Default.Save();
65 | }
66 | }
67 |
68 | private void findTargets()
69 | {
70 | if (!backgroundWorkerFindTargets.IsBusy)
71 | {
72 | Height = 335;
73 | buttonOk.Enabled = false;
74 | buttonCancel.Enabled = false;
75 | buttonRefresh.Enabled = false;
76 | buttonFindTargets.Enabled = false;
77 | statusStrip.Visible = true;
78 | toolStripStatusLabel.Text = "0%";
79 | toolStripProgressBar.Value = 0;
80 | contextMenuStrip.Enabled = false;
81 | backgroundWorkerFindTargets.RunWorkerAsync();
82 | }
83 | }
84 |
85 | private void addPS4(PS4 ps4)
86 | {
87 | // Ensure it's not already on our list
88 | for (int i = 0; i < ps4s.Count; i++)
89 | {
90 | if (ps4s[i].IP == ps4.IP)
91 | return;
92 | }
93 |
94 | // Add it
95 | ps4s.Add(ps4);
96 | }
97 |
98 | private void removePS4(string ip)
99 | {
100 | if (Properties.Settings.Default.defaultPs4Ip == ip)
101 | {
102 | Properties.Settings.Default.defaultPs4Ip = "";
103 | Properties.Settings.Default.Save();
104 | }
105 |
106 | ps4s.RemoveAt(getPS4Index(ip));
107 | }
108 |
109 | private int getPS4Index(string ip)
110 | {
111 | for (int i = 0; i < ps4s.Count; i++)
112 | {
113 | if (ps4s[i].IP == ip)
114 | return i;
115 | }
116 | return -1;
117 | }
118 |
119 | private bool checkTarget(string ip)
120 | {
121 | TcpClient client = new TcpClient();
122 | try
123 | {
124 | if (client.ConnectAsync(ip, 9020).Wait(75))
125 | {
126 | client.Close();
127 | return true;
128 | }
129 | return false;
130 | }
131 | catch
132 | {
133 | client.Close();
134 | return false;
135 | }
136 | }
137 |
138 | private string getLocalIp()
139 | {
140 | Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, 0);
141 | socket.Connect("8.8.8.8", 65530);
142 | IPEndPoint endPoint = socket.LocalEndPoint as IPEndPoint;
143 | string localIP = endPoint.Address.ToString();
144 | socket.Close();
145 | return localIP;
146 | }
147 |
148 | private void refresh()
149 | {
150 | listViewPS4s.Items.Clear();
151 | for (int i = 0; i < ps4s.Count; i++)
152 | listViewPS4s.Items.Add(new ListViewItem(ps4s[i].toArray()));
153 | }
154 |
155 | private void listViewPS4s_ColumnWidthChanging(object sender, ColumnWidthChangingEventArgs e)
156 | {
157 | // Disable column resizing
158 | e.Cancel = true;
159 | e.NewWidth = listViewPS4s.Columns[e.ColumnIndex].Width;
160 | }
161 |
162 | private void buttonRefresh_Click(object sender, EventArgs e)
163 | {
164 | refresh();
165 | }
166 |
167 | private void buttonFindTargets_Click(object sender, EventArgs e)
168 | {
169 | if (MessageBox.Show("You must have the Webkit Exploit running on your PS4.\nAfter the scan has finished, you will need to reload the Webkit Exploit before sending the payload.\n\nAre you sure you want to continue?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
170 | return;
171 | findTargets();
172 | }
173 |
174 | private void listViewPS4s_SelectedIndexChanged(object sender, EventArgs e)
175 | {
176 | if (listViewPS4s.SelectedItems.Count == 0)
177 | return;
178 |
179 | IP = listViewPS4s.SelectedItems[0].SubItems[1].Text;
180 | }
181 |
182 | private void listViewPS4s_DoubleClick(object sender, EventArgs e)
183 | {
184 | if (IP == null)
185 | return;
186 |
187 | // Close dialog
188 | DialogResult = DialogResult.OK;
189 | Close();
190 | }
191 |
192 | private void buttonOk_Click(object sender, EventArgs e)
193 | {
194 | if (IP == null)
195 | {
196 | MessageBox.Show("No PS4 has been selected.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
197 | return;
198 | }
199 |
200 | // Close dialog
201 | DialogResult = DialogResult.OK;
202 | Close();
203 | }
204 |
205 | private void backgroundWorkerFindTargets_DoWork(object sender, DoWorkEventArgs e)
206 | {
207 | string ipAddres = getLocalIp();
208 | string localSubnet = ipAddres.Substring(0, ipAddres.LastIndexOf("."));
209 |
210 | for (int i = 0; i < 256; i++)
211 | {
212 | string checkIp = localSubnet + "." + i.ToString();
213 | if (checkTarget(checkIp))
214 | addPS4(new PS4(checkIp, checkIp));
215 | BackgroundWorker bg = (BackgroundWorker)sender;
216 | bg.ReportProgress(i);
217 | }
218 |
219 | if (InvokeRequired)
220 | {
221 | Invoke(new MethodInvoker(() => {
222 | refresh();
223 | }));
224 | return;
225 | }
226 | refresh();
227 | }
228 |
229 | private void backgroundWorkerFindTargets_ProgressChanged(object sender, ProgressChangedEventArgs e)
230 | {
231 | if (InvokeRequired)
232 | {
233 | Invoke(new MethodInvoker(() => {
234 | toolStripProgressBar.Value = e.ProgressPercentage;
235 | toolStripStatusLabel.Text = Math.Floor(e.ProgressPercentage / 2.56f) + "%";
236 | }));
237 | return;
238 | }
239 | toolStripProgressBar.Value = e.ProgressPercentage;
240 | toolStripStatusLabel.Text = Math.Floor(e.ProgressPercentage / 2.56f) + "%";
241 | }
242 |
243 | private void backgroundWorkerFindTargets_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
244 | {
245 | Height = 310;
246 | buttonOk.Enabled = true;
247 | buttonCancel.Enabled = true;
248 | buttonRefresh.Enabled = true;
249 | buttonFindTargets.Enabled = true;
250 | statusStrip.Visible = false;
251 | contextMenuStrip.Enabled = true;
252 | savePS4s();
253 | }
254 |
255 | private void addToolStripMenuItem_Click(object sender, EventArgs e)
256 | {
257 | PS4Dialog dialog = new PS4Dialog();
258 | if (dialog.ShowDialog() == DialogResult.OK)
259 | {
260 | addPS4(dialog.ps4);
261 | savePS4s();
262 | refresh();
263 | }
264 | }
265 |
266 | private void editToolStripMenuItem_Click(object sender, EventArgs e)
267 | {
268 | if (listViewPS4s.SelectedItems.Count == 0)
269 | return;
270 |
271 | PS4Dialog dialog = new PS4Dialog();
272 |
273 | int index = getPS4Index(listViewPS4s.SelectedItems[0].SubItems[1].Text);
274 |
275 | dialog.ps4 = ps4s[index];
276 | dialog.updateFields();
277 | if (dialog.ShowDialog() == DialogResult.OK)
278 | {
279 | ps4s[index] = dialog.ps4;
280 | savePS4s();
281 | refresh();
282 | }
283 | }
284 |
285 | private void removeToolStripMenuItem_Click(object sender, EventArgs e)
286 | {
287 | if (listViewPS4s.SelectedItems.Count == 0)
288 | return;
289 |
290 | removePS4(listViewPS4s.SelectedItems[0].SubItems[1].Text);
291 | savePS4s();
292 | refresh();
293 | }
294 |
295 | private void contextMenuStrip_Opening(object sender, CancelEventArgs e)
296 | {
297 | editToolStripMenuItem.Enabled = listViewPS4s.SelectedItems.Count > 0;
298 | removeToolStripMenuItem.Enabled = listViewPS4s.SelectedItems.Count > 0;
299 | }
300 | }
301 | }
302 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/SelectTargetDialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 347, 17
122 |
123 |
124 | 17, 17
125 |
126 |
127 | 238, 17
128 |
129 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/StringDialog.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MEMAPI_Debugger.Dialogs
2 | {
3 | partial class StringDialog
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.textBoxString = new System.Windows.Forms.TextBox();
32 | this.buttonOk = new System.Windows.Forms.Button();
33 | this.buttonCancel = new System.Windows.Forms.Button();
34 | this.SuspendLayout();
35 | //
36 | // textBoxString
37 | //
38 | this.textBoxString.Location = new System.Drawing.Point(12, 12);
39 | this.textBoxString.Name = "textBoxString";
40 | this.textBoxString.Size = new System.Drawing.Size(255, 20);
41 | this.textBoxString.TabIndex = 0;
42 | //
43 | // buttonOk
44 | //
45 | this.buttonOk.Location = new System.Drawing.Point(12, 38);
46 | this.buttonOk.Name = "buttonOk";
47 | this.buttonOk.Size = new System.Drawing.Size(125, 23);
48 | this.buttonOk.TabIndex = 1;
49 | this.buttonOk.Text = "OK";
50 | this.buttonOk.UseVisualStyleBackColor = true;
51 | this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click);
52 | //
53 | // buttonCancel
54 | //
55 | this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
56 | this.buttonCancel.Location = new System.Drawing.Point(142, 38);
57 | this.buttonCancel.Name = "buttonCancel";
58 | this.buttonCancel.Size = new System.Drawing.Size(125, 23);
59 | this.buttonCancel.TabIndex = 2;
60 | this.buttonCancel.Text = "Cancel";
61 | this.buttonCancel.UseVisualStyleBackColor = true;
62 | //
63 | // StringDialog
64 | //
65 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
66 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
67 | this.ClientSize = new System.Drawing.Size(275, 70);
68 | this.Controls.Add(this.buttonCancel);
69 | this.Controls.Add(this.buttonOk);
70 | this.Controls.Add(this.textBoxString);
71 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
72 | this.MaximizeBox = false;
73 | this.MinimizeBox = false;
74 | this.Name = "StringDialog";
75 | this.ShowIcon = false;
76 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
77 | this.ResumeLayout(false);
78 | this.PerformLayout();
79 |
80 | }
81 |
82 | #endregion
83 |
84 | private System.Windows.Forms.TextBox textBoxString;
85 | private System.Windows.Forms.Button buttonOk;
86 | private System.Windows.Forms.Button buttonCancel;
87 | }
88 | }
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/StringDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace MEMAPI_Debugger.Dialogs
12 | {
13 | public partial class StringDialog : Form
14 | {
15 | public String Message { get; set; }
16 |
17 | public StringDialog(string title)
18 | {
19 | InitializeComponent();
20 | Text = title;
21 | }
22 |
23 | public void updateField()
24 | {
25 | textBoxString.Text = Message;
26 | }
27 |
28 | private void buttonOk_Click(object sender, EventArgs e)
29 | {
30 | if (textBoxString.Text == "")
31 | {
32 | MessageBox.Show("Message must not be empty.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
33 | return;
34 | }
35 | Message = textBoxString.Text;
36 |
37 | // Close dialog
38 | DialogResult = DialogResult.OK;
39 | Close();
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Dialogs/StringDialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/FodyWeavers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Forms/BreakpointsForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MEMAPI_Debugger.Forms
2 | {
3 | partial class BreakpointsForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BreakpointsForm));
32 | this.SuspendLayout();
33 | //
34 | // BreakpointsForm
35 | //
36 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
37 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
38 | this.ClientSize = new System.Drawing.Size(800, 450);
39 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
40 | this.Name = "BreakpointsForm";
41 | this.Text = "Breakpoints";
42 | this.ResumeLayout(false);
43 |
44 | }
45 |
46 | #endregion
47 | }
48 | }
--------------------------------------------------------------------------------
/MEMAPI Debugger/Forms/BreakpointsForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace MEMAPI_Debugger.Forms
12 | {
13 | public partial class BreakpointsForm : Form
14 | {
15 | public BreakpointsForm()
16 | {
17 | InitializeComponent();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Forms/ConsoleForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MEMAPI_Debugger.Forms
2 | {
3 | partial class ConsoleForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConsoleForm));
32 | this.consoleOutput = new System.Windows.Forms.TextBox();
33 | this.SuspendLayout();
34 | //
35 | // consoleOutput
36 | //
37 | this.consoleOutput.Dock = System.Windows.Forms.DockStyle.Fill;
38 | this.consoleOutput.Location = new System.Drawing.Point(0, 0);
39 | this.consoleOutput.Multiline = true;
40 | this.consoleOutput.Name = "consoleOutput";
41 | this.consoleOutput.ReadOnly = true;
42 | this.consoleOutput.ScrollBars = System.Windows.Forms.ScrollBars.Both;
43 | this.consoleOutput.Size = new System.Drawing.Size(800, 450);
44 | this.consoleOutput.TabIndex = 0;
45 | this.consoleOutput.WordWrap = false;
46 | //
47 | // ConsoleForm
48 | //
49 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
50 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
51 | this.ClientSize = new System.Drawing.Size(800, 450);
52 | this.Controls.Add(this.consoleOutput);
53 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
54 | this.Name = "ConsoleForm";
55 | this.Text = "Console";
56 | this.ResumeLayout(false);
57 | this.PerformLayout();
58 |
59 | }
60 |
61 | #endregion
62 |
63 | private System.Windows.Forms.TextBox consoleOutput;
64 | }
65 | }
--------------------------------------------------------------------------------
/MEMAPI Debugger/Forms/ConsoleForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Drawing.Text;
7 | using System.IO;
8 | using System.Linq;
9 | using System.Reflection;
10 | using System.Runtime.InteropServices;
11 | using System.Text;
12 | using System.Threading.Tasks;
13 | using System.Windows.Forms;
14 |
15 | namespace MEMAPI_Debugger.Forms
16 | {
17 | public partial class ConsoleForm : Form
18 | {
19 | public ConsoleForm()
20 | {
21 | InitializeComponent();
22 |
23 | // Custom Font
24 | consoleOutput.Font = Resource.getCustomFont(Resource.monospace);
25 | MEMAPI.Server.ServerQueueUpdated += c_ServerQueueUpdated;
26 | }
27 |
28 | private void c_ServerQueueUpdated(object sender, EventArgs e)
29 | {
30 | if (consoleOutput.InvokeRequired)
31 | {
32 | Invoke(new MethodInvoker(() => {
33 | consoleOutput.Lines = MEMAPI.Server.lines.ToArray();
34 | consoleOutput.SelectionStart = consoleOutput.Text.Length;
35 | consoleOutput.ScrollToCaret();
36 | }));
37 | return;
38 | }
39 | consoleOutput.Lines = MEMAPI.Server.lines.ToArray();
40 | consoleOutput.SelectionStart = consoleOutput.Text.Length;
41 | consoleOutput.ScrollToCaret();
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/MEMAPI Debugger/Forms/DisassemblyForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MEMAPI_Debugger.Forms
2 | {
3 | partial class DisassemblyForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DisassemblyForm));
33 | this.listView = new System.Windows.Forms.ListView();
34 | this.columnHeaderAddress = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
35 | this.columnHeaderOpcode = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
36 | this.columnHeaderOperands = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
37 | this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
38 | this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
39 | this.copyAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
40 | this.copyOpcodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
41 | this.copyOperandsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
42 | this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
43 | this.goToAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
44 | this.goToInstructionPointerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
45 | this.imageListBreakpoint = new System.Windows.Forms.ImageList(this.components);
46 | this.contextMenuStrip.SuspendLayout();
47 | this.SuspendLayout();
48 | //
49 | // listView
50 | //
51 | this.listView.CheckBoxes = true;
52 | this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
53 | this.columnHeaderAddress,
54 | this.columnHeaderOpcode,
55 | this.columnHeaderOperands});
56 | this.listView.ContextMenuStrip = this.contextMenuStrip;
57 | this.listView.Dock = System.Windows.Forms.DockStyle.Fill;
58 | this.listView.FullRowSelect = true;
59 | this.listView.Location = new System.Drawing.Point(0, 0);
60 | this.listView.Name = "listView";
61 | this.listView.Size = new System.Drawing.Size(629, 539);
62 | this.listView.StateImageList = this.imageListBreakpoint;
63 | this.listView.TabIndex = 0;
64 | this.listView.UseCompatibleStateImageBehavior = false;
65 | this.listView.View = System.Windows.Forms.View.Details;
66 | this.listView.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.listView_ItemCheck);
67 | //
68 | // columnHeaderAddress
69 | //
70 | this.columnHeaderAddress.Text = "Address";
71 | this.columnHeaderAddress.Width = 150;
72 | //
73 | // columnHeaderOpcode
74 | //
75 | this.columnHeaderOpcode.Text = "Opcode";
76 | this.columnHeaderOpcode.Width = 100;
77 | //
78 | // columnHeaderOperands
79 | //
80 | this.columnHeaderOperands.Text = "Operands";
81 | this.columnHeaderOperands.Width = 250;
82 | //
83 | // contextMenuStrip
84 | //
85 | this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
86 | this.copyToolStripMenuItem,
87 | this.copyAddressToolStripMenuItem,
88 | this.copyOpcodeToolStripMenuItem,
89 | this.copyOperandsToolStripMenuItem,
90 | this.toolStripSeparator1,
91 | this.goToAddressToolStripMenuItem,
92 | this.goToInstructionPointerToolStripMenuItem});
93 | this.contextMenuStrip.Name = "contextMenuStrip";
94 | this.contextMenuStrip.Size = new System.Drawing.Size(198, 142);
95 | this.contextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip_Opening);
96 | //
97 | // copyToolStripMenuItem
98 | //
99 | this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
100 | this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
101 | this.copyToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
102 | this.copyToolStripMenuItem.Text = "Copy";
103 | this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click);
104 | //
105 | // copyAddressToolStripMenuItem
106 | //
107 | this.copyAddressToolStripMenuItem.Name = "copyAddressToolStripMenuItem";
108 | this.copyAddressToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
109 | this.copyAddressToolStripMenuItem.Text = "Copy address";
110 | this.copyAddressToolStripMenuItem.Click += new System.EventHandler(this.copyAddressToolStripMenuItem_Click);
111 | //
112 | // copyOpcodeToolStripMenuItem
113 | //
114 | this.copyOpcodeToolStripMenuItem.Name = "copyOpcodeToolStripMenuItem";
115 | this.copyOpcodeToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
116 | this.copyOpcodeToolStripMenuItem.Text = "Copy opcode";
117 | this.copyOpcodeToolStripMenuItem.Click += new System.EventHandler(this.copyOpcodeToolStripMenuItem_Click);
118 | //
119 | // copyOperandsToolStripMenuItem
120 | //
121 | this.copyOperandsToolStripMenuItem.Name = "copyOperandsToolStripMenuItem";
122 | this.copyOperandsToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
123 | this.copyOperandsToolStripMenuItem.Text = "Copy operands";
124 | this.copyOperandsToolStripMenuItem.Click += new System.EventHandler(this.copyOperandsToolStripMenuItem_Click);
125 | //
126 | // toolStripSeparator1
127 | //
128 | this.toolStripSeparator1.Name = "toolStripSeparator1";
129 | this.toolStripSeparator1.Size = new System.Drawing.Size(194, 6);
130 | //
131 | // goToAddressToolStripMenuItem
132 | //
133 | this.goToAddressToolStripMenuItem.Name = "goToAddressToolStripMenuItem";
134 | this.goToAddressToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G)));
135 | this.goToAddressToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
136 | this.goToAddressToolStripMenuItem.Text = "Go to address";
137 | this.goToAddressToolStripMenuItem.Click += new System.EventHandler(this.goToAddressToolStripMenuItem_Click);
138 | //
139 | // goToInstructionPointerToolStripMenuItem
140 | //
141 | this.goToInstructionPointerToolStripMenuItem.Name = "goToInstructionPointerToolStripMenuItem";
142 | this.goToInstructionPointerToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
143 | | System.Windows.Forms.Keys.G)));
144 | this.goToInstructionPointerToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
145 | this.goToInstructionPointerToolStripMenuItem.Text = "Go to RIP";
146 | this.goToInstructionPointerToolStripMenuItem.Click += new System.EventHandler(this.goToInstructionPointerToolStripMenuItem_Click);
147 | //
148 | // imageListBreakpoint
149 | //
150 | this.imageListBreakpoint.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListBreakpoint.ImageStream")));
151 | this.imageListBreakpoint.TransparentColor = System.Drawing.Color.Transparent;
152 | this.imageListBreakpoint.Images.SetKeyName(0, "transparent.png");
153 | this.imageListBreakpoint.Images.SetKeyName(1, "pointer.png");
154 | //
155 | // DisassemblyForm
156 | //
157 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
158 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
159 | this.ClientSize = new System.Drawing.Size(629, 539);
160 | this.Controls.Add(this.listView);
161 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
162 | this.Name = "DisassemblyForm";
163 | this.Text = "Disassembly";
164 | this.contextMenuStrip.ResumeLayout(false);
165 | this.ResumeLayout(false);
166 |
167 | }
168 |
169 | #endregion
170 |
171 | private System.Windows.Forms.ListView listView;
172 | private System.Windows.Forms.ImageList imageListBreakpoint;
173 | private System.Windows.Forms.ColumnHeader columnHeaderAddress;
174 | private System.Windows.Forms.ContextMenuStrip contextMenuStrip;
175 | private System.Windows.Forms.ToolStripMenuItem goToAddressToolStripMenuItem;
176 | private System.Windows.Forms.ColumnHeader columnHeaderOpcode;
177 | private System.Windows.Forms.ColumnHeader columnHeaderOperands;
178 | private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;
179 | private System.Windows.Forms.ToolStripMenuItem copyAddressToolStripMenuItem;
180 | private System.Windows.Forms.ToolStripMenuItem copyOpcodeToolStripMenuItem;
181 | private System.Windows.Forms.ToolStripMenuItem copyOperandsToolStripMenuItem;
182 | private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
183 | private System.Windows.Forms.ToolStripMenuItem goToInstructionPointerToolStripMenuItem;
184 | }
185 | }
--------------------------------------------------------------------------------
/MEMAPI Debugger/Forms/DisassemblyForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using MEMAPI;
11 | using MEMAPI_Debugger.Dialogs;
12 | using SharpDisasm;
13 | using static System.Windows.Forms.ListViewItem;
14 |
15 | namespace MEMAPI_Debugger.Forms
16 | {
17 | public partial class DisassemblyForm : Form
18 | {
19 | private ulong addressPointer;
20 | private ulong? instructionPointer;
21 | private int instructionIndex;
22 | private int instructionPointerIndex;
23 | private byte[] memory;
24 |
25 | public DisassemblyForm()
26 | {
27 | InitializeComponent();
28 | listView.Font = Resource.getCustomFont(Resource.monospace);
29 |
30 | instructionPointer = null;
31 |
32 | // Events
33 | API.AttachedEvent += onAttached;
34 | API.GoEvent += onGo;
35 | API.SteppedEvent += onStepped;
36 | API.StoppedEvent += onStopped;
37 |
38 | addressPointer = 0x0;
39 | instructionIndex = -1;
40 | instructionPointerIndex = -1;
41 |
42 | goToAddressToolStripMenuItem.Enabled = false;
43 |
44 | // Initialise Disassembler
45 | Disassembler.Translator.IncludeAddress = true;
46 | Disassembler.Translator.IncludeBinary = false;
47 | }
48 |
49 | private void onAttached(object sender, EventArgs e)
50 | {
51 | if (InvokeRequired)
52 | {
53 | Invoke(new Action