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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 477 - (hide annotations) (download)
Mon Jun 3 18:35:45 2013 UTC (8 years ago) by william
File size: 2728 byte(s)
revert r471: pass process informatin by using the process's PID, instead of passing the process as a reference

+ pass the process instead
1 william 366 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.Windows.Forms;
9     using WeifenLuo.WinFormsUI.Docking;
10     using RomCheater.PluginFramework.Interfaces;
11     using System.Diagnostics;
12 william 367 using RomCheater.PluginFramework.Events;
13     using Sojaner.MemoryScanner;
14 william 366
15     namespace RomCheater.Docking
16     {
17     public partial class FloatingRVACalculator : DockContent,
18     IAcceptsPlugin<IConfigPlugin>,
19 william 477 IAcceptsProcess<Process>,
20 william 367 IAcceptsProcessAndConfig,
21     IAcceptPEData
22 william 366 {
23 william 477 public FloatingRVACalculator() { InitializeComponent(); this.AcceptedPlugin = null; this.AcceptedProcess = null; }
24 william 366 public FloatingRVACalculator(IConfigPlugin config) : this() { this.AcceptedPlugin = config; }
25 william 477 public FloatingRVACalculator(IConfigPlugin config, Process process) : this() { this.AcceptedPlugin = config; this.AcceptedProcess = process; }
26 william 366 #region IAcceptsProcess<Process> Members
27 william 477 public Process AcceptedProcess { get; set; }
28 william 366 #endregion
29     #region IAcceptsPlugin<IConfigPlugin> Members
30     public IConfigPlugin AcceptedPlugin { get; set; }
31     #endregion
32 william 367 #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 william 366 }
71     }

  ViewVC Help
Powered by ViewVC 1.1.22