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

Annotation of /trunk/RomCheater/Main.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 439 - (hide annotations) (download)
Tue May 28 18:39:39 2013 UTC (8 years, 2 months ago) by william
File size: 23606 byte(s)

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

  ViewVC Help
Powered by ViewVC 1.1.22