/[RomCheater]/trunk/RomCheater/Main.cs
ViewVC logotype

Contents of /trunk/RomCheater/Main.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 678 - (show annotations) (download)
Mon Jun 17 07:01:41 2013 UTC (7 years, 1 month ago) by william
File size: 26033 byte(s)
+ add OnActived/OnDeactivated support to notify all DockedContent that the form is closing

1 #region Logging Defines
2 // include this any class or method that required logging, and comment-out what is not needed
3
4 #region Enabled logging levels
5 #define LOGGING_ENABLE_INFO
6 #define LOGGING_ENABLE_WARN
7 #define LOGGING_ENABLE_DEBUG
8 #define LOGGING_ENABLE_VERBOSEDEBUG
9 #define LOGGING_ENABLE_ERROR
10 #define LOGGING_ENABLE_VERBOSEERROR
11 #define LOGGING_ENABLE_PROFILER
12 #endregion
13 #endregion
14 #define FORCE_ALL_LOGGING_FLAGS // when defined will force logging flags to ALL
15 #define SHOW_DEBUG_MENU // when defined will show the debug menu or else it will be hidden
16 using System;
17 using System.Collections.Generic;
18 using System.ComponentModel;
19 using System.Data;
20 using System.Drawing;
21 using System.Linq;
22 using System.Text;
23 using System.Windows.Forms;
24 using RomCheater.Logging;
25 using RomCheater.Properties;
26 using RomCheater.UserSettingsSupport;
27 using RomCheater.PluginFramework.Core;
28 using System.Diagnostics;
29 using RomCheater.PluginFramework.Interfaces;
30 using WeifenLuo.WinFormsUI.Docking;
31 using RomCheater.Docking;
32 using System.IO;
33 using Sojaner.MemoryScanner;
34 using RomCheater.PluginFramework.Events;
35 using RomCheater.Serialization;
36
37 namespace RomCheater
38 {
39 public partial class Main : Form
40 {
41 private bool m_bSaveLayout = true;
42 private Process SelectedProcess = null;
43 private DeserializeDockContent m_deserializeDockContent;
44 private FloatingLogWindow m_LogWindow = new FloatingLogWindow();
45 private FloatingAboutBox m_AboutBox = new FloatingAboutBox();
46 private FloatingRamDumperDialog m_RamDump = new FloatingRamDumperDialog();
47 private FloatingPIDSelector m_PIDSelector = new FloatingPIDSelector();
48 private FloatingMemoryView m_memoryview = new FloatingMemoryView();
49 private FloatingDataTypeConverter m_typeconverter = new FloatingDataTypeConverter();
50 private FloatingMemorySearcher m_memsearcher = new FloatingMemorySearcher();
51 private FloatingPEViewer m_peviewer = new FloatingPEViewer();
52 private FloatingRVACalculator m_rvacalc = new FloatingRVACalculator();
53
54 private FloatingMemorySectionViewer m_msv = new FloatingMemorySectionViewer();
55
56 private FloatingUserControlDock m_ucd = new FloatingUserControlDock();
57
58 //private bool log_window_expanded = false;
59 //private double log_window_splitter_default_position = 1.4045;
60 PluginLoader loader = null;
61 IConfigPlugin ConfigPlugin = null;
62 IInputPlugin InputPlugin = null;
63 IWindowPlugin WindowPlugin = null;
64 List<IUserControlPlugin> UserControlPlugins = null;
65 //static Main() { SettingSubscriber.AddSubscriber(new Main(), Settings.Default); }
66 //private const string t = "RomCheater";
67 #region LogWriterSupport
68 static LogWriter _LoggerInstance;
69 static LogWriter LoggerInstance
70 {
71 get { return _LoggerInstance; }
72 set { _LoggerInstance = value; }
73 }
74 #endregion
75
76
77 private void OnProcessChanged(ProcessChangedEventArgs e)
78 {
79 if (m_memsearcher.SearchInProgess)
80 {
81 DialogResult result = MessageBox.Show("Do you want to start a new search with the selected process?", "A memory search is currently in progress", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3);
82 if (result != DialogResult.Yes || result != DialogResult.OK) { return; }
83 m_memsearcher = null; //free memory used by the memory searcher
84 m_memsearcher = new FloatingMemorySearcher();
85 }
86 SelectedProcess = Process.GetProcessById(e.ProcessID);
87 m_RamDump.AcceptedPlugin = this.ConfigPlugin;
88 m_RamDump.AcceptedProcess = SelectedProcess;
89
90 m_peviewer.AcceptedPlugin = this.ConfigPlugin;
91 m_peviewer.AcceptedProcess = SelectedProcess;
92 m_peviewer.OnPEDataUpdated += new BaseEventHandler<PEViewerDataUpdatedEventArgs>(OnPEDataUpdated);
93
94 m_memoryview.AcceptedPlugin = this.ConfigPlugin;
95 m_memoryview.AcceptedProcess = SelectedProcess;
96
97 m_memsearcher.AcceptedPlugin = this.ConfigPlugin;
98 m_memsearcher.AcceptedProcess = SelectedProcess;
99 m_memsearcher.OnBrowseMemoryRegion += new BaseEventHandler<BrowseMemoryRegionEvent>(OnBrowseMemoryRegion);
100
101 m_msv.AcceptedPlugin = this.ConfigPlugin;
102 m_msv.AcceptedProcess = SelectedProcess;
103 m_msv.OnBrowseMemoryRegion += new BaseEventHandler<BrowseMemoryRegionEvent>(OnBrowseMemoryRegion);
104
105
106 }
107
108 void OnPEDataUpdated(PEViewerDataUpdatedEventArgs e)
109 {
110 m_memoryview.SetPEViewerData(e.peData);
111 m_memsearcher.SetPEViewerData(e.peData);
112 m_rvacalc.SetPEViewerData(e.peData);
113 m_RamDump.SetPEViewerData(e.peData);
114 m_msv.SetPEViewerData(e.peData);
115
116 }
117 private void OnBrowseMemoryRegion(BrowseMemoryRegionEvent e)
118 {
119 m_memoryview.BrowseMemoryRegion(e.MemoryRegion);
120 }
121
122 #region Dock Support
123 void AddDockToWindowList(object sender, EventArgs e)
124 {
125 DockContent dc;
126 TypeBinder.Bind(sender, out dc);
127 ToolStripMenuItem tsmi = new ToolStripMenuItem(dc.Text);
128 tsmi.Name = dc.Name;
129 tsmi.Tag = dc;
130 tsmi.Click += new EventHandler(tsmi_Click);
131 mnuWindows.DropDownItems.Add(tsmi);
132 }
133 void tsmi_Click(object sender, EventArgs e)
134 {
135 ToolStripMenuItem tsmi;
136 TypeBinder.Bind(sender, out tsmi);
137 DockContent dc;
138 TypeBinder.Bind(tsmi.Tag, out dc);
139 dc.Activate();
140 }
141 void RemoveDockFromWindowList(object sender, FormClosedEventArgs e)
142 {
143 DockContent dc;
144 TypeBinder.Bind(sender, out dc);
145 mnuWindows.DropDownItems.RemoveByKey(dc.Name);
146 }
147 private IDockContent GetContentFromPersistString(string persistString)
148 {
149 if (persistString == typeof(FloatingLogWindow).ToString()) { return m_LogWindow; }
150 if (persistString == typeof(FloatingRamDumperDialog).ToString()) { return m_RamDump; }
151 if (persistString == typeof(FloatingPIDSelector).ToString()) { return m_PIDSelector; }
152 if (persistString == typeof(FloatingMemoryView).ToString()) { return m_memoryview; }
153 if (persistString == typeof(FloatingDataTypeConverter).ToString()) { return m_typeconverter; }
154 if (persistString == typeof(FloatingMemorySearcher).ToString()) { return m_memsearcher; }
155 if (persistString == typeof(FloatingPEViewer).ToString()) { return m_peviewer; }
156 if (persistString == typeof(FloatingRVACalculator).ToString()) { return m_rvacalc; }
157 if (persistString == typeof(FloatingMemorySectionViewer).ToString()) { return m_msv; }
158 if (persistString == typeof(FloatingUserControlDock).ToString()) { return m_ucd; }
159 else { return null; }
160 }
161 public void SetupDocks()
162 {
163 m_LogWindow = new FloatingLogWindow();
164 m_AboutBox = new FloatingAboutBox();
165 m_RamDump = new FloatingRamDumperDialog();
166 m_PIDSelector = new FloatingPIDSelector();
167 m_PIDSelector.OnSelectedProcessChanged += new BaseEventHandler<ProcessChangedEventArgs>(OnProcessChanged);
168 m_memoryview = new FloatingMemoryView();
169 m_typeconverter = new FloatingDataTypeConverter();
170 m_memsearcher = new FloatingMemorySearcher();
171 m_memsearcher.OnBrowseMemoryRegion += new BaseEventHandler<BrowseMemoryRegionEvent>(OnBrowseMemoryRegion);
172 m_peviewer = new FloatingPEViewer();
173 m_peviewer.OnPEDataUpdated += new BaseEventHandler<PEViewerDataUpdatedEventArgs>(OnPEDataUpdated);
174 m_rvacalc = new FloatingRVACalculator();
175 m_ucd = new FloatingUserControlDock();
176 m_msv = new FloatingMemorySectionViewer();
177 m_deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString);
178 }
179 #region SetupDockWindowHandler support
180 public void SetupDockWindowHandler()
181 {
182 SetupLogWindowHandler();
183 SetupRamDumpWindowHandler();
184 SetupMemoryViewWindowHandler();
185 SetupPIDSelectorWindowHandler();
186 SetupDataTypeConverterWindowHandler();
187 SetupMemorySearchWindowHandler();
188 SetupPEViewerWindowHandler();
189 SetupRVACalculatorWindowHandler();
190 SetupMemorySectionViewerWindowHandler();
191 SetupUserControlDockWindowHandler();
192 }
193 private void SetupLogWindowHandler()
194 {
195 if (m_LogWindow == null) return;
196 m_LogWindow.Shown += new EventHandler(AddDockToWindowList);
197 m_LogWindow.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
198 m_LogWindow.Activate();
199 }
200 private void SetupRamDumpWindowHandler()
201 {
202 if (m_RamDump == null) return;
203 m_RamDump.Shown += new EventHandler(AddDockToWindowList);
204 m_RamDump.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
205 m_RamDump.AcceptedPlugin = ConfigPlugin;
206 m_RamDump.Activate();
207 }
208 private void SetupMemoryViewWindowHandler()
209 {
210 if (m_memoryview == null) return;
211 m_memoryview.Shown += new EventHandler(AddDockToWindowList);
212 m_memoryview.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
213 m_memoryview.AcceptedPlugin = ConfigPlugin;
214 m_memoryview.Activate();
215 }
216 private void SetupPIDSelectorWindowHandler()
217 {
218 if (m_PIDSelector == null) return;
219 m_PIDSelector.Shown += new EventHandler(AddDockToWindowList);
220 m_PIDSelector.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
221 m_PIDSelector.AcceptedPlugin = ConfigPlugin;
222 m_PIDSelector.Activate();
223 }
224 private void SetupDataTypeConverterWindowHandler()
225 {
226 if (m_typeconverter == null) return;
227 m_typeconverter.Shown += new EventHandler(AddDockToWindowList);
228 m_typeconverter.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
229 m_typeconverter.Activate();
230 }
231 private void SetupMemorySearchWindowHandler()
232 {
233 if (m_memsearcher == null) return;
234 m_memsearcher.Shown += new EventHandler(AddDockToWindowList);
235 m_memsearcher.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
236 m_memsearcher.Activate();
237 }
238 private void SetupPEViewerWindowHandler()
239 {
240 if (m_peviewer == null) return;
241 m_peviewer.Shown += new EventHandler(AddDockToWindowList);
242 m_peviewer.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
243 m_PIDSelector.AcceptedPlugin = ConfigPlugin;
244 m_peviewer.Activate();
245 }
246 private void SetupRVACalculatorWindowHandler()
247 {
248 if (m_rvacalc == null) return;
249 m_rvacalc.Shown += new EventHandler(AddDockToWindowList);
250 m_rvacalc.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
251 m_rvacalc.AcceptedPlugin = ConfigPlugin;
252 m_rvacalc.Activate();
253 }
254 private void SetupUserControlDockWindowHandler()
255 {
256 if (m_ucd == null) return;
257 m_ucd.Shown += new EventHandler(AddDockToWindowList);
258 m_ucd.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
259 m_ucd.Activate();
260 }
261 private void SetupMemorySectionViewerWindowHandler()
262 {
263 if (m_msv == null) return;
264 m_msv.Shown += new EventHandler(AddDockToWindowList);
265 m_msv.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
266 m_msv.AcceptedPlugin = ConfigPlugin;
267 m_msv.Activate();
268 }
269 #endregion
270 public void ShowDocks()
271 {
272 ShowLogWindow();
273 SetupLogWindowHandler();
274 //ShowAboutBox();
275 ShowRamDump();
276 SetupRamDumpWindowHandler();
277 ShowMemoryView();
278 SetupMemoryViewWindowHandler();
279 ShowPidSelector();
280 SetupPIDSelectorWindowHandler();
281 ShowDataTypeConverter();
282 SetupDataTypeConverterWindowHandler();
283
284 ShowRVACalculator();
285 SetupRVACalculatorWindowHandler();
286
287 ShowMemorySectionViewer();
288 SetupMemorySectionViewerWindowHandler();
289
290
291
292 ShowUserControlDock();
293 SetupUserControlDockWindowHandler();
294
295 ShowMemorySearch();
296 SetupMemorySearchWindowHandler();
297 ShowPEViewer();
298 SetupPEViewerWindowHandler();
299
300
301 }
302 public void ShowLogWindow()
303 {
304 if (m_LogWindow == null || m_LogWindow.IsDisposed) { m_LogWindow = new FloatingLogWindow(); }
305 LoggerInstance = m_LogWindow.Logwriter;
306 LoggerInstance.CreateNewLog(false);
307 m_LogWindow.Show(dockPanel, DockState.DockBottom);
308 }
309 public void ShowAboutBox()
310 {
311 if (m_AboutBox == null || m_AboutBox.IsDisposed) { m_AboutBox = new FloatingAboutBox(); }
312 m_AboutBox.ShowDialog();
313 }
314 public void ShowRamDump()
315 {
316 //load_plugins_silent();
317 m_RamDump = new FloatingRamDumperDialog(ConfigPlugin);
318 m_RamDump.AcceptedProcess = SelectedProcess;
319 m_RamDump.Show(dockPanel);
320 }
321 public void ShowMemoryView()
322 {
323 //load_plugins_silent();
324 m_memoryview = new FloatingMemoryView(ConfigPlugin);
325 m_memoryview.AcceptedProcess = SelectedProcess;
326 m_memoryview.Show(dockPanel);
327 }
328 public void ShowPidSelector()
329 {
330 //load_plugins_silent();
331 //List<Process> procs = ConfigPlugin.ValidProcessesForPlugin;
332 m_PIDSelector = new FloatingPIDSelector(ConfigPlugin);
333 m_PIDSelector.OnSelectedProcessChanged += new BaseEventHandler<ProcessChangedEventArgs>(OnProcessChanged);
334 m_PIDSelector.Show(dockPanel);
335 }
336 public void ShowDataTypeConverter()
337 {
338 if (m_typeconverter == null || m_typeconverter.IsDisposed) { m_typeconverter = new FloatingDataTypeConverter(); }
339 m_typeconverter.Show(dockPanel, DockState.DockRightAutoHide);
340 }
341 public void ShowMemorySearch()
342 {
343 //load_plugins_silent();
344 m_memsearcher = new FloatingMemorySearcher(ConfigPlugin);
345 m_memsearcher.AcceptedProcess = SelectedProcess;
346 m_memsearcher.OnBrowseMemoryRegion += new BaseEventHandler<BrowseMemoryRegionEvent>(OnBrowseMemoryRegion);
347 m_memsearcher.Show(dockPanel);
348 }
349 public void ShowPEViewer()
350 {
351 //load_plugins_silent();
352 m_peviewer = new FloatingPEViewer(ConfigPlugin);
353 m_peviewer.AcceptedProcess = SelectedProcess;
354 m_peviewer.OnPEDataUpdated += new BaseEventHandler<PEViewerDataUpdatedEventArgs>(OnPEDataUpdated);
355 m_peviewer.Show(dockPanel);
356 }
357 public void ShowRVACalculator()
358 {
359 //load_plugins_silent();
360 m_rvacalc = new FloatingRVACalculator(ConfigPlugin);
361 m_rvacalc.AcceptedProcess = SelectedProcess;
362 m_rvacalc.Show(dockPanel, DockState.DockRightAutoHide);
363 }
364 public void ShowMemorySectionViewer()
365 {
366 //load_plugins_silent();
367 m_msv = new FloatingMemorySectionViewer(ConfigPlugin);
368 m_msv.AcceptedProcess = SelectedProcess;
369 m_msv.Show(dockPanel);
370 }
371 public void ShowUserControlDock()
372 {
373 //load_plugins_silent();
374 if (m_ucd == null)
375 {
376 m_ucd = new FloatingUserControlDock();
377 }
378 if (this.UserControlPlugins.Count > 0)
379 {
380 m_ucd.UserPlugins = this.UserControlPlugins;
381 }
382 m_ucd.Show(dockPanel, DockState.DockRightAutoHide);
383 }
384 #endregion
385
386
387 public Main() : this(false) { }
388 public Main(bool no_console_redirect)
389 {
390 InitializeComponent();
391 #if SHOW_DEBUG_MENU
392 mnuDebug.Visible = true;
393 #else
394 mnuDebug.Visible = false;
395 #endif
396 load_loggerflags();
397 SetupDocks();
398 LoggerInstance = m_LogWindow.Logwriter;
399 LoggerInstance.CreateNewLog(false);
400 logger.ForceLog.Info.WriteLine("LoggingFlags = 0x{0:x4} ({1})", logger.GetLoggingFlags().Value, logger.GetLoggingFlags().Name);
401 load_plugins();
402 if (no_console_redirect)
403 LoggerInstance.RedirectConsoleOutput = false;
404
405
406
407 }
408 private void load_loggerflags()
409 {
410 logger.SetLoggingFlags(Logging.Properties.Settings.Default.LoggingFlags);
411 #if FORCE_ALL_LOGGING_FLAGS
412 logger.SetLoggingFlags(loggerflags.ALL);
413 #endif
414 }
415 private void load_plugins() { load_plugins(false); }
416 private void load_plugins_silent() { load_plugins(true); }
417 private void load_plugins(bool silent)
418 {
419 loader = new PluginLoader();
420 loader.LoadPlugins(silent);
421
422 ConfigPlugin = loader.GetConfigPlugin(RomCheater.Properties.Settings.Default.LastConfigPlugin);
423 if (ConfigPlugin != null && !silent)
424 logger.Info.WriteLine("Loaded Config Plugin: {0}", ConfigPlugin.ToString());
425 InputPlugin = loader.GetInputPlugin(RomCheater.Properties.Settings.Default.LastInputPlugin);
426 if (InputPlugin != null && !silent)
427 logger.Info.WriteLine("Loaded Input Plugin: {0}", InputPlugin.ToString());
428 WindowPlugin = loader.GetWindowPlugin(RomCheater.Properties.Settings.Default.LastWindowPlugin);
429 if (WindowPlugin != null && !silent)
430 logger.Info.WriteLine("Loaded Window Plugin: {0}", WindowPlugin.ToString());
431
432
433 UserControlPlugins = new List<IUserControlPlugin>(loader.LoadedUserControlPlugins);
434 if (UserControlPlugins != null)
435 {
436 foreach (var t in UserControlPlugins)
437 {
438 if (!silent)
439 logger.Info.WriteLine("Loaded UserControl Plugin: {0}", t.ToString());
440 }
441
442 string stacktrace = System.Environment.StackTrace;
443
444 if (UserControlPlugins.Count > 0)
445 {
446 m_ucd.UserPlugins = UserControlPlugins;
447 }
448 }
449
450
451
452 m_PIDSelector.AcceptedPlugin = ConfigPlugin;
453 m_RamDump.AcceptedPlugin = ConfigPlugin;
454 m_memoryview.AcceptedPlugin = ConfigPlugin;
455 m_memsearcher.AcceptedPlugin = ConfigPlugin;
456 m_PIDSelector.AcceptedPlugin = ConfigPlugin;
457 if (this.SelectedProcess != null)
458 {
459 m_RamDump.AcceptedProcess = SelectedProcess;
460 m_memoryview.AcceptedProcess = SelectedProcess;
461 m_memsearcher.AcceptedProcess = SelectedProcess;
462 }
463
464
465 }
466
467 private void mnuItemExit_Click(object sender, EventArgs e)
468 {
469 this.Close();
470 }
471
472
473 private void Main_Load(object sender, EventArgs e)
474 {
475 SettingSubscriber.AddSubscriber(this, Settings.Default);
476 }
477
478 private void mnuItemConfig_Click(object sender, EventArgs e)
479 {
480 RomCheaterConfigDialog dlg = new RomCheaterConfigDialog(loader);
481 dlg.ShowDialog();
482 logger.ForceLog.Info.WriteLine("LoggingFlags = 0x{0:x4} ({1})", logger.GetLoggingFlags().Value, logger.GetLoggingFlags().Name);
483 // reload plugins
484 load_plugins(true);
485 }
486
487 private void mnuItemOpenProcess_Click(object sender, EventArgs e)
488 {
489 ////List<Process> procs = ConfigPlugin.ValidProcessesForPlugin;
490 //PIDSelector selector = new PIDSelector(ConfigPlugin);
491 //selector.ShowDialog();
492 }
493
494 private void Main_Shown(object sender, EventArgs e)
495 {
496 //dockPanel.SuspendLayout(true);
497 //ShowDocks();
498 string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config");
499 if (File.Exists(configFile))
500 {
501 try
502 {
503 dockPanel.LoadFromXml(configFile, m_deserializeDockContent);
504 SetupDockWindowHandler();
505 }
506 catch (Exception)
507 {
508 this.Controls.Remove(dockPanel);
509 dockPanel = new DockPanel();
510 dockPanel.Dock = DockStyle.Fill;
511 dockPanel.DocumentStyle = DocumentStyle.DockingWindow;
512 this.Controls.Add(dockPanel);
513 ShowDocks();
514 }
515 }
516 else
517 {
518 ShowDocks();
519 }
520
521 //dockPanel.ResumeLayout(true, true);
522 }
523
524 private void mnuItemShowLogWindow_Click(object sender, EventArgs e)
525 {
526 ShowLogWindow();
527 }
528
529 private void mnuItemHelpAbout_Click(object sender, EventArgs e)
530 {
531 ShowAboutBox();
532 }
533
534 private void mnuItemShowRamDumpDialog_Click(object sender, EventArgs e)
535 {
536 ShowRamDump();
537 }
538
539 private void mnuItemShowPIDSelector_Click(object sender, EventArgs e)
540 {
541 ShowPidSelector();
542 }
543 private void mnuItemShowMemoryView_Click(object sender, EventArgs e)
544 {
545 ShowMemoryView();
546 }
547 private void Main_FormClosing(object sender, FormClosingEventArgs e)
548 {
549 string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config");
550 if (m_bSaveLayout)
551 dockPanel.SaveAsXml(configFile);
552 else if (File.Exists(configFile))
553 File.Delete(configFile);
554
555 SearchResultWriter.CleanupTemporarySearchResultFiles();
556
557
558 // notify any docked windows of formclosing
559
560 foreach (var t in this.dockPanel.Contents)
561 {
562 t.OnDeactivate<FormClosingEventArgs>(e);
563 }
564
565 }
566
567 private void mnuTestExeParse_Click(object sender, EventArgs e)
568 {
569 IPEDData peData = new PEData((IAcceptsProcessAndConfig)this);
570 }
571
572 private void mnuItemFindMaxNonNegativeHexValue_Click(object sender, EventArgs e)
573 {
574
575 //uint start = 0xf0000000;
576 uint end = uint.MaxValue;
577 //for (uint i = start; i < end; i++)
578 //{
579 ulong value = Convert.ToUInt64(end.ToString(), 16);
580 //}
581 }
582
583 private void mnuItemShowDataTypeConverter_Click(object sender, EventArgs e)
584 {
585 ShowDataTypeConverter();
586 }
587
588 private void mnuItemShowMemorySearch_Click(object sender, EventArgs e)
589 {
590 ShowMemorySearch();
591 }
592
593 private void mnuItemDateShift_Click(object sender, EventArgs e)
594 {
595 DateTime t = DateTime.Now;
596 int year = Convert.ToInt32(t.ToString("yy"));
597 int y = year << 9;
598 int m = t.Month << 5;
599 int d = t.Day;
600
601 ushort v1 = (ushort)(y | m | d);
602
603 t = t.AddDays(1);
604 year = Convert.ToInt32(t.ToString("yy"));
605 y = year << 9;
606 m = t.Month << 5;
607 d = t.Day;
608 ushort v2 = (ushort)(y | m | d);
609
610 t = t.AddDays(1);
611 year = Convert.ToInt32(t.ToString("yy"));
612 y = year << 9;
613 m = t.Month << 5;
614 d = t.Day;
615 ushort v3 = (ushort)(y | m | d);
616
617 t = new DateTime(9999,12,31);
618 year = Convert.ToInt32(t.ToString("yy"));
619 y = year << 9;
620 m = t.Month << 5;
621 d = t.Day;
622 ushort v4 = (ushort)(y | m | d);
623 }
624
625 private void mnuItemShowPEViewer_Click(object sender, EventArgs e)
626 {
627 ShowPEViewer();
628 }
629
630 private void mnuItemShowRVACalculator_Click(object sender, EventArgs e)
631 {
632 ShowRVACalculator();
633 }
634
635 private void mnuItemShowUserControlDock_Click(object sender, EventArgs e)
636 {
637 ShowUserControlDock();
638 }
639
640 private void mnuItemShowMemorySectionViewer_Click(object sender, EventArgs e)
641 {
642 ShowMemorySectionViewer();
643 }
644 }
645 }

  ViewVC Help
Powered by ViewVC 1.1.22