/[RomCheater]/trunk/RomCheater/Docking/FloatingRVACalculator.cs
ViewVC logotype

Diff of /trunk/RomCheater/Docking/FloatingRVACalculator.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 366 by william, Sun Jun 10 03:14:42 2012 UTC revision 367 by william, Sun Jun 10 03:39:00 2012 UTC
# Line 9  using System.Windows.Forms; Line 9  using System.Windows.Forms;
9  using WeifenLuo.WinFormsUI.Docking;  using WeifenLuo.WinFormsUI.Docking;
10  using RomCheater.PluginFramework.Interfaces;  using RomCheater.PluginFramework.Interfaces;
11  using System.Diagnostics;  using System.Diagnostics;
12    using RomCheater.PluginFramework.Events;
13    using Sojaner.MemoryScanner;
14    
15  namespace RomCheater.Docking  namespace RomCheater.Docking
16  {  {
17      public partial class FloatingRVACalculator : DockContent,      public partial class FloatingRVACalculator : DockContent,
18          IAcceptsPlugin<IConfigPlugin>,          IAcceptsPlugin<IConfigPlugin>,
19          IAcceptsProcess<Process>,          IAcceptsProcess<Process>,
20          IAcceptsProcessAndConfig          IAcceptsProcessAndConfig,
21            IAcceptPEData
22      {      {
23          public FloatingRVACalculator() { InitializeComponent(); this.AcceptedPlugin = null; this.AcceptedProcess = null; }          public FloatingRVACalculator() { InitializeComponent(); this.AcceptedPlugin = null; this.AcceptedProcess = null; }
24          public FloatingRVACalculator(IConfigPlugin config) : this() { this.AcceptedPlugin = config; }          public FloatingRVACalculator(IConfigPlugin config) : this() { this.AcceptedPlugin = config; }
# Line 26  namespace RomCheater.Docking Line 29  namespace RomCheater.Docking
29          #region IAcceptsPlugin<IConfigPlugin> Members          #region IAcceptsPlugin<IConfigPlugin> Members
30          public IConfigPlugin AcceptedPlugin { get; set; }          public IConfigPlugin AcceptedPlugin { get; set; }
31          #endregion          #endregion
32            #region IAcceptPEData members
33            private IPEDData peData { get; set; }
34            public void SetPEViewerData(IPEDData peData)
35            { this.peData = peData;
36    
37                if(peData.Is32bitAssembly())
38                {
39                    txtImageBase.Value = (int)peData.NTHeader.OptionalHeader32._ImageBase;
40                }
41                else
42                {
43                    txtImageBase.Value = (long)peData.NTHeader.OptionalHeader64._ImageBase;
44                }
45                
46            }
47            #endregion
48    
49            private void btnConvertMemoryToFile_Click(object sender, EventArgs e)
50            {
51                if (txtMemToFile_ImageAddress.Value < txtImageBase.Value)
52                {
53                    MessageBox.Show("Image Address cannot be less than Image Base!", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
54                    return;
55                }
56    
57                txtMemToFile_FileAddress.Value = (txtMemToFile_ImageAddress.Value - txtImageBase.Value);
58    
59            }
60    
61            private void btnConvertFileToMemory_Click(object sender, EventArgs e)
62            {
63                if (txtFileToMem_FileAddress.Value < txtFileBase.Value)
64                {
65                    MessageBox.Show("File Address cannot be less than File Base!", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
66                    return;
67                }
68                txtFileToMem_ImageAddress.Value = (txtFileToMem_FileAddress.Value + txtImageBase.Value);
69            }
70      }      }
71  }  }

Legend:
Removed from v.366  
changed lines
  Added in v.367

  ViewVC Help
Powered by ViewVC 1.1.22