20 |
namespace RomCheater.Docking |
namespace RomCheater.Docking |
21 |
{ |
{ |
22 |
public partial class FloatingMemorySearcher : DockContent, |
public partial class FloatingMemorySearcher : DockContent, |
23 |
IAcceptsProcess<Process>, |
IAcceptsPlugin<IConfigPlugin>, |
24 |
IAcceptsPlugin<IConfigPlugin>, |
IAcceptsProcess<Process>, |
25 |
|
IAcceptsProcessAndConfig, |
26 |
ISearchInProgress |
ISearchInProgress |
27 |
{ |
{ |
28 |
private bool DefaultUnsignedState = true; // set unsigned to true |
private bool DefaultUnsignedState = true; // set unsigned to true |
31 |
public FloatingMemorySearcher(IConfigPlugin config, Process process) : this() { this.AcceptedPlugin = config; this.AcceptedProcess = process; } |
public FloatingMemorySearcher(IConfigPlugin config, Process process) : this() { this.AcceptedPlugin = config; this.AcceptedProcess = process; } |
32 |
|
|
33 |
#region IAcceptsProcess<Process> Members |
#region IAcceptsProcess<Process> Members |
34 |
public Process AcceptedProcess { get; set; } |
private Process _AcceptedProcess; |
35 |
|
public Process AcceptedProcess { get { return _AcceptedProcess; } set { _AcceptedProcess = value; UpdateAcceptedProcessAndConfig(AcceptedPlugin, value); } } |
36 |
#endregion |
#endregion |
37 |
#region IAcceptsPlugin<IConfigPlugin> Members |
#region IAcceptsPlugin<IConfigPlugin> Members |
38 |
public IConfigPlugin AcceptedPlugin { get; set; } |
private IConfigPlugin _AcceptedPlugin; |
39 |
|
public IConfigPlugin AcceptedPlugin { get { return _AcceptedPlugin; } set { _AcceptedPlugin = value; UpdateAcceptedProcessAndConfig(value, AcceptedProcess); } } |
40 |
#endregion |
#endregion |
41 |
|
private void UpdateAcceptedProcessAndConfig(IConfigPlugin config, Process process) |
42 |
|
{ |
43 |
|
this.lstResults.AcceptedPlugin = config; |
44 |
|
this.lstResults.AcceptedProcess = process; |
45 |
|
this.lstPatchList.AcceptedPlugin = config; |
46 |
|
this.lstPatchList.AcceptedProcess = process; |
47 |
|
} |
48 |
#region ISearchInProgress members |
#region ISearchInProgress members |
49 |
public bool SearchInProgess { get; private set; } |
public bool SearchInProgess { get; private set; } |
50 |
#endregion |
#endregion |
725 |
if (_result.IsUnsigned) |
if (_result.IsUnsigned) |
726 |
{ |
{ |
727 |
byte value = Convert.ToByte(item.SubItems[col_Found_Value].Text, 16); |
byte value = Convert.ToByte(item.SubItems[col_Found_Value].Text, 16); |
728 |
patcher = new SearchPatcher(this.AcceptedProcess.Id, Address, value); |
patcher = new SearchPatcher((IAcceptsProcessAndConfig)this, Address, value); |
729 |
timer_update_results.Enabled = false; |
timer_update_results.Enabled = false; |
730 |
patcher.ShowDialog(); |
patcher.ShowDialog(); |
731 |
timer_update_results.Enabled = true; |
timer_update_results.Enabled = true; |
736 |
else |
else |
737 |
{ |
{ |
738 |
sbyte value = Convert.ToSByte(item.SubItems[col_Found_Value].Text, 16); |
sbyte value = Convert.ToSByte(item.SubItems[col_Found_Value].Text, 16); |
739 |
patcher = new SearchPatcher(this.AcceptedProcess.Id, Address, value); |
patcher = new SearchPatcher((IAcceptsProcessAndConfig)this, Address, value); |
740 |
timer_update_results.Enabled = false; |
timer_update_results.Enabled = false; |
741 |
patcher.ShowDialog(); |
patcher.ShowDialog(); |
742 |
timer_update_results.Enabled = true; |
timer_update_results.Enabled = true; |
749 |
if (_result.IsUnsigned) |
if (_result.IsUnsigned) |
750 |
{ |
{ |
751 |
ushort value = Convert.ToUInt16(item.SubItems[col_Found_Value].Text, 16); |
ushort value = Convert.ToUInt16(item.SubItems[col_Found_Value].Text, 16); |
752 |
patcher = new SearchPatcher(this.AcceptedProcess.Id, Address, value); |
patcher = new SearchPatcher((IAcceptsProcessAndConfig)this, Address, value); |
753 |
timer_update_results.Enabled = false; |
timer_update_results.Enabled = false; |
754 |
patcher.ShowDialog(); |
patcher.ShowDialog(); |
755 |
timer_update_results.Enabled = true; |
timer_update_results.Enabled = true; |
760 |
else |
else |
761 |
{ |
{ |
762 |
short value = Convert.ToInt16(item.SubItems[col_Found_Value].Text, 16); |
short value = Convert.ToInt16(item.SubItems[col_Found_Value].Text, 16); |
763 |
patcher = new SearchPatcher(this.AcceptedProcess.Id, Address, value); |
patcher = new SearchPatcher((IAcceptsProcessAndConfig)this, Address, value); |
764 |
timer_update_results.Enabled = false; |
timer_update_results.Enabled = false; |
765 |
patcher.ShowDialog(); |
patcher.ShowDialog(); |
766 |
timer_update_results.Enabled = true; |
timer_update_results.Enabled = true; |
773 |
if (_result.IsUnsigned) |
if (_result.IsUnsigned) |
774 |
{ |
{ |
775 |
uint value = Convert.ToUInt32(item.SubItems[col_Found_Value].Text, 16); |
uint value = Convert.ToUInt32(item.SubItems[col_Found_Value].Text, 16); |
776 |
patcher = new SearchPatcher(this.AcceptedProcess.Id, Address, value); |
patcher = new SearchPatcher((IAcceptsProcessAndConfig)this, Address, value); |
777 |
timer_update_results.Enabled = false; |
timer_update_results.Enabled = false; |
778 |
patcher.ShowDialog(); |
patcher.ShowDialog(); |
779 |
timer_update_results.Enabled = true; |
timer_update_results.Enabled = true; |
784 |
else |
else |
785 |
{ |
{ |
786 |
int value = Convert.ToInt32(item.SubItems[col_Found_Value].Text, 16); |
int value = Convert.ToInt32(item.SubItems[col_Found_Value].Text, 16); |
787 |
patcher = new SearchPatcher(this.AcceptedProcess.Id, Address, value); |
patcher = new SearchPatcher((IAcceptsProcessAndConfig)this, Address, value); |
788 |
timer_update_results.Enabled = false; |
timer_update_results.Enabled = false; |
789 |
patcher.ShowDialog(); |
patcher.ShowDialog(); |
790 |
timer_update_results.Enabled = true; |
timer_update_results.Enabled = true; |
797 |
if (_result.IsUnsigned) |
if (_result.IsUnsigned) |
798 |
{ |
{ |
799 |
ulong value = Convert.ToUInt32(item.SubItems[col_Found_Value].Text, 16); |
ulong value = Convert.ToUInt32(item.SubItems[col_Found_Value].Text, 16); |
800 |
patcher = new SearchPatcher(this.AcceptedProcess.Id, Address, value); |
patcher = new SearchPatcher((IAcceptsProcessAndConfig)this, Address, value); |
801 |
timer_update_results.Enabled = false; |
timer_update_results.Enabled = false; |
802 |
patcher.ShowDialog(); |
patcher.ShowDialog(); |
803 |
timer_update_results.Enabled = true; |
timer_update_results.Enabled = true; |
808 |
else |
else |
809 |
{ |
{ |
810 |
long value = Convert.ToInt32(item.SubItems[col_Found_Value].Text, 16); |
long value = Convert.ToInt32(item.SubItems[col_Found_Value].Text, 16); |
811 |
patcher = new SearchPatcher(this.AcceptedProcess.Id, Address, value); |
patcher = new SearchPatcher((IAcceptsProcessAndConfig)this, Address, value); |
812 |
timer_update_results.Enabled = false; |
timer_update_results.Enabled = false; |
813 |
patcher.ShowDialog(); |
patcher.ShowDialog(); |
814 |
timer_update_results.Enabled = true; |
timer_update_results.Enabled = true; |
830 |
|
|
831 |
if (patch_list.Count > 0) |
if (patch_list.Count > 0) |
832 |
{ |
{ |
833 |
SearchRangePatcher rangePatcher = new SearchRangePatcher(this.AcceptedProcess.Id, patch_list); |
SearchRangePatcher rangePatcher = new SearchRangePatcher((IAcceptsProcessAndConfig)this, patch_list); |
834 |
rangePatcher.ShowDialog(); |
rangePatcher.ShowDialog(); |
835 |
} |
} |
836 |
|
|