diff --git a/tmp/.gitignore b/tmp/.gitignore deleted file mode 100644 index 94420dc..0000000 --- a/tmp/.gitignore +++ /dev/null @@ -1,236 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -bld/ -[Bb]in/ -[Oo]bj/ - -# Visual Studio 2015 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config -# NuGet v3's project.json files produces more ignoreable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Microsoft Azure ApplicationInsights config file -ApplicationInsights.config - -# Windows Store app package directory -AppPackages/ -BundleArtifacts/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe - -# FAKE - F# Make -.fake/ diff --git a/tmp/NTRDebuggerTool.sln b/tmp/NTRDebuggerTool.sln deleted file mode 100644 index a5010af..0000000 --- a/tmp/NTRDebuggerTool.sln +++ /dev/null @@ -1,23 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NTRDebuggerTool", "NTRDebuggerTool\NTRDebuggerTool.csproj", "{86AF1318-9584-4CDE-93BC-C2F0DCF958C5}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {86AF1318-9584-4CDE-93BC-C2F0DCF958C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {86AF1318-9584-4CDE-93BC-C2F0DCF958C5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {86AF1318-9584-4CDE-93BC-C2F0DCF958C5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {86AF1318-9584-4CDE-93BC-C2F0DCF958C5}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(Performance) = preSolution - HasPerformanceSessions = true - EndGlobalSection -EndGlobal diff --git a/tmp/NTRDebuggerTool/App.config b/tmp/NTRDebuggerTool/App.config deleted file mode 100644 index 5353446..0000000 --- a/tmp/NTRDebuggerTool/App.config +++ /dev/null @@ -1,26 +0,0 @@ - - - -
- - - - - - - - - - - - - - - - - - - - - - diff --git a/tmp/NTRDebuggerTool/Config.cs b/tmp/NTRDebuggerTool/Config.cs deleted file mode 100644 index a8b7ae9..0000000 --- a/tmp/NTRDebuggerTool/Config.cs +++ /dev/null @@ -1,301 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Windows.Forms; -using System.Xml; - -namespace NTRDebuggerTool -{ - public class Config - { - #region Config Settings - #region MaxValuesToDisplay - private const uint DefaultMaxValuesToDisplay = 1000; - private static Nullable maxValuesToDisplay = null; - public static uint MaxValuesToDisplay - { - get - { - if (maxValuesToDisplay == null) - { - string TempVal = GetValue("MaxValuesToDisplay"); - maxValuesToDisplay = string.IsNullOrWhiteSpace(TempVal) ? DefaultMaxValuesToDisplay : uint.Parse(TempVal); - } - return maxValuesToDisplay.Value; - } - set - { - maxValuesToDisplay = value; - SetValue("MaxValuesToDisplay", value.ToString()); - } - } - #endregion - - #region ButtonStateUpdateInterval - private const int DefaultButtonStateUpdateInterval = 250; - private static Nullable buttonStateUpdateInterval = null; - public static int ButtonStateUpdateInterval - { - get - { - if (buttonStateUpdateInterval == null) - { - string TempVal = GetValue("ButtonStateUpdateInterval"); - buttonStateUpdateInterval = string.IsNullOrWhiteSpace(TempVal) ? DefaultButtonStateUpdateInterval : int.Parse(TempVal); - } - return buttonStateUpdateInterval.Value; - } - set - { - buttonStateUpdateInterval = value; - SetValue("ButtonStateUpdateInterval", value.ToString()); - } - } - #endregion - - #region DefaultIP - private const string DefaultDefaultIP = ""; //Stupid name but oh well - private static string defaultIP = null; - public static string DefaultIP - { - get - { - if (defaultIP == null) - { - string TempVal = GetValue("DefaultIP"); - defaultIP = string.IsNullOrWhiteSpace(TempVal) ? DefaultDefaultIP : TempVal; - } - return defaultIP; - } - set - { - defaultIP = value; - SetValue("DefaultIP", value); - } - } - #endregion - - #region ConnectTimeout - private const int DefaultConnectTimeout = 3000; - private static Nullable connectTimeout = null; - public static int ConnectTimeout - { - get - { - if (connectTimeout == null) - { - string TempVal = GetValue("ConnectTimeout"); - connectTimeout = string.IsNullOrWhiteSpace(TempVal) ? DefaultConnectTimeout : int.Parse(TempVal); - } - return connectTimeout.Value; - } - set - { - connectTimeout = value; - SetValue("ConnectTimeout", value.ToString()); - } - } - #endregion - - #region ConnectTries - private const int DefaultConnectTries = 5; - private static Nullable connectTries = null; - public static int ConnectTries - { - get - { - if (connectTries == null) - { - string TempVal = GetValue("ConnectTries"); - connectTries = string.IsNullOrWhiteSpace(TempVal) ? DefaultConnectTries : int.Parse(TempVal); - } - return connectTries.Value; - } - set - { - connectTries = value; - SetValue("ConnectTries", value.ToString()); - } - } - #endregion - - #region LockValuesDelay - private const int DefaultLockValuesDelay = 5; - private static Nullable lockValuesDelay = null; - public static int LockValuesDelay - { - get - { - if (lockValuesDelay == null) - { - string TempVal = GetValue("LockValuesDelay"); - lockValuesDelay = string.IsNullOrWhiteSpace(TempVal) ? DefaultLockValuesDelay : int.Parse(TempVal); - } - return lockValuesDelay.Value; - } - set - { - lockValuesDelay = value; - SetValue("LockValuesDelay", value.ToString()); - } - } - #endregion - - #region DevkitProPath - private const string DefaultDevkitProPath = ""; - private static string devkitProPath = null; - public static string DevkitProPath - { - get - { - if (devkitProPath == null) - { - string TempVal = GetValue("DevkitProPath"); - devkitProPath = string.IsNullOrWhiteSpace(TempVal) ? DefaultDevkitProPath : TempVal; - } - return devkitProPath; - } - set - { - devkitProPath = value; - SetValue("DevkitProPath", value); - } - } - #endregion - #endregion - - #region Add to default set here - public static Dictionary All - { - get - { - Dictionary All = new Dictionary(); - foreach (XmlNode Node in RootXmlElement.ChildNodes) - { - All.Add(Node.Name, Node.InnerText); - } - if (!All.ContainsKey("MaxValuesToDisplay")) - { - All.Add("MaxValuesToDisplay", MaxValuesToDisplay.ToString()); - } - if (!All.ContainsKey("ButtonStateUpdateInterval")) - { - All.Add("ButtonStateUpdateInterval", ButtonStateUpdateInterval.ToString()); - } - if (!All.ContainsKey("DefaultIP")) - { - All.Add("DefaultIP", DefaultIP.ToString()); - } - if (!All.ContainsKey("ConnectTimeout")) - { - All.Add("ConnectTimeout", ConnectTimeout.ToString()); - } - if (!All.ContainsKey("ConnectTries")) - { - All.Add("ConnectTries", ConnectTries.ToString()); - } - if (!All.ContainsKey("LockValuesDelay")) - { - All.Add("LockValuesDelay", LockValuesDelay.ToString()); - } - if (!All.ContainsKey("DevkitProPath")) - { - All.Add("DevkitProPath", DevkitProPath.ToString()); - } - return All; - } - set - { - foreach (string Key in value.Keys) - { - SetValue(Key, value[Key]); - } - ConfigFile = null; - InitializeConfigFile(); - } - } - - private static void CreateConfigFile() - { - Directory.CreateDirectory(ConfigFileDirectory); - ConfigFile.LoadXml(""); - ConfigFile.Save(ConfigFilePath); - MaxValuesToDisplay = DefaultMaxValuesToDisplay; - ButtonStateUpdateInterval = DefaultButtonStateUpdateInterval; - DefaultIP = DefaultDefaultIP; - ConnectTimeout = DefaultConnectTimeout; - ConnectTries = DefaultConnectTries; - LockValuesDelay = DefaultLockValuesDelay; - DevkitProPath = DefaultDevkitProPath; - } - - #endregion - - #region XML Stuff - - public static string ConfigFileDirectory = Directory.GetParent(Application.UserAppDataPath).FullName; - private static string ConfigFilePath = ConfigFileDirectory + Path.DirectorySeparatorChar + "NTRDebuggerTool.config.xml"; - private static XmlDocument ConfigFile; - - private static void SetValue(string Key, string Value) - { - XmlElement XmlNode = (XmlElement)RootXmlElement.SelectSingleNode("//" + Key); - if (XmlNode == null) - { - XmlNode = ConfigFile.CreateElement(Key); - RootXmlElement.AppendChild(XmlNode); - } - XmlNode.InnerText = Value; - ConfigFile.Save(ConfigFilePath); - } - private static string GetValue(string Key) - { - XmlElement XmlNode = (XmlElement)RootXmlElement.SelectSingleNode("//" + Key); - if (XmlNode != null) { return XmlNode.InnerText; } - return ""; - } - - private static XmlElement RootXmlElement - { - get - { - if (ConfigFile == null || ConfigFile.FirstChild == null) - { - InitializeConfigFile(); - } - return (XmlElement)ConfigFile.FirstChild; - } - } - - private static void NodeChangedHandler(Object src, XmlNodeChangedEventArgs args) - { - if (ConfigFile != null) - { - ConfigFile.Save(ConfigFilePath); - } - } - - private static void InitializeConfigFile() - { - ConfigFile = new XmlDocument(); - try - { - ConfigFile.Load(ConfigFilePath); - } - catch (Exception) - { - CreateConfigFile(); - } - ConfigFile.NodeChanged += new XmlNodeChangedEventHandler(NodeChangedHandler); - ConfigFile.NodeInserted += new XmlNodeChangedEventHandler(NodeChangedHandler); - ConfigFile.NodeRemoved += new XmlNodeChangedEventHandler(NodeChangedHandler); - } - - static Config() - { - if (All != null) ; - } - - #endregion - } -} diff --git a/tmp/NTRDebuggerTool/ConsoleHelper.cs b/tmp/NTRDebuggerTool/ConsoleHelper.cs deleted file mode 100644 index c283f77..0000000 --- a/tmp/NTRDebuggerTool/ConsoleHelper.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace NTRDebuggerTool -{ - class ConsoleHelper - { - [DllImport("kernel32.dll", SetLastError = true)] - static extern bool AllocConsole(); - - [DllImport("kernel32.dll")] - static extern IntPtr GetConsoleWindow(); - - [DllImport("user32.dll")] - static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); - - const int SW_HIDE = 0; - const int SW_SHOW = 5; - - public static void EnableConsole() - { - IntPtr Handle = GetConsoleWindow(); - if (Handle == IntPtr.Zero) - { - AllocConsole(); - } - else - { - ShowWindow(Handle, SW_SHOW); - } - } - } -} diff --git a/tmp/NTRDebuggerTool/Debug.cs b/tmp/NTRDebuggerTool/Debug.cs deleted file mode 100644 index 2bb1a98..0000000 --- a/tmp/NTRDebuggerTool/Debug.cs +++ /dev/null @@ -1,99 +0,0 @@ -using NTRDebuggerTool.Forms.FormEnums; -using NTRDebuggerTool.Objects; -using NTRDebuggerTool.Remote; -using System; -using System.Collections.Generic; -using System.IO; -using System.Threading; - -namespace NTRDebuggerTool -{ - class Debug - { - internal static void Execute() - { - NTRRemoteConnection Conn = new NTRRemoteConnection(); - Console.WriteLine("Connecting..."); - Conn.IP = "192.168.1.29"; - Conn.Port = 8000; - while (!Conn.Connect()) ; - Thread t = new Thread(delegate() - { - while (true) - { - Conn.SendHeartbeatPacket(); - Thread.Sleep(100); - } - }); - - t.Start(); - Thread.Sleep(1000); - Console.WriteLine("Getting Processes..."); - Conn.SendListProcessesPacket(); - while (!Conn.IsProcessListUpdated) - { - Thread.Sleep(10); - } - Dictionary> Procs = new Dictionary>(); - foreach (string ProcFull in Conn.Processes) - { - string Proc = ProcFull.Split('|')[0]; - Console.WriteLine("Fetching memregions for process " + Proc); - Conn.SendReadMemoryAddressesPacket(Proc); - while (!Conn.IsMemoryListUpdated) - { - Thread.Sleep(10); - } - Procs.Add(Proc, Conn.AddressSpaces); - Conn.IsMemoryListUpdated = false; - } - - Directory.CreateDirectory("Temp"); - - for (int i = 0; i < 3; ++i) - { - Directory.CreateDirectory("Temp" + Path.DirectorySeparatorChar + i); - Console.WriteLine("Dumping memory set " + i + "..."); - - foreach (string Proc in Procs.Keys) - { - foreach (uint Start in Procs[Proc].Keys) - { - uint Size = Procs[Proc][Start]; - SearchCriteria Criteria = new SearchCriteria(); - Criteria.ProcessID = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Proc), 0); - Criteria.DataType = DataTypeExact.Bytes1; - Criteria.StartAddress = Start; - Criteria.Length = Size; - Criteria.SearchType = SearchTypeBase.Unknown; - Criteria.SearchValue = new byte[] { 0 }; - Criteria.Size = 1; - Conn.SearchCriteria.Add(Criteria); - byte[] Data = new byte[Size]; - Console.WriteLine("Dumping PID " + Proc + ", MR " + Start + "+" + Size + "..."); - Conn.SendReadMemoryPacket(Criteria); - while (!Criteria.SearchComplete) - { - Thread.Sleep(10); - } - foreach (uint Addr in Criteria.AddressesFound.Keys) - { - Data[Addr - Start] = Criteria.AddressesFound[Addr][0]; - } - File.WriteAllBytes("Temp" + Path.DirectorySeparatorChar + i + Path.DirectorySeparatorChar + Proc + "_" + Start + ".raw", Data); - } - } - - if (i == 1) - { - Console.WriteLine("Press any key..."); - Console.ReadKey(false); - Console.WriteLine(); - } - } - - t.Abort(); - Conn.Disconnect(); - } - } -} diff --git a/tmp/NTRDebuggerTool/Forms/ConfigDialog.Designer.cs b/tmp/NTRDebuggerTool/Forms/ConfigDialog.Designer.cs deleted file mode 100644 index 57832ed..0000000 --- a/tmp/NTRDebuggerTool/Forms/ConfigDialog.Designer.cs +++ /dev/null @@ -1,128 +0,0 @@ -namespace NTRDebuggerTool.Forms -{ - partial class ConfigDialog - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.ButtonCancel = new System.Windows.Forms.Button(); - this.ButtonSave = new System.Windows.Forms.Button(); - this.ConfigDataGrid = new System.Windows.Forms.DataGridView(); - this.Key = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Value = new System.Windows.Forms.DataGridViewTextBoxColumn(); - ((System.ComponentModel.ISupportInitialize)(this.ConfigDataGrid)).BeginInit(); - this.SuspendLayout(); - // - // ButtonCancel - // - this.ButtonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ButtonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.ButtonCancel.Location = new System.Drawing.Point(13, 227); - this.ButtonCancel.Name = "ButtonCancel"; - this.ButtonCancel.Size = new System.Drawing.Size(75, 23); - this.ButtonCancel.TabIndex = 0; - this.ButtonCancel.Text = "Cancel"; - this.ButtonCancel.UseVisualStyleBackColor = true; - this.ButtonCancel.Click += new System.EventHandler(this.ButtonCancel_Click); - // - // ButtonSave - // - this.ButtonSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ButtonSave.Location = new System.Drawing.Point(197, 227); - this.ButtonSave.Name = "ButtonSave"; - this.ButtonSave.Size = new System.Drawing.Size(75, 23); - this.ButtonSave.TabIndex = 1; - this.ButtonSave.Text = "Save"; - this.ButtonSave.UseVisualStyleBackColor = true; - this.ButtonSave.Click += new System.EventHandler(this.ButtonSave_Click); - // - // ConfigDataGrid - // - this.ConfigDataGrid.AllowUserToAddRows = false; - this.ConfigDataGrid.AllowUserToResizeRows = false; - this.ConfigDataGrid.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.ConfigDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.ConfigDataGrid.ColumnHeadersVisible = false; - this.ConfigDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.Key, - this.Value}); - this.ConfigDataGrid.Location = new System.Drawing.Point(13, 12); - this.ConfigDataGrid.Name = "ConfigDataGrid"; - this.ConfigDataGrid.RowHeadersVisible = false; - this.ConfigDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; - this.ConfigDataGrid.ShowCellErrors = false; - this.ConfigDataGrid.ShowCellToolTips = false; - this.ConfigDataGrid.ShowEditingIcon = false; - this.ConfigDataGrid.ShowRowErrors = false; - this.ConfigDataGrid.Size = new System.Drawing.Size(259, 209); - this.ConfigDataGrid.TabIndex = 2; - this.ConfigDataGrid.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.ConfigDataGrid_CellDoubleClick); - this.ConfigDataGrid.CellLeave += new System.Windows.Forms.DataGridViewCellEventHandler(this.ConfigDataGrid_CellLeave); - // - // Key - // - this.Key.HeaderText = "ColumnKey"; - this.Key.MinimumWidth = 20; - this.Key.Name = "Key"; - this.Key.ReadOnly = true; - // - // Value - // - this.Value.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.Value.HeaderText = "ColumnValue"; - this.Value.MinimumWidth = 20; - this.Value.Name = "Value"; - // - // ConfigDialog - // - this.AcceptButton = this.ButtonSave; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.ButtonCancel; - this.ClientSize = new System.Drawing.Size(284, 284); - this.ControlBox = false; - this.Controls.Add(this.ConfigDataGrid); - this.Controls.Add(this.ButtonSave); - this.Controls.Add(this.ButtonCancel); - this.MinimumSize = new System.Drawing.Size(300, 300); - this.Name = "ConfigDialog"; - this.ShowIcon = false; - this.Text = "Configuration"; - ((System.ComponentModel.ISupportInitialize)(this.ConfigDataGrid)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Button ButtonCancel; - private System.Windows.Forms.Button ButtonSave; - private System.Windows.Forms.DataGridView ConfigDataGrid; - private System.Windows.Forms.DataGridViewTextBoxColumn Key; - private System.Windows.Forms.DataGridViewTextBoxColumn Value; - } -} \ No newline at end of file diff --git a/tmp/NTRDebuggerTool/Forms/ConfigDialog.cs b/tmp/NTRDebuggerTool/Forms/ConfigDialog.cs deleted file mode 100644 index f581643..0000000 --- a/tmp/NTRDebuggerTool/Forms/ConfigDialog.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Collections.Generic; -using System.Windows.Forms; - -namespace NTRDebuggerTool.Forms -{ - public partial class ConfigDialog : Form - { - MainForm Form; - - public ConfigDialog(MainForm Form) - { - this.Form = Form; - InitializeComponent(); - Dictionary ConfigValues = Config.All; - foreach (string Key in ConfigValues.Keys) - { - int Row = ConfigDataGrid.Rows.Add(); - ConfigDataGrid[0, Row].Value = Key; - ConfigDataGrid[1, Row].Value = ConfigValues[Key]; - } - } - - private void ConfigDataGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) - { - ConfigDataGrid.BeginEdit(true); - } - - private void ConfigDataGrid_CellLeave(object sender, DataGridViewCellEventArgs e) - { - ConfigDataGrid.EndEdit(); - } - - private void ButtonCancel_Click(object sender, System.EventArgs e) - { - Close(); - } - - private void ButtonSave_Click(object sender, System.EventArgs e) - { - Dictionary ConfigValues = new Dictionary(); - for (int Row = 0; Row < ConfigDataGrid.RowCount; ++Row) - { - ConfigValues.Add(ConfigDataGrid[0, Row].Value.ToString(), ConfigDataGrid[1, Row].Value.ToString()); - } - Config.All = ConfigValues; - Close(); - } - } -} diff --git a/tmp/NTRDebuggerTool/Forms/ConfigDialog.resx b/tmp/NTRDebuggerTool/Forms/ConfigDialog.resx deleted file mode 100644 index 5bca008..0000000 --- a/tmp/NTRDebuggerTool/Forms/ConfigDialog.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - True - - \ No newline at end of file diff --git a/tmp/NTRDebuggerTool/Forms/FormEnums/DataType.cs b/tmp/NTRDebuggerTool/Forms/FormEnums/DataType.cs deleted file mode 100644 index 043e68f..0000000 --- a/tmp/NTRDebuggerTool/Forms/FormEnums/DataType.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace NTRDebuggerTool.Forms.FormEnums -{ - public static class DataTypeExactTool - { - static Dictionary Mapping = new Dictionary(); - - static DataTypeExactTool() - { - Mapping.Add("1 Byte", DataTypeExact.Bytes1); - Mapping.Add("2 Bytes", DataTypeExact.Bytes2); - Mapping.Add("4 Bytes", DataTypeExact.Bytes4); - Mapping.Add("8 Bytes", DataTypeExact.Bytes8); - Mapping.Add("Float", DataTypeExact.Float); - Mapping.Add("Double", DataTypeExact.Double); - Mapping.Add("Raw", DataTypeExact.Raw); - Mapping.Add("Text", DataTypeExact.Text); - } - - public static string[] GetValues() - { - return Mapping.Keys.ToArray(); - } - - public static DataTypeExact GetValue(string key) - { - return Mapping[key]; - } - - public static string GetKey(DataTypeExact value) - { - foreach (string key in Mapping.Keys) - { - if (Mapping[key] == value) - { - return key; - } - } - return null; - } - } - - public enum DataTypeExact - { - Bytes1 = 1, - Bytes2 = 2, - Bytes4 = 3, - Bytes8 = 4, - Float = 5, - Double = 6, - Raw = 7, - Text = 8 - } - - public static class DataTypeNumericTool - { - static Dictionary Mapping = new Dictionary(); - - static DataTypeNumericTool() - { - Mapping.Add("1 Byte", DataTypeNumeric.Bytes1); - Mapping.Add("2 Bytes", DataTypeNumeric.Bytes2); - Mapping.Add("4 Bytes", DataTypeNumeric.Bytes4); - Mapping.Add("8 Bytes", DataTypeNumeric.Bytes8); - Mapping.Add("Float", DataTypeNumeric.Float); - Mapping.Add("Double", DataTypeNumeric.Double); - } - - public static string[] GetValues() - { - return Mapping.Keys.ToArray(); - } - - public static DataTypeNumeric GetValue(string key) - { - return Mapping[key]; - } - } - - public enum DataTypeNumeric - { - Bytes1 = 1, - Bytes2 = 2, - Bytes4 = 3, - Bytes8 = 4, - Float = 5, - Double = 6 - } -} diff --git a/tmp/NTRDebuggerTool/Forms/FormEnums/SearchType.cs b/tmp/NTRDebuggerTool/Forms/FormEnums/SearchType.cs deleted file mode 100644 index bb0b7df..0000000 --- a/tmp/NTRDebuggerTool/Forms/FormEnums/SearchType.cs +++ /dev/null @@ -1,142 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace NTRDebuggerTool.Forms.FormEnums -{ - - public static class SearchTypeInitialTool - { - static Dictionary Mapping = new Dictionary(); - - static SearchTypeInitialTool() - { - Mapping.Add("Exact", SearchTypeInitial.Exact); - Mapping.Add("Range", SearchTypeInitial.Range); - Mapping.Add("Unknown", SearchTypeInitial.Unknown); - } - - public static string[] GetValues() - { - return Mapping.Keys.ToArray(); - } - - public static SearchTypeInitial GetValue(string key) - { - return Mapping[key]; - } - } - - public enum SearchTypeInitial - { - Exact = 1, - Range = 2, - Unknown = 9 - } - - public static class SearchTypeNumericTool - { - static Dictionary Mapping = new Dictionary(); - - static SearchTypeNumericTool() - { - Mapping.Add("Exact", SearchTypeNumeric.Exact); - Mapping.Add("Range", SearchTypeNumeric.Range); - Mapping.Add("Increased By", SearchTypeNumeric.IncreasedBy); - Mapping.Add("Decreased By", SearchTypeNumeric.DecreasedBy); - Mapping.Add("Increased", SearchTypeNumeric.Increased); - Mapping.Add("Decreased", SearchTypeNumeric.Decreased); - Mapping.Add("Same", SearchTypeNumeric.Same); - Mapping.Add("Different", SearchTypeNumeric.Different); - } - - public static string[] GetValues() - { - return Mapping.Keys.ToArray(); - } - - public static SearchTypeNumeric GetValue(string key) - { - return Mapping[key]; - } - } - - public enum SearchTypeNumeric - { - Exact = 1, - Range = 2, - IncreasedBy = 3, - DecreasedBy = 4, - Increased = 5, - Decreased = 6, - Same = 7, - Different = 8 - } - - public static class SearchTypeTextTool - { - static Dictionary Mapping = new Dictionary(); - - static SearchTypeTextTool() - { - Mapping.Add("Exact", SearchTypeText.Exact); - } - - public static string[] GetValues() - { - return Mapping.Keys.ToArray(); - } - - public static SearchTypeText GetValue(string key) - { - return Mapping[key]; - } - } - - public enum SearchTypeText - { - Exact = 1, - Same = 7, - Different = 8 - } - - public static class SearchTypeBaseTool - { - static Dictionary Mapping = new Dictionary(); - - static SearchTypeBaseTool() - { - Mapping.Add("Exact", SearchTypeBase.Exact); - Mapping.Add("Range", SearchTypeBase.Range); - Mapping.Add("Increased By", SearchTypeBase.IncreasedBy); - Mapping.Add("Decreased By", SearchTypeBase.DecreasedBy); - Mapping.Add("Increased", SearchTypeBase.Increased); - Mapping.Add("Decreased", SearchTypeBase.Decreased); - Mapping.Add("Same", SearchTypeBase.Same); - Mapping.Add("Different", SearchTypeBase.Different); - Mapping.Add("Unknown", SearchTypeBase.Unknown); - } - - public static string[] GetValues() - { - return Mapping.Keys.ToArray(); - } - - public static SearchTypeBase GetValue(string key) - { - return Mapping[key]; - } - } - - public enum SearchTypeBase - { - Exact = 1, - Range = 2, - IncreasedBy = 3, - DecreasedBy = 4, - Increased = 5, - Decreased = 6, - Same = 7, - Different = 8, - Unknown = 9 - } -} diff --git a/tmp/NTRDebuggerTool/Forms/MainForm.Designer.cs b/tmp/NTRDebuggerTool/Forms/MainForm.Designer.cs deleted file mode 100644 index db7801f..0000000 --- a/tmp/NTRDebuggerTool/Forms/MainForm.Designer.cs +++ /dev/null @@ -1,702 +0,0 @@ -namespace NTRDebuggerTool.Forms -{ - partial class MainForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); - this.ComboDataType = new System.Windows.Forms.ComboBox(); - this.SearchValue = new System.Windows.Forms.TextBox(); - this.ResultsGrid = new System.Windows.Forms.DataGridView(); - this.SearchResultsAddressColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.SearchResultsValueColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ButtonAddResults = new System.Windows.Forms.Button(); - this.SearchButton = new System.Windows.Forms.Button(); - this.ResetButton = new System.Windows.Forms.Button(); - this.ValuesGrid = new System.Windows.Forms.DataGridView(); - this.ValuesGridLockColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.ValuesGridAddressColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ValuesGridValueColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ValuesGridTypeColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); - this.ValuesGridContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); - this.ValuesGridRefreshItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ValuesGridAddItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ValuesGridDeleteItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ValuesGridConvertCode = new System.Windows.Forms.ToolStripMenuItem(); - this.ValuesGridPointerSearch = new System.Windows.Forms.ToolStripMenuItem(); - this.ValuesGridCopyResolvedAddress = new System.Windows.Forms.ToolStripMenuItem(); - this.LabelIPPort = new System.Windows.Forms.Label(); - this.LabelProcess = new System.Windows.Forms.Label(); - this.LabelMemoryRange = new System.Windows.Forms.Label(); - this.ButtonConnectDisconnect = new System.Windows.Forms.Button(); - this.ButtonOpenProcess = new System.Windows.Forms.Button(); - this.ButtonRefreshMemoryRange = new System.Windows.Forms.Button(); - this.IP = new System.Windows.Forms.TextBox(); - this.Port = new System.Windows.Forms.TextBox(); - this.Processes = new System.Windows.Forms.ComboBox(); - this.MemoryRange = new System.Windows.Forms.ComboBox(); - this.ProgressBarStatusStrip = new System.Windows.Forms.StatusStrip(); - this.ProgressBarMemoryRead = new System.Windows.Forms.ProgressBar(); - this.GUIUpdateTimer = new System.Windows.Forms.Timer(this.components); - this.LabelCustomRange = new System.Windows.Forms.Label(); - this.MemoryStart = new System.Windows.Forms.TextBox(); - this.MemorySize = new System.Windows.Forms.TextBox(); - this.LabelCurrentOperation = new System.Windows.Forms.Label(); - this.ProgressBarMemoryScan = new System.Windows.Forms.ProgressBar(); - this.LabelLastSearch = new System.Windows.Forms.Label(); - this.LabelDataType = new System.Windows.Forms.Label(); - this.LabelSearchValue = new System.Windows.Forms.Label(); - this.LabelSearchType = new System.Windows.Forms.Label(); - this.ComboSearchType = new System.Windows.Forms.ComboBox(); - this.TextEndAddress = new System.Windows.Forms.TextBox(); - this.LabelEndAddress = new System.Windows.Forms.Label(); - this.SearchValue2 = new System.Windows.Forms.TextBox(); - this.LabelDash = new System.Windows.Forms.Label(); - this.ButtonConfig = new System.Windows.Forms.Button(); - this.LabelButtonState = new System.Windows.Forms.Label(); - this.SaveButton = new System.Windows.Forms.Button(); - this.LoadButton = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.ResultsGrid)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.ValuesGrid)).BeginInit(); - this.ValuesGridContextMenuStrip.SuspendLayout(); - this.SuspendLayout(); - // - // ComboDataType - // - this.ComboDataType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ComboDataType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.ComboDataType.FormattingEnabled = true; - this.ComboDataType.Location = new System.Drawing.Point(602, 109); - this.ComboDataType.Name = "ComboDataType"; - this.ComboDataType.Size = new System.Drawing.Size(91, 21); - this.ComboDataType.TabIndex = 1; - this.ComboDataType.SelectionChangeCommitted += new System.EventHandler(this.ComboDataType_SelectedValueChanged); - // - // SearchValue - // - this.SearchValue.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.SearchValue.Location = new System.Drawing.Point(486, 134); - this.SearchValue.Name = "SearchValue"; - this.SearchValue.Size = new System.Drawing.Size(286, 20); - this.SearchValue.TabIndex = 4; - // - // ResultsGrid - // - this.ResultsGrid.AllowUserToAddRows = false; - this.ResultsGrid.AllowUserToDeleteRows = false; - this.ResultsGrid.AllowUserToResizeRows = false; - this.ResultsGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.ResultsGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.ResultsGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.SearchResultsAddressColumn, - this.SearchResultsValueColumn}); - this.ResultsGrid.Location = new System.Drawing.Point(12, 39); - this.ResultsGrid.Name = "ResultsGrid"; - this.ResultsGrid.ReadOnly = true; - this.ResultsGrid.RowHeadersVisible = false; - this.ResultsGrid.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.ResultsGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.ResultsGrid.ShowCellErrors = false; - this.ResultsGrid.ShowCellToolTips = false; - this.ResultsGrid.ShowEditingIcon = false; - this.ResultsGrid.ShowRowErrors = false; - this.ResultsGrid.Size = new System.Drawing.Size(377, 476); - this.ResultsGrid.TabIndex = 7; - // - // SearchResultsAddressColumn - // - this.SearchResultsAddressColumn.HeaderText = "Address"; - this.SearchResultsAddressColumn.Name = "SearchResultsAddressColumn"; - this.SearchResultsAddressColumn.ReadOnly = true; - this.SearchResultsAddressColumn.Width = 62; - // - // SearchResultsValueColumn - // - this.SearchResultsValueColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.SearchResultsValueColumn.HeaderText = "Value on Search"; - this.SearchResultsValueColumn.Name = "SearchResultsValueColumn"; - this.SearchResultsValueColumn.ReadOnly = true; - // - // ButtonAddResults - // - this.ButtonAddResults.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ButtonAddResults.Location = new System.Drawing.Point(272, 10); - this.ButtonAddResults.Name = "ButtonAddResults"; - this.ButtonAddResults.Size = new System.Drawing.Size(117, 23); - this.ButtonAddResults.TabIndex = 8; - this.ButtonAddResults.Text = "Add Selected Results"; - this.ButtonAddResults.UseVisualStyleBackColor = true; - this.ButtonAddResults.Click += new System.EventHandler(this.ButtonAddResults_Click); - // - // SearchButton - // - this.SearchButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.SearchButton.Location = new System.Drawing.Point(620, 159); - this.SearchButton.Name = "SearchButton"; - this.SearchButton.Size = new System.Drawing.Size(73, 23); - this.SearchButton.TabIndex = 9; - this.SearchButton.Text = "Search"; - this.SearchButton.UseVisualStyleBackColor = true; - this.SearchButton.Click += new System.EventHandler(this.SearchButton_Click); - // - // ResetButton - // - this.ResetButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ResetButton.Location = new System.Drawing.Point(699, 159); - this.ResetButton.Name = "ResetButton"; - this.ResetButton.Size = new System.Drawing.Size(73, 23); - this.ResetButton.TabIndex = 10; - this.ResetButton.Text = "Reset"; - this.ResetButton.UseVisualStyleBackColor = true; - this.ResetButton.Click += new System.EventHandler(this.ResetButton_Click); - // - // ValuesGrid - // - this.ValuesGrid.AllowUserToAddRows = false; - this.ValuesGrid.AllowUserToResizeRows = false; - this.ValuesGrid.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); - this.ValuesGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.ValuesGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.ValuesGridLockColumn, - this.ValuesGridAddressColumn, - this.ValuesGridValueColumn, - this.ValuesGridTypeColumn}); - this.ValuesGrid.ContextMenuStrip = this.ValuesGridContextMenuStrip; - this.ValuesGrid.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; - this.ValuesGrid.Location = new System.Drawing.Point(395, 188); - this.ValuesGrid.MultiSelect = false; - this.ValuesGrid.Name = "ValuesGrid"; - this.ValuesGrid.RowHeadersVisible = false; - this.ValuesGrid.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.ValuesGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; - this.ValuesGrid.ShowCellErrors = false; - this.ValuesGrid.ShowEditingIcon = false; - this.ValuesGrid.ShowRowErrors = false; - this.ValuesGrid.Size = new System.Drawing.Size(377, 327); - this.ValuesGrid.TabIndex = 12; - this.ValuesGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.ValuesGrid_CellClick); - this.ValuesGrid.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.ValuesGrid_CellDoubleClick); - this.ValuesGrid.CellLeave += new System.Windows.Forms.DataGridViewCellEventHandler(this.ValuesGrid_CellLeave); - this.ValuesGrid.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.ValuesGrid_CellValueChanged); - // - // ValuesGridLockColumn - // - this.ValuesGridLockColumn.HeaderText = "Lock"; - this.ValuesGridLockColumn.Name = "ValuesGridLockColumn"; - this.ValuesGridLockColumn.Resizable = System.Windows.Forms.DataGridViewTriState.False; - this.ValuesGridLockColumn.TrueValue = "T"; - this.ValuesGridLockColumn.Width = 35; - // - // ValuesGridAddressColumn - // - this.ValuesGridAddressColumn.HeaderText = "Address"; - this.ValuesGridAddressColumn.Name = "ValuesGridAddressColumn"; - this.ValuesGridAddressColumn.Resizable = System.Windows.Forms.DataGridViewTriState.False; - this.ValuesGridAddressColumn.Width = 62; - // - // ValuesGridValueColumn - // - this.ValuesGridValueColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.ValuesGridValueColumn.HeaderText = "Value"; - this.ValuesGridValueColumn.Name = "ValuesGridValueColumn"; - this.ValuesGridValueColumn.Resizable = System.Windows.Forms.DataGridViewTriState.False; - this.ValuesGridValueColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; - // - // ValuesGridTypeColumn - // - this.ValuesGridTypeColumn.HeaderText = "Type"; - this.ValuesGridTypeColumn.Name = "ValuesGridTypeColumn"; - this.ValuesGridTypeColumn.Resizable = System.Windows.Forms.DataGridViewTriState.False; - this.ValuesGridTypeColumn.Width = 63; - // - // ValuesGridContextMenuStrip - // - this.ValuesGridContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.ValuesGridRefreshItem, - this.ValuesGridAddItem, - this.ValuesGridDeleteItem, - this.ValuesGridConvertCode, - this.ValuesGridPointerSearch, - this.ValuesGridCopyResolvedAddress}); - this.ValuesGridContextMenuStrip.Name = "ValuesGridContextMenuStrip"; - this.ValuesGridContextMenuStrip.Size = new System.Drawing.Size(198, 136); - this.ValuesGridContextMenuStrip.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.ValuesGridContextMenuStrip_ItemClicked); - // - // ValuesGridRefreshItem - // - this.ValuesGridRefreshItem.Name = "ValuesGridRefreshItem"; - this.ValuesGridRefreshItem.Size = new System.Drawing.Size(197, 22); - this.ValuesGridRefreshItem.Text = "Refresh"; - // - // ValuesGridAddItem - // - this.ValuesGridAddItem.Name = "ValuesGridAddItem"; - this.ValuesGridAddItem.Size = new System.Drawing.Size(197, 22); - this.ValuesGridAddItem.Text = "New"; - // - // ValuesGridDeleteItem - // - this.ValuesGridDeleteItem.Name = "ValuesGridDeleteItem"; - this.ValuesGridDeleteItem.Size = new System.Drawing.Size(197, 22); - this.ValuesGridDeleteItem.Text = "Delete"; - // - // ValuesGridConvertCode - // - this.ValuesGridConvertCode.Name = "ValuesGridConvertCode"; - this.ValuesGridConvertCode.Size = new System.Drawing.Size(197, 22); - this.ValuesGridConvertCode.Text = "Convert AR3DS Code"; - // - // ValuesGridPointerSearch - // - this.ValuesGridPointerSearch.Name = "ValuesGridPointerSearch"; - this.ValuesGridPointerSearch.Size = new System.Drawing.Size(197, 22); - this.ValuesGridPointerSearch.Text = "Pointer Scan"; - // - // ValuesGridCopyResolvedAddress - // - this.ValuesGridCopyResolvedAddress.Name = "ValuesGridCopyResolvedAddress"; - this.ValuesGridCopyResolvedAddress.Size = new System.Drawing.Size(197, 22); - this.ValuesGridCopyResolvedAddress.Text = "Copy Resolved Address"; - // - // LabelIPPort - // - this.LabelIPPort.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.LabelIPPort.Location = new System.Drawing.Point(395, 9); - this.LabelIPPort.Name = "LabelIPPort"; - this.LabelIPPort.Size = new System.Drawing.Size(85, 23); - this.LabelIPPort.TabIndex = 13; - this.LabelIPPort.Text = "IP, Port"; - this.LabelIPPort.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // LabelProcess - // - this.LabelProcess.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.LabelProcess.Location = new System.Drawing.Point(395, 34); - this.LabelProcess.Name = "LabelProcess"; - this.LabelProcess.Size = new System.Drawing.Size(85, 23); - this.LabelProcess.TabIndex = 15; - this.LabelProcess.Text = "Process"; - this.LabelProcess.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // LabelMemoryRange - // - this.LabelMemoryRange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.LabelMemoryRange.Location = new System.Drawing.Point(395, 59); - this.LabelMemoryRange.Name = "LabelMemoryRange"; - this.LabelMemoryRange.Size = new System.Drawing.Size(85, 23); - this.LabelMemoryRange.TabIndex = 16; - this.LabelMemoryRange.Text = "Memory Range"; - this.LabelMemoryRange.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // ButtonConnectDisconnect - // - this.ButtonConnectDisconnect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ButtonConnectDisconnect.Location = new System.Drawing.Point(699, 9); - this.ButtonConnectDisconnect.Name = "ButtonConnectDisconnect"; - this.ButtonConnectDisconnect.Size = new System.Drawing.Size(73, 23); - this.ButtonConnectDisconnect.TabIndex = 17; - this.ButtonConnectDisconnect.Text = "Connect"; - this.ButtonConnectDisconnect.UseVisualStyleBackColor = true; - this.ButtonConnectDisconnect.Click += new System.EventHandler(this.ButtonConnectDisconnect_Click); - // - // ButtonOpenProcess - // - this.ButtonOpenProcess.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ButtonOpenProcess.Location = new System.Drawing.Point(699, 34); - this.ButtonOpenProcess.Name = "ButtonOpenProcess"; - this.ButtonOpenProcess.Size = new System.Drawing.Size(73, 23); - this.ButtonOpenProcess.TabIndex = 18; - this.ButtonOpenProcess.Text = "Open"; - this.ButtonOpenProcess.UseVisualStyleBackColor = true; - this.ButtonOpenProcess.Click += new System.EventHandler(this.ButtonOpenProcess_Click); - // - // ButtonRefreshMemoryRange - // - this.ButtonRefreshMemoryRange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ButtonRefreshMemoryRange.Location = new System.Drawing.Point(699, 59); - this.ButtonRefreshMemoryRange.Name = "ButtonRefreshMemoryRange"; - this.ButtonRefreshMemoryRange.Size = new System.Drawing.Size(73, 23); - this.ButtonRefreshMemoryRange.TabIndex = 19; - this.ButtonRefreshMemoryRange.Text = "Refresh"; - this.ButtonRefreshMemoryRange.UseVisualStyleBackColor = true; - this.ButtonRefreshMemoryRange.Click += new System.EventHandler(this.ButtonRefreshMemoryRange_Click); - // - // IP - // - this.IP.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.IP.Location = new System.Drawing.Point(486, 9); - this.IP.Name = "IP"; - this.IP.Size = new System.Drawing.Size(151, 20); - this.IP.TabIndex = 20; - // - // Port - // - this.Port.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.Port.Location = new System.Drawing.Point(643, 9); - this.Port.Name = "Port"; - this.Port.Size = new System.Drawing.Size(50, 20); - this.Port.TabIndex = 21; - this.Port.Text = "8000"; - // - // Processes - // - this.Processes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.Processes.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.Processes.DropDownWidth = 200; - this.Processes.FormattingEnabled = true; - this.Processes.Location = new System.Drawing.Point(486, 34); - this.Processes.Name = "Processes"; - this.Processes.Size = new System.Drawing.Size(207, 21); - this.Processes.TabIndex = 22; - // - // MemoryRange - // - this.MemoryRange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.MemoryRange.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.MemoryRange.FormattingEnabled = true; - this.MemoryRange.Location = new System.Drawing.Point(486, 59); - this.MemoryRange.Name = "MemoryRange"; - this.MemoryRange.Size = new System.Drawing.Size(207, 21); - this.MemoryRange.TabIndex = 23; - this.MemoryRange.SelectedIndexChanged += new System.EventHandler(this.MemoryRange_SelectedIndexChanged); - // - // ProgressBarStatusStrip - // - this.ProgressBarStatusStrip.AutoSize = false; - this.ProgressBarStatusStrip.Location = new System.Drawing.Point(0, 518); - this.ProgressBarStatusStrip.Name = "ProgressBarStatusStrip"; - this.ProgressBarStatusStrip.Size = new System.Drawing.Size(784, 44); - this.ProgressBarStatusStrip.SizingGrip = false; - this.ProgressBarStatusStrip.TabIndex = 24; - // - // ProgressBarMemoryRead - // - this.ProgressBarMemoryRead.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ProgressBarMemoryRead.Location = new System.Drawing.Point(10, 525); - this.ProgressBarMemoryRead.Name = "ProgressBarMemoryRead"; - this.ProgressBarMemoryRead.Size = new System.Drawing.Size(377, 15); - this.ProgressBarMemoryRead.TabIndex = 25; - // - // GUIUpdateTimer - // - this.GUIUpdateTimer.Enabled = true; - this.GUIUpdateTimer.Interval = 5; - this.GUIUpdateTimer.Tick += new System.EventHandler(this.GUIUpdateTimer_Tick); - // - // LabelCustomRange - // - this.LabelCustomRange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.LabelCustomRange.Location = new System.Drawing.Point(395, 84); - this.LabelCustomRange.Name = "LabelCustomRange"; - this.LabelCustomRange.Size = new System.Drawing.Size(85, 23); - this.LabelCustomRange.TabIndex = 26; - this.LabelCustomRange.Text = "Start Addr, Size"; - this.LabelCustomRange.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // MemoryStart - // - this.MemoryStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.MemoryStart.Location = new System.Drawing.Point(486, 84); - this.MemoryStart.Name = "MemoryStart"; - this.MemoryStart.Size = new System.Drawing.Size(65, 20); - this.MemoryStart.TabIndex = 27; - this.MemoryStart.TextChanged += new System.EventHandler(this.Memory_TextChanged); - // - // MemorySize - // - this.MemorySize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.MemorySize.Location = new System.Drawing.Point(557, 84); - this.MemorySize.Name = "MemorySize"; - this.MemorySize.Size = new System.Drawing.Size(65, 20); - this.MemorySize.TabIndex = 28; - this.MemorySize.TextChanged += new System.EventHandler(this.Memory_TextChanged); - // - // LabelCurrentOperation - // - this.LabelCurrentOperation.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.LabelCurrentOperation.Location = new System.Drawing.Point(298, 543); - this.LabelCurrentOperation.Name = "LabelCurrentOperation"; - this.LabelCurrentOperation.Size = new System.Drawing.Size(474, 15); - this.LabelCurrentOperation.TabIndex = 29; - // - // ProgressBarMemoryScan - // - this.ProgressBarMemoryScan.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ProgressBarMemoryScan.Location = new System.Drawing.Point(395, 525); - this.ProgressBarMemoryScan.Name = "ProgressBarMemoryScan"; - this.ProgressBarMemoryScan.Size = new System.Drawing.Size(377, 15); - this.ProgressBarMemoryScan.TabIndex = 30; - // - // LabelLastSearch - // - this.LabelLastSearch.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.LabelLastSearch.Location = new System.Drawing.Point(12, 9); - this.LabelLastSearch.Name = "LabelLastSearch"; - this.LabelLastSearch.Size = new System.Drawing.Size(254, 27); - this.LabelLastSearch.TabIndex = 31; - this.LabelLastSearch.Text = "Last Search"; - // - // LabelDataType - // - this.LabelDataType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.LabelDataType.Location = new System.Drawing.Point(699, 109); - this.LabelDataType.Name = "LabelDataType"; - this.LabelDataType.Size = new System.Drawing.Size(73, 23); - this.LabelDataType.TabIndex = 32; - this.LabelDataType.Text = "Data Type"; - this.LabelDataType.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // LabelSearchValue - // - this.LabelSearchValue.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.LabelSearchValue.Location = new System.Drawing.Point(395, 134); - this.LabelSearchValue.Name = "LabelSearchValue"; - this.LabelSearchValue.Size = new System.Drawing.Size(85, 23); - this.LabelSearchValue.TabIndex = 33; - this.LabelSearchValue.Text = "Search Value"; - this.LabelSearchValue.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // LabelSearchType - // - this.LabelSearchType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.LabelSearchType.Location = new System.Drawing.Point(395, 109); - this.LabelSearchType.Name = "LabelSearchType"; - this.LabelSearchType.Size = new System.Drawing.Size(85, 23); - this.LabelSearchType.TabIndex = 34; - this.LabelSearchType.Text = "Search Type"; - this.LabelSearchType.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // ComboSearchType - // - this.ComboSearchType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ComboSearchType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.ComboSearchType.FormattingEnabled = true; - this.ComboSearchType.Location = new System.Drawing.Point(486, 109); - this.ComboSearchType.Name = "ComboSearchType"; - this.ComboSearchType.Size = new System.Drawing.Size(110, 21); - this.ComboSearchType.TabIndex = 35; - this.ComboSearchType.SelectionChangeCommitted += new System.EventHandler(this.ComboSearchType_SelectedValueChanged); - // - // TextEndAddress - // - this.TextEndAddress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.TextEndAddress.Enabled = false; - this.TextEndAddress.Location = new System.Drawing.Point(628, 84); - this.TextEndAddress.Name = "TextEndAddress"; - this.TextEndAddress.Size = new System.Drawing.Size(65, 20); - this.TextEndAddress.TabIndex = 36; - // - // LabelEndAddress - // - this.LabelEndAddress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.LabelEndAddress.Location = new System.Drawing.Point(699, 84); - this.LabelEndAddress.Name = "LabelEndAddress"; - this.LabelEndAddress.Size = new System.Drawing.Size(73, 23); - this.LabelEndAddress.TabIndex = 37; - this.LabelEndAddress.Text = "End Address"; - this.LabelEndAddress.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // SearchValue2 - // - this.SearchValue2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.SearchValue2.Location = new System.Drawing.Point(636, 134); - this.SearchValue2.Name = "SearchValue2"; - this.SearchValue2.Size = new System.Drawing.Size(136, 20); - this.SearchValue2.TabIndex = 38; - this.SearchValue2.Visible = false; - // - // LabelDash - // - this.LabelDash.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.LabelDash.Location = new System.Drawing.Point(623, 132); - this.LabelDash.Name = "LabelDash"; - this.LabelDash.Size = new System.Drawing.Size(11, 23); - this.LabelDash.TabIndex = 39; - this.LabelDash.Text = "-"; - this.LabelDash.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.LabelDash.Visible = false; - // - // ButtonConfig - // - this.ButtonConfig.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ButtonConfig.Image = global::NTRDebuggerTool.Properties.Resources.cog2; - this.ButtonConfig.Location = new System.Drawing.Point(398, 9); - this.ButtonConfig.Name = "ButtonConfig"; - this.ButtonConfig.Size = new System.Drawing.Size(30, 30); - this.ButtonConfig.TabIndex = 40; - this.ButtonConfig.UseVisualStyleBackColor = true; - this.ButtonConfig.Click += new System.EventHandler(this.ButtonConfig_Click); - // - // LabelButtonState - // - this.LabelButtonState.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.LabelButtonState.Location = new System.Drawing.Point(12, 543); - this.LabelButtonState.Name = "LabelButtonState"; - this.LabelButtonState.Size = new System.Drawing.Size(280, 15); - this.LabelButtonState.TabIndex = 41; - // - // SaveButton - // - this.SaveButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.SaveButton.Location = new System.Drawing.Point(398, 160); - this.SaveButton.Name = "SaveButton"; - this.SaveButton.Size = new System.Drawing.Size(73, 23); - this.SaveButton.TabIndex = 42; - this.SaveButton.Text = "Save"; - this.SaveButton.UseVisualStyleBackColor = true; - this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click); - // - // LoadButton - // - this.LoadButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.LoadButton.Location = new System.Drawing.Point(477, 159); - this.LoadButton.Name = "LoadButton"; - this.LoadButton.Size = new System.Drawing.Size(73, 23); - this.LoadButton.TabIndex = 43; - this.LoadButton.Text = "Load"; - this.LoadButton.UseVisualStyleBackColor = true; - this.LoadButton.Click += new System.EventHandler(this.LoadButton_Click); - // - // MainForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(784, 562); - this.Controls.Add(this.LoadButton); - this.Controls.Add(this.SaveButton); - this.Controls.Add(this.LabelButtonState); - this.Controls.Add(this.ButtonConfig); - this.Controls.Add(this.LabelEndAddress); - this.Controls.Add(this.TextEndAddress); - this.Controls.Add(this.ComboSearchType); - this.Controls.Add(this.LabelSearchType); - this.Controls.Add(this.LabelSearchValue); - this.Controls.Add(this.LabelDataType); - this.Controls.Add(this.LabelLastSearch); - this.Controls.Add(this.ProgressBarMemoryScan); - this.Controls.Add(this.LabelCurrentOperation); - this.Controls.Add(this.MemorySize); - this.Controls.Add(this.MemoryStart); - this.Controls.Add(this.LabelCustomRange); - this.Controls.Add(this.ProgressBarMemoryRead); - this.Controls.Add(this.ProgressBarStatusStrip); - this.Controls.Add(this.MemoryRange); - this.Controls.Add(this.Processes); - this.Controls.Add(this.Port); - this.Controls.Add(this.IP); - this.Controls.Add(this.ButtonRefreshMemoryRange); - this.Controls.Add(this.ButtonOpenProcess); - this.Controls.Add(this.ButtonConnectDisconnect); - this.Controls.Add(this.LabelMemoryRange); - this.Controls.Add(this.LabelProcess); - this.Controls.Add(this.LabelIPPort); - this.Controls.Add(this.ValuesGrid); - this.Controls.Add(this.ResetButton); - this.Controls.Add(this.SearchButton); - this.Controls.Add(this.ButtonAddResults); - this.Controls.Add(this.ResultsGrid); - this.Controls.Add(this.SearchValue); - this.Controls.Add(this.ComboDataType); - this.Controls.Add(this.LabelDash); - this.Controls.Add(this.SearchValue2); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MaximumSize = new System.Drawing.Size(800, 99999); - this.MinimumSize = new System.Drawing.Size(800, 600); - this.Name = "MainForm"; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.Text = "NTR Cheat Tool"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); - this.Load += new System.EventHandler(this.MainForm_Load); - ((System.ComponentModel.ISupportInitialize)(this.ResultsGrid)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.ValuesGrid)).EndInit(); - this.ValuesGridContextMenuStrip.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.ComboBox ComboDataType; - internal System.Windows.Forms.TextBox SearchValue; - internal System.Windows.Forms.DataGridView ResultsGrid; - private System.Windows.Forms.Button ButtonAddResults; - private System.Windows.Forms.Button SearchButton; - private System.Windows.Forms.Button ResetButton; - private System.Windows.Forms.DataGridView ValuesGrid; - private System.Windows.Forms.Label LabelIPPort; - private System.Windows.Forms.Label LabelProcess; - private System.Windows.Forms.Label LabelMemoryRange; - internal System.Windows.Forms.Button ButtonConnectDisconnect; - private System.Windows.Forms.Button ButtonOpenProcess; - private System.Windows.Forms.Button ButtonRefreshMemoryRange; - internal System.Windows.Forms.TextBox IP; - internal System.Windows.Forms.TextBox Port; - internal System.Windows.Forms.ComboBox Processes; - private System.Windows.Forms.ComboBox MemoryRange; - private System.Windows.Forms.StatusStrip ProgressBarStatusStrip; - private System.Windows.Forms.ProgressBar ProgressBarMemoryRead; - private System.Windows.Forms.Timer GUIUpdateTimer; - private System.Windows.Forms.Label LabelCustomRange; - internal System.Windows.Forms.TextBox MemoryStart; - internal System.Windows.Forms.TextBox MemorySize; - private System.Windows.Forms.Label LabelCurrentOperation; - private System.Windows.Forms.ContextMenuStrip ValuesGridContextMenuStrip; - private System.Windows.Forms.ToolStripMenuItem ValuesGridAddItem; - private System.Windows.Forms.ToolStripMenuItem ValuesGridDeleteItem; - private System.Windows.Forms.ToolStripMenuItem ValuesGridConvertCode; - private System.Windows.Forms.ProgressBar ProgressBarMemoryScan; - private System.Windows.Forms.DataGridViewTextBoxColumn SearchResultsAddressColumn; - private System.Windows.Forms.DataGridViewTextBoxColumn SearchResultsValueColumn; - private System.Windows.Forms.Label LabelLastSearch; - private System.Windows.Forms.Label LabelDataType; - private System.Windows.Forms.Label LabelSearchValue; - private System.Windows.Forms.Label LabelSearchType; - private System.Windows.Forms.ComboBox ComboSearchType; - internal System.Windows.Forms.TextBox TextEndAddress; - private System.Windows.Forms.Label LabelEndAddress; - private System.Windows.Forms.DataGridViewCheckBoxColumn ValuesGridLockColumn; - private System.Windows.Forms.DataGridViewTextBoxColumn ValuesGridAddressColumn; - private System.Windows.Forms.DataGridViewTextBoxColumn ValuesGridValueColumn; - private System.Windows.Forms.DataGridViewComboBoxColumn ValuesGridTypeColumn; - internal System.Windows.Forms.TextBox SearchValue2; - private System.Windows.Forms.Label LabelDash; - private System.Windows.Forms.Button ButtonConfig; - private System.Windows.Forms.Label LabelButtonState; - private System.Windows.Forms.ToolStripMenuItem ValuesGridRefreshItem; - private System.Windows.Forms.ToolStripMenuItem ValuesGridPointerSearch; - private System.Windows.Forms.ToolStripMenuItem ValuesGridCopyResolvedAddress; - private System.Windows.Forms.Button SaveButton; - private System.Windows.Forms.Button LoadButton; - } -} diff --git a/tmp/NTRDebuggerTool/Forms/MainForm.cs b/tmp/NTRDebuggerTool/Forms/MainForm.cs deleted file mode 100644 index 6784b36..0000000 --- a/tmp/NTRDebuggerTool/Forms/MainForm.cs +++ /dev/null @@ -1,791 +0,0 @@ -using NTRDebuggerTool.Forms.FormEnums; -using NTRDebuggerTool.Objects; -using NTRDebuggerTool.Objects.Saving; -using NTRDebuggerTool.Remote; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Threading; -using System.Windows.Forms; - -namespace NTRDebuggerTool.Forms -{ - public partial class MainForm : Form - { - internal bool ControlEnabledButtonConnectDisconnect = true; - private bool ControlEnabledIP = true; - private bool ControlEnabledPort = true; - - private bool ControlEnabledProcesses = false; - internal bool ControlEnabledButtonOpenProcess = false; - - internal bool ControlEnabledMemoryRange = false; - private bool ControlEnabledButtonRefreshMemoryRange = false; - private bool ControlEnabledButtonAddResults = false; - private bool ControlEnabledResetButton = false; - private bool ControlEnabledResultsGrid = false; - internal bool ControlEnabledSearchButton = false; - internal bool ControlEnabledDataType = false; - private bool ControlEnabledSearchType = false; - private bool ControlEnabledSearchValue = false; - private bool ControlEnabledSearchValue2 = false; - private bool ControlEnabledValuesGrid = false; - - private bool ControlEnabledStart = false; - private bool ControlEnabledSize = false; - - internal bool FormEnabled = true; - - private Thread EventDispatcherThread; - private Thread ButtonStateThread; - - private int PointerSearchRow = 0; - - internal string SetConnectText = null; - - internal NTRRemoteConnection NTRConnection; - - private MainFormThreadEventDispatcher ThreadEventDispatcher; - private MainFormThreadButtonState ThreadButtonState; - internal bool SearchComplete = false; - - internal SearchCriteria LastSearchCriteria; - - private Stopwatch LockValuesStopwatch = new Stopwatch(); - - public MainForm(NTRRemoteConnection NTRConnection) - { - InitializeComponent(); - this.NTRConnection = NTRConnection; - this.ThreadEventDispatcher = new MainFormThreadEventDispatcher(this); - this.EventDispatcherThread = new Thread(new ThreadStart(this.ThreadEventDispatcher.ThreadEventDispatcher)); - this.EventDispatcherThread.Name = "EventDispatcherThread"; - this.EventDispatcherThread.Start(); - - this.ThreadButtonState = new MainFormThreadButtonState(this); - this.ButtonStateThread = new Thread(new ThreadStart(this.ThreadButtonState.ThreadButtonState)); - this.ButtonStateThread.Name = "ButtonStateThread"; - this.ButtonStateThread.Start(); - - this.IP.Text = Config.DefaultIP; - LockValuesStopwatch.Start(); - } - - private void MainForm_Load(object sender, EventArgs e) - { - ComboSearchType.Items.AddRange(SearchTypeInitialTool.GetValues()); - ComboDataType.Items.AddRange(DataTypeExactTool.GetValues()); - ValuesGridTypeColumn.Items.AddRange(DataTypeExactTool.GetValues()); - this.ComboSearchType.SelectedIndex = 0; - this.ComboDataType.SelectedIndex = 2; - } - - private void UpdateLockedControls() - { - this.ButtonAddResults.Enabled = !NTRConnection.LockControls && this.ControlEnabledButtonAddResults; - this.ButtonConnectDisconnect.Enabled = !NTRConnection.LockControls && this.ControlEnabledButtonConnectDisconnect; - this.ButtonOpenProcess.Enabled = !NTRConnection.LockControls && this.ControlEnabledButtonOpenProcess; - this.ButtonRefreshMemoryRange.Enabled = !NTRConnection.LockControls && this.ControlEnabledButtonRefreshMemoryRange; - this.IP.Enabled = !NTRConnection.LockControls && this.ControlEnabledIP; - this.MemoryRange.Enabled = !NTRConnection.LockControls && this.ControlEnabledMemoryRange; - this.SaveButton.Enabled = !NTRConnection.LockControls && this.ControlEnabledMemoryRange; - this.LoadButton.Enabled = !NTRConnection.LockControls && this.ControlEnabledMemoryRange; - this.Port.Enabled = !NTRConnection.LockControls && this.ControlEnabledPort; - this.Processes.Enabled = !NTRConnection.LockControls && this.ControlEnabledProcesses; - this.ResetButton.Enabled = !NTRConnection.LockControls && this.ControlEnabledResetButton; - this.ResultsGrid.Enabled = !NTRConnection.LockControls && this.ControlEnabledResultsGrid; - this.SearchButton.Enabled = !NTRConnection.LockControls && this.ControlEnabledSearchButton; - this.ComboSearchType.Enabled = !NTRConnection.LockControls && this.ControlEnabledSearchType; - this.ComboDataType.Enabled = !NTRConnection.LockControls && this.ControlEnabledDataType; - this.SearchValue.Enabled = !NTRConnection.LockControls && this.ControlEnabledSearchValue; - this.SearchValue2.Enabled = !NTRConnection.LockControls && this.ControlEnabledSearchValue2; - this.ValuesGrid.Enabled = !NTRConnection.LockControls && this.ControlEnabledValuesGrid; - this.MemoryStart.Enabled = !NTRConnection.LockControls && this.ControlEnabledStart; - this.MemorySize.Enabled = !NTRConnection.LockControls && this.ControlEnabledSize; - - } - - internal void SetConnectedControls(bool Enabled) - { - ControlEnabledProcesses = Enabled; - ControlEnabledButtonOpenProcess = Enabled; - } - - internal void SetProcessSelectedControls(bool Enabled) - { - ControlEnabledMemoryRange = Enabled; - ControlEnabledButtonRefreshMemoryRange = Enabled; - ControlEnabledButtonAddResults = Enabled; - ControlEnabledResetButton = Enabled; - ControlEnabledResultsGrid = Enabled; - ControlEnabledSearchButton = Enabled; - ControlEnabledSearchType = Enabled; - ControlEnabledDataType = Enabled; - ControlEnabledSearchValue = Enabled; - ControlEnabledSearchValue2 = Enabled; - ControlEnabledValuesGrid = Enabled; - } - - internal void SetConnectionControls(bool Enabled) - { - ControlEnabledButtonConnectDisconnect = Enabled; - ControlEnabledIP = Enabled; - ControlEnabledPort = Enabled; - } - - private void GUIUpdateTimer_Tick(object sender, EventArgs e) - { - if (Enabled != FormEnabled) - { - Enabled = FormEnabled; - if (FormEnabled) - { - Activate(); - } - } - - NTRConnection.SendHeartbeatPacket(); - - int LocalReadMax = (int)NTRConnection.ProgressReadMax, LocalRead = (int)NTRConnection.ProgressRead, LocalScanMax = (int)NTRConnection.ProgressScanMax, LocalScan = (int)NTRConnection.ProgressScan; - - if (LocalReadMax > 0 && LocalRead >= 0 && LocalReadMax >= LocalRead) - { - ProgressBarMemoryRead.Maximum = LocalReadMax; - ProgressBarMemoryRead.Value = LocalRead; - } - else - { - ProgressBarMemoryRead.Maximum = ProgressBarMemoryRead.Value = 0; - } - - if (LocalScanMax > 0 && LocalScan >= 0 && LocalScanMax >= LocalScan) - { - ProgressBarMemoryScan.Maximum = LocalScanMax; - ProgressBarMemoryScan.Value = LocalScan; - } - else - { - ProgressBarMemoryScan.Maximum = ProgressBarMemoryScan.Value = 0; - } - - if (NTRConnection.IsProcessListUpdated) - { - NTRConnection.IsProcessListUpdated = false; - string CurrentProcess = Processes.SelectedValue == null ? null : Processes.SelectedValue.ToString(); - Processes.Items.Clear(); - Processes.Items.AddRange(NTRConnection.Processes.ToArray()); - if (CurrentProcess != null && Processes.Items.Contains(CurrentProcess)) - { - Processes.SelectedValue = CurrentProcess; - Processes.SelectedIndex = Processes.Items.IndexOf(CurrentProcess); - } - else if (!Processes.Items[0].ToString().Contains(',')) - { - Processes.SelectedIndex = 0; - } - SetConnectedControls(true); - ControlEnabledButtonConnectDisconnect = true; - NTRConnection.SetCurrentOperationText = ""; - } - - if (NTRConnection.IsMemoryListUpdated) - { - NTRConnection.IsMemoryListUpdated = false; - string CurrentRange = MemoryRange.SelectedValue == null ? "All" : MemoryRange.SelectedValue.ToString(); - MemoryRange.Items.Clear(); - MemoryRange.Items.Add("All"); - foreach (uint Start in NTRConnection.AddressSpaces.Keys) - { - MemoryRange.Items.Add(Utilities.GetStringFromByteArray(BitConverter.GetBytes(Start).Reverse().ToArray()) + "|" + Utilities.GetStringFromByteArray(BitConverter.GetBytes(NTRConnection.AddressSpaces[Start]).Reverse().ToArray())); - } - MemoryRange.Items.Add("Custom"); - if (CurrentRange != null && MemoryRange.Items.Contains(CurrentRange)) - { - MemoryRange.SelectedValue = CurrentRange; - MemoryRange.SelectedIndex = MemoryRange.Items.IndexOf(CurrentRange); - } - SetProcessSelectedControls(true); - SetConnectedControls(true); - NTRConnection.SetCurrentOperationText = ""; - } - - if (LastSearchCriteria != null && LastSearchCriteria.SearchValue != null) - { - LabelLastSearch.Text = "Last Search\n" + LastSearchCriteria.AddressesFound.Count + " results found for " + GetDisplayForByteArray(LastSearchCriteria.SearchValue); - - if (SearchComplete) - { - ControlEnabledSearchButton = true; - if (LastSearchCriteria.AddressesFound.Count < Config.MaxValuesToDisplay) - { - ResultsGrid.Rows.Clear(); - foreach (uint Address in LastSearchCriteria.AddressesFound.Keys) - { - int Row = ResultsGrid.Rows.Add(); - ResultsGrid[0, Row].Value = Utilities.GetStringFromByteArray(BitConverter.GetBytes(Address).Reverse().ToArray()); - ResultsGrid[1, Row].Value = GetDisplayForByteArray(LastSearchCriteria.AddressesFound[Address]); - } - } - NTRConnection.SetCurrentOperationText = ""; - ComboDataType_SelectedValueChanged(null, null); - SearchComplete = false; - } - } - - if (SetConnectText != null) - { - ButtonConnectDisconnect.Text = SetConnectText; - SetConnectText = null; - } - - LabelCurrentOperation.Text = NTRConnection.SetCurrentOperationText; - LabelButtonState.Text = NTRConnection.SetCurrentOperationText2; - - UpdateLockedControls(); - - if (NTRConnection.IsConnected) - { - if (LockValuesStopwatch.ElapsedMilliseconds > Config.LockValuesDelay) - { - for (int i = 0; i < ValuesGrid.Rows.Count; ++i) - { - if (ValuesGrid[0, i].Value is string) - { - SetMemory(i); - } - } - LockValuesStopwatch.Restart(); - } - } - - if (ThreadEventDispatcher.FoundPointerAddress != null) - { - ValuesGrid[1, PointerSearchRow].Value = ThreadEventDispatcher.FoundPointerAddress; - ThreadEventDispatcher.FoundPointerAddress = null; - } - - if (ThreadEventDispatcher.RefreshValueReturn.Count > 0) - { - MemoryDispatch MemoryDispatch; - while (ThreadEventDispatcher.RefreshValueReturn.TryDequeue(out MemoryDispatch)) - { - ValuesGrid[1, MemoryDispatch.Row].ToolTipText = MemoryDispatch.ResolvedAddress; - ValuesGrid[2, MemoryDispatch.Row].Value = GetDisplayForByteArray(MemoryDispatch.Value, MemoryDispatch.Type); - } - } - } - - public string GetDisplayForByteArray(byte[] p) - { - return GetDisplayForByteArray(p, ThreadEventDispatcher.CurrentSelectedDataType); - } - - public string GetDisplayForByteArray(byte[] p, DataTypeExact DataType) - { - switch (DataType) - { - case DataTypeExact.Bytes1: //1 Byte - return ((uint)p[0]).ToString(); - case DataTypeExact.Bytes2: //2 Bytes - return BitConverter.ToUInt16(p, 0).ToString(); - case DataTypeExact.Bytes4: //4 Bytes - return BitConverter.ToUInt32(p, 0).ToString(); - case DataTypeExact.Bytes8: //8 Bytes - return BitConverter.ToUInt64(p, 0).ToString(); - case DataTypeExact.Float: //Float - return BitConverter.ToSingle(p, 0).ToString(); - case DataTypeExact.Double: //Double - return BitConverter.ToDouble(p, 0).ToString(); - case DataTypeExact.Raw: //Raw Bytes - return Utilities.GetStringFromByteArray(p); - default: //Text - return System.Text.Encoding.Default.GetString(p); - } - } - - internal uint GetSearchMemorySize() - { - return GetSearchMemorySize(ThreadEventDispatcher.CurrentSelectedDataType); - } - - internal uint GetSearchMemorySize(DataTypeExact DataType) - { - switch (DataType) - { - case DataTypeExact.Bytes1: //1 Byte - return 1; - case DataTypeExact.Bytes2: //2 Bytes - return 2; - case DataTypeExact.Bytes4: //4 Bytes - return 4; - case DataTypeExact.Bytes8: //8 Bytes - return 8; - case DataTypeExact.Float: //Float - return (uint)BitConverter.GetBytes(float.MinValue).Length; - case DataTypeExact.Double: //Double - return (uint)BitConverter.GetBytes(double.MinValue).Length; - case DataTypeExact.Raw: //Raw Bytes - return (uint)Utilities.GetByteArrayFromByteString(SearchValue.Text).Length; - default: //Text - return (uint)System.Text.Encoding.Default.GetBytes(SearchValue.Text).Length; - } - } - - private void ResetButton_Click(object sender, EventArgs e) - { - ComboSearchType.Items.Clear(); - ComboSearchType.Items.AddRange(SearchTypeInitialTool.GetValues()); - ComboSearchType.SelectedIndex = 0; - LastSearchCriteria = null; - ResultsGrid.Rows.Clear(); - ControlEnabledSearchType = ControlEnabledMemoryRange = ControlEnabledDataType = true; - if (MemoryRange.SelectedIndex == MemoryRange.Items.Count - 1) - { - ControlEnabledStart = ControlEnabledSize = true; - } - - LabelLastSearch.Text = "Last Search\n"; - } - - private void MainForm_FormClosing(object sender, FormClosingEventArgs e) - { - NTRConnection.Disconnect(); - this.EventDispatcherThread.Abort(); - this.ButtonStateThread.Abort(); - Application.Exit(); - } - - private void ButtonAddResults_Click(object sender, EventArgs e) - { - foreach (DataGridViewRow Row in ResultsGrid.SelectedRows) - { - if (!IsInValues((string)Row.Cells[0].Value)) - { - int RowIndex = ValuesGrid.Rows.Add(); - ValuesGrid[0, RowIndex].Value = null; - ValuesGrid[3, RowIndex].Value = ComboDataType.Text; - ValuesGrid[1, RowIndex].Value = Row.Cells[0].Value; - ValuesGrid[2, RowIndex].Value = SearchValue.Text; - } - } - } - - private bool IsInValues(String Address) - { - for (int i = 0; i < ValuesGrid.RowCount; ++i) - { - if (((string)ValuesGrid[1, i].Value) == Address) - { - return true; - } - } - return false; - } - - private void ValuesGrid_CellValueChanged(object sender, DataGridViewCellEventArgs e) - { - if (e.RowIndex >= 0 && e.ColumnIndex == 2) - { - SetMemory(e.RowIndex); - } - } - - private void SetMemory(int RowIndex) - { - string TextAddress = (string)ValuesGrid[1, RowIndex].Value; - - MemoryDispatch MemoryDispatch = new MemoryDispatch(); - MemoryDispatch.Row = RowIndex; - MemoryDispatch.TextAddress = TextAddress; - MemoryDispatch.Type = DataTypeExactTool.GetValue((string)ValuesGrid[3, RowIndex].Value); - MemoryDispatch.Value = GetByteArrayForDataType(MemoryDispatch.Type, (string)ValuesGrid[2, RowIndex].Value); - - ThreadEventDispatcher.WriteAddress.Enqueue(MemoryDispatch); - } - - private byte[] GetByteArrayForDataType(DataTypeExact DataType, string Value) - { - switch (DataType) - { - case DataTypeExact.Bytes1: //1 Byte - return new byte[] { (byte)uint.Parse(Value) }; - case DataTypeExact.Bytes2: //2 Bytes - return BitConverter.GetBytes(ushort.Parse(Value)); - case DataTypeExact.Bytes4: //4 Bytes - return BitConverter.GetBytes(uint.Parse(Value)); - case DataTypeExact.Bytes8: //8 Bytes - return BitConverter.GetBytes(ulong.Parse(Value)); - case DataTypeExact.Float: //Float - return BitConverter.GetBytes(float.Parse(Value)); - case DataTypeExact.Double: //Double - return BitConverter.GetBytes(double.Parse(Value)); - case DataTypeExact.Raw: //Raw Bytes - return Utilities.GetByteArrayFromByteString(Value); - case DataTypeExact.Text: //Raw Bytes - default: - return System.Text.Encoding.Default.GetBytes(Value); - } - } - - private void ValuesGrid_CellClick(object sender, DataGridViewCellEventArgs e) - { - if (e.ColumnIndex == 0) - { - ValuesGrid.BeginEdit(true); - } - else if (e.ColumnIndex == 3) - { - ValuesGrid.BeginEdit(true); - ((ComboBox)ValuesGrid.EditingControl).DroppedDown = true; - } - } - - private void ValuesGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) - { - ValuesGrid.BeginEdit(true); - } - - private void ValuesGrid_CellLeave(object sender, DataGridViewCellEventArgs e) - { - ValuesGrid.EndEdit(); - } - - private void MemoryRange_SelectedIndexChanged(object sender, EventArgs e) - { - if (MemoryRange.SelectedIndex == 0) - { - this.MemoryStart.Text = this.MemorySize.Text = ""; - ControlEnabledStart = ControlEnabledSize = false; - } - else if (MemoryRange.SelectedIndex == MemoryRange.Items.Count - 1) - { - ControlEnabledStart = ControlEnabledSize = true; - } - else - { - string[] Parts = MemoryRange.Text.Split('|'); - this.MemoryStart.Text = Parts[0]; - this.MemorySize.Text = Parts[1]; - ControlEnabledStart = ControlEnabledSize = false; - } - } - - private void ButtonConnectDisconnect_Click(object sender, EventArgs e) - { - ButtonConnectDisconnect.Enabled = ControlEnabledButtonConnectDisconnect = false; - ThreadEventDispatcher.DispatchConnect = true; - } - - private void ButtonOpenProcess_Click(object sender, EventArgs e) - { - ButtonOpenProcess.Enabled = ControlEnabledButtonOpenProcess = false; - ThreadEventDispatcher.CurrentSelectedProcess = Processes.Text; - ThreadEventDispatcher.DispatchOpenProcess = true; - SaveButton.Enabled = true; - LoadButton.Enabled = true; - } - - private void ButtonRefreshMemoryRange_Click(object sender, EventArgs e) - { - ButtonRefreshMemoryRange.Enabled = ControlEnabledButtonRefreshMemoryRange = false; - ThreadEventDispatcher.CurrentSelectedProcess = Processes.Text; - ThreadEventDispatcher.DispatchOpenProcess = true; - } - - private void SearchButton_Click(object sender, EventArgs e) - { - MemoryStart.Text = MemoryStart.Text.PadLeft(8, '0'); - MemorySize.Text = MemorySize.Text.PadLeft(8, '0'); - uint StartAddress = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(MemoryStart.Text).Reverse().ToArray(), 0); - uint EndAddress = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(TextEndAddress.Text).Reverse().ToArray(), 0); - if (!MemoryRange.Text.Equals("All") && (!IsValidMemoryAddress(StartAddress) || !IsValidMemoryAddress(EndAddress))) - { - NTRConnection.SetCurrentOperationText = "Invalid start address or size!"; - return; - } - SearchButton.Enabled = ControlEnabledSearchButton = ControlEnabledDataType = ControlEnabledMemoryRange = false; - ThreadEventDispatcher.CurrentSelectedDataType = DataTypeExactTool.GetValue(ComboDataType.SelectedItem.ToString()); - ThreadEventDispatcher.CurrentSelectedSearchType = SearchTypeBaseTool.GetValue(ComboSearchType.SelectedItem.ToString()); - ThreadEventDispatcher.CurrentMemoryRange = this.MemoryRange.Text; - ThreadEventDispatcher.DispatchSearch = true; - } - - private void SaveButton_Click(object sender, EventArgs e) - { - SaveManager sm = new SaveManager(); - sm.Init(); - // Get a list of all saved addresses - foreach (DataGridViewRow row in ValuesGrid.Rows) - { - if (row.Cells[1].Value is GateSharkCode) - { - // @TODO This will be different. - } - else - { - sm.codes.Add(new SaveCode(DataTypeExactTool.GetValue(row.Cells[3].Value.ToString()), row.Cells[1].Value.ToString())); - } - } - - // Set the values - String[] parts_ = Processes.Text.Split('|'); - if (parts_.Length < 2) return; - String game = Config.ConfigFileDirectory + Path.DirectorySeparatorChar + parts_[1] + @".xml"; - sm.titleId = parts_[1]; - SaveManager.SaveToXml(game, sm); - MessageBox.Show(@"Saved selected addresses to '" + game + "'"); - } - - private void LoadButton_Click(object sender, EventArgs e) - { - String[] parts_ = Processes.Text.Split('|'); - if (parts_.Length < 2) return; - String game = Config.ConfigFileDirectory + Path.DirectorySeparatorChar + parts_[1] + @".xml"; - SaveManager sm = SaveManager.LoadFromXml(game); - if (sm.titleId != parts_[1]) - { - MessageBox.Show(@"Filename/TitleID Mismatch."); - } - else - { - foreach (SaveCode code in sm.codes) - { - if (!IsInValues(code.address)) - { - int RowIndex = ValuesGrid.Rows.Add(); - ValuesGrid[0, RowIndex].Value = null; - ValuesGrid[3, RowIndex].Value = DataTypeExactTool.GetKey(code.type); - ValuesGrid[1, RowIndex].Value = code.address; - - // Read the memory - RefreshMemory(RowIndex); - } - } - } - } - - private void RefreshMemory(int RowIndex) - { - ThreadEventDispatcher.CurrentSelectedProcess = Processes.Text.Split('|')[0]; - MemoryDispatch MemoryDispatch = new MemoryDispatch(); - MemoryDispatch.Row = RowIndex; - MemoryDispatch.TextAddress = (string)ValuesGrid[1, RowIndex].Value; - MemoryDispatch.Type = DataTypeExactTool.GetValue((string)ValuesGrid[3, RowIndex].Value); - ThreadEventDispatcher.RefreshValueAddresses.Enqueue(MemoryDispatch); - } - - private void ComboSearchType_SelectedValueChanged(object sender, EventArgs e) - { - string CurrentDataType = ComboDataType.SelectedItem == null ? null : ComboDataType.SelectedItem.ToString(); - switch (SearchTypeBaseTool.GetValue(ComboSearchType.SelectedItem.ToString())) - { - case SearchTypeBase.Exact: - ComboDataType.Items.Clear(); - ComboDataType.Items.AddRange(DataTypeExactTool.GetValues()); - SearchValue.Width = 286; - SearchValue2.Visible = LabelDash.Visible = false; - break; - case SearchTypeBase.Range: - ComboDataType.Items.Clear(); - ComboDataType.Items.AddRange(DataTypeNumericTool.GetValues()); - SearchValue.Width = 136; - SearchValue2.Visible = LabelDash.Visible = true; - break; - case SearchTypeBase.IncreasedBy: - case SearchTypeBase.DecreasedBy: - case SearchTypeBase.Increased: - case SearchTypeBase.Decreased: - case SearchTypeBase.Unknown: - ComboDataType.Items.Clear(); - ComboDataType.Items.AddRange(DataTypeNumericTool.GetValues()); - SearchValue.Width = 286; - SearchValue2.Visible = LabelDash.Visible = false; - break; - } - if (CurrentDataType != null && ComboDataType.Items.Contains(CurrentDataType)) - { - ComboDataType.SelectedIndex = ComboDataType.Items.IndexOf(CurrentDataType); - ComboDataType.SelectedItem = ComboDataType.SelectedValue = CurrentDataType; - } - else - { - ComboDataType.SelectedIndex = 0; - ComboDataType.SelectedItem = ComboDataType.SelectedValue = ComboDataType.Items[0]; - } - } - - private void ComboDataType_SelectedValueChanged(object sender, EventArgs e) - { - string CurrentSearchType = ComboSearchType.SelectedItem == null ? null : ComboSearchType.SelectedItem.ToString(); - if (LastSearchCriteria == null) - { - ComboSearchType.Items.Clear(); - ComboSearchType.Items.AddRange(SearchTypeInitialTool.GetValues()); - } - else - { - switch (DataTypeExactTool.GetValue(ComboDataType.SelectedItem.ToString())) - { - case DataTypeExact.Bytes1: - case DataTypeExact.Bytes2: - case DataTypeExact.Bytes4: - case DataTypeExact.Bytes8: - case DataTypeExact.Float: - case DataTypeExact.Double: - ComboSearchType.Items.Clear(); - ComboSearchType.Items.AddRange(SearchTypeNumericTool.GetValues()); - break; - case DataTypeExact.Raw: - case DataTypeExact.Text: - ComboSearchType.Items.Clear(); - ComboSearchType.Items.AddRange(SearchTypeTextTool.GetValues()); - break; - } - } - if (CurrentSearchType != null && ComboSearchType.Items.Contains(CurrentSearchType)) - { - ComboSearchType.SelectedIndex = ComboSearchType.Items.IndexOf(CurrentSearchType); - ComboSearchType.SelectedItem = ComboSearchType.SelectedValue = CurrentSearchType; - } - else - { - ComboSearchType.SelectedIndex = 0; - ComboSearchType.SelectedItem = ComboSearchType.SelectedValue = ComboSearchType.Items[0]; - } - } - - private void PopulateComboBox(Type enumType, ComboBox box) - { - box.Items.Clear(); - box.Items.AddRange(Enum.GetNames(enumType)); - } - - private void ValuesGridContextMenuStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e) - { - switch (e.ClickedItem.Name) - { - case "ValuesGridCopyResolvedAddress": - foreach (DataGridViewCell Cell in ValuesGrid.SelectedCells) - { - Clipboard.SetText(Cell.OwningRow.Cells[1].ToolTipText); - break; - } - break; - case "ValuesGridPointerSearch": - foreach (DataGridViewCell Cell in ValuesGrid.SelectedCells) - { - PointerSearchRow = Cell.OwningRow.Index; - ThreadEventDispatcher.CurrentSelectedProcess = Processes.Text.Split('|')[0]; - ThreadEventDispatcher.DispatchPointerSearch = (string)Cell.OwningRow.Cells[1].Value; - break; - } - break; - case "ValuesGridDeleteItem": - foreach (DataGridViewCell Cell in ValuesGrid.SelectedCells) - { - ValuesGrid.Rows.Remove(Cell.OwningRow); - } - break; - case "ValuesGridAddItem": - ValuesGrid.Rows.Add(); - break; - case "ValuesGridConvertCode": - foreach (DataGridViewCell Cell in ValuesGrid.SelectedCells) - { - Cell.OwningRow.Cells[1].Value = ConvertCode((string)Cell.OwningRow.Cells[1].Value); - } - break; - case "ValuesGridRefreshItem": - foreach (DataGridViewCell Cell in ValuesGrid.SelectedCells) - { - RefreshMemory(Cell.RowIndex); - } - break; - } - } - - private string ConvertCode(string Address) - { - uint OriginalCodeAddress = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Address).Reverse().ToArray(), 0); - uint ConvertedMemoryAddress = OriginalCodeAddress + 0x14000000u; //High memory region - if (IsValidMemoryAddress(ConvertedMemoryAddress)) - { - return Utilities.GetStringFromByteArray(BitConverter.GetBytes(ConvertedMemoryAddress).Reverse().ToArray()); - } - uint ConversionModifier = GetConversionModifier(ConvertedMemoryAddress); - if (ConversionModifier == 0) - { - return Address; - } - uint Offset = ConvertedMemoryAddress - ConversionModifier; - ConvertedMemoryAddress = 0x08000000 + Offset; - if (IsValidMemoryAddress(ConvertedMemoryAddress)) - { - return Utilities.GetStringFromByteArray(BitConverter.GetBytes(ConvertedMemoryAddress).Reverse().ToArray()); - } - ConvertedMemoryAddress = 0x00100000 + Offset; - if (IsValidMemoryAddress(ConvertedMemoryAddress)) - { - return Utilities.GetStringFromByteArray(BitConverter.GetBytes(ConvertedMemoryAddress).Reverse().ToArray()); - } - return Address; - } - - internal bool IsValidMemoryAddress(uint Address) - { - return GetAddressSpaceForAddress(Address) != null; - } - - internal Nullable> GetAddressSpaceForAddress(uint Address) - { - foreach (uint RangeStart in NTRConnection.AddressSpaces.Keys) - { - if (Address >= RangeStart && Address <= (RangeStart + NTRConnection.AddressSpaces[RangeStart])) - { - return new KeyValuePair(RangeStart, NTRConnection.AddressSpaces[RangeStart]); - } - } - return null; - } - - private uint GetConversionModifier(uint Address) - { - uint[] Keys = NTRConnection.AddressSpaces.Keys.ToArray(); - Array.Sort(Keys); - foreach (uint RangeStart in Keys.Reverse()) - { - if (RangeStart <= Address) - { - //This is ugly. - return BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Utilities.GetStringFromByteArray(BitConverter.GetBytes(RangeStart + NTRConnection.AddressSpaces[RangeStart]).Reverse().ToArray()).Substring(0, 3).PadRight(8, '0')).Reverse().ToArray(), 0) + 0x00100000u; - } - } - return 0; - } - - private void ButtonConfig_Click(object sender, EventArgs e) - { - ThreadEventDispatcher.DispatchConfig = true; - } - - private void Memory_TextChanged(object sender, EventArgs e) - { - if (!string.IsNullOrWhiteSpace(MemoryStart.Text) && !string.IsNullOrWhiteSpace(MemorySize.Text)) - { - string Start = MemoryStart.Text.PadLeft(8, '0'); - string Size = MemorySize.Text.PadLeft(8, '0'); - uint StartInt = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Start).Reverse().ToArray(), 0); - uint SizeInt = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Size).Reverse().ToArray(), 0); - uint EndInt = StartInt + SizeInt; - string End = Utilities.GetStringFromByteArray(BitConverter.GetBytes(EndInt).Reverse().ToArray()); - TextEndAddress.Text = End; - } - else - { - TextEndAddress.Text = ""; - } - } - } -} diff --git a/tmp/NTRDebuggerTool/Forms/MainForm.resx b/tmp/NTRDebuggerTool/Forms/MainForm.resx deleted file mode 100644 index caaea75..0000000 --- a/tmp/NTRDebuggerTool/Forms/MainForm.resx +++ /dev/null @@ -1,314 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - True - - - True - - - True - - - True - - - True - - - 335, 17 - - - 17, 17 - - - 192, 17 - - - - - AAABAAEAMDAAAAEAIACoJQAAFgAAACgAAAAwAAAAYAAAAAEAIAAAAAAAAEgAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUULPz8/DEVFRQsAAAABAAAAAAAA - AAAAAAABcllMFHJbT0NxW05+b1pNtG9bTtduWk3vclxO/nNdT/9zXU//c11P/nFdT+5xXU/VcVxNsW5Z - TYNoV01MXVVMHgAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUULPz8/DEVFRQsAAAABAAAAAEdH - Rz1FRUVjVVVVAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABOjo6DURE - RA86OjoNf19fCHVbTDJzXU+AcltOxnNbTe9xW039c11P/3BbTf9wW07/cFtN/3NdT/9zXU//c11P/3Nd - T/9zXU//c11P/3FbTf1uWkzwblpNyWxZTIZ1XU40f1VVBgAAAAAAAAAAAAAAAAAAAAB/f38COjo6DURE - RA86OjoNREREPEJCQvlGRkb/REREuT8/PxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAf39/AkZGRhJoVktHblpMpHNdT+hzXU/+c11P/3NdT/9zXU//c11P/3NdT/9wW03/cFtO/3Bb - Tf9zXU//c11P/3NdT/9zXU//c11P/3NdT/9zXU//cFtN/3BbTv5uWkzpclxOoHJdUDxmZmYFAAAAAAAA - AAAAAAAAf39/Ajo6Og1FRUUsRERE5EZGRsxGRkb/RkZG/0VFRZsAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAb19PIHFcTY1uW0zqcFtO/3BbTf9zXU//c11P/3NdT/9zXU//c11P/3Nd - T/9zXU//cFtN/3BbTv9wW03/c11P/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3BbTf9wW07/cFtN/3Fd - TelyXE6Mb19PIAAAAAAAAAAAAAAAAEhISA5CQkLTRERExURERORERES+RkZG/0ZGRnAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH9/fwJxXU9Kc1xNzHNdT/5zXU//cFtN/3BbTv9wW03/c11P/3Nd - T/9zXU//c11P/3NdT/9zXU//c11P/3BbTf9wW07/cFtN/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3Nd - T/9wW03/cFtO/3BbTf9zXU/+c1xNzHFdT0p/f38CAAAAAUVFRa9GRkb/QkJC/ERERLZEREToQ0NDpgAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABVVVUDcVQ4CXJbTm9xXU3pc11P/3NdT/9zXU//c11P/3Bb - Tf9wW07/cFtN/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3NdT/9wW03/cFtO/3BbTf9zXU//c11P/3Nd - T/9zXU//c11P/3NdT/9zXU//cFtN/3BbTv9wW03/c11P/3FdTelyW05vRkREikZGRv9GRkb/RkZG/0ZG - Rv9ERETGPDw8FX9/fwIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABtW0gOb1pMgnFaTvVzXU//c11P/3Nd - T/9zXU//c11P/3NdT/9wW03/cFtO/3BbTf9zXU//c11P/3NdT/9zXU//c11P/3NdT/9zXU//cFtN/3Bb - Tv9wW03/c11P/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3BbTf9wW07/cFtN/3NdT/9hUkr5RkZG/0ZG - Rv9GRkb/RkZG/0VFReVDQ0MmREREDzo6Og0AAAAAAAAAAAAAAAAAAAAAAAAAAH9fPwhyXE+BcFxN+XFc - Tv9yXE7/c11P/3NdT/9zXU//c11P/3NdT/9zXU//cFtN/3BbTv9wW03/c11P/3NdT/9zXU//c11P/3Nd - T/9zXU//c11P/3BbTf9wW07/cFtN/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3NdT/9wW03/cFtO/2lY - Tf9HRkb/RkZG/0ZGRv9GRkb/RUVF9kRERDR/f38COjo6DURERA8AAAAAAAAAAAAAAAAAAAAAf39/AnJb - Tm9yW0/1cVxO/3BbTv9xW07/clxN/3FbTf9zXE7/c11P/3NdT/9zXU//c11P/3BbTf9wW07/cVxO/3Re - UP9xW03/c1xO/3NdT/9zXU//c11P/3NdT/9wW03/cFtO/3BbTf9zXU//c11P/3NdT/9zXU//c11P/3Nd - T/9zXU//cFtN/2JUS/9GRkb/RkZG/0ZGRv9GRkb/RUVFWAAAAAAAAAAAf39/Ajo6Og0AAAAAAAAAAAAA - AAAAAAAAcV1PSnFdTelzXU//clxO/3BbTf+AbmP/rqSc/5aGfP96ZFf/cVtN/3NdT/9zXU//c11P/3Nd - T/9vWkz/nY+G/8K7tv+fj4b/eGNW/3FbTf9zXU//c11P/3NdT/9zXU//cFtN/3BbTv9wW03/c11P/3Nd - T/9zXU//c11P/3NdT/9zXU//cVxP/09KR/9GRkb/RkZG/0ZGRv9ZUEn0cV1PSgAAAAAAAAAAAAAAAH9/ - fwIAAAAAAAAAAAAAAABvX08gc1tPy3NdT/9zXU//c11P/3FbTf9+bF//3dnW/+/t7f/Vzsr/n4+G/3hj - Vv9xW03/c11P/3NdT/9xW03/o5eO//Py8v/v7u7/0MnE/5eGfP91YFL/cVtN/3NdT/9zXU//c11P/3Bb - Tf9wW07/cFtN/3NdT/9zXU//c11P/3NdT/9yXE7/VE1I/0ZGRv9GRkb/VE1H/2FTS/9yXE7/c1tPy29f - TyAAAAAAAAAAAAAAAAAAAAAAAAAAAFVVVQNyXE6Mc11P/3NdT/9zXU//c11P/3NdT/9yXE7/tqym//T0 - 9P/09PT/+Pj3/9PMyP+VhHr/dF5Q/3JcTv9yXE7/gW5i/93Z1v/09PT/9PT0//Ty8f/Iv7n/jn1y/3Re - UP9yW03/c11P/3NdT/9wW03/cFtO/3BbTf9zXU//c11P/3NdT/9ZT0n/RkZG/0ZGRv9UTUj/b1pN/3Bb - Tv9wW03/c11P/3JcToxVVVUDAAAAAAAAAAAAAAAAAAAAAHJdUDxzXU/oc11P/3NdT/9zXU//c11P/3Nd - T/9yW03/i3pv/+Xi4f/09PT/6uno/9TOyf/a1ND/uK2m/35pXP9yW03/clxO/7itpv/09PT/9PT0//T0 - 9P/9/f3/8O7s/76zrf+HdWn/clxO/3JcTv9zXU//cFtN/3BbTv9wW03/c11P/2BTS/9GRkb/RkZG/09J - Rv9xXE7/c11P/3BbTf9wW07/cFtN/3NdT+hyXVA8AAAAAAAAAAAAAAAAZmZmBXNdTp9zXU//c11P/3Nd - T/9zXU//c11P/3NdT/9zXU//dF5Q/7+1rv/z8vL/ppqT/3FdT/+HdWn/0crF/9XOyv+OfHD/cFpL/4x6 - b//v7Ov/9PT0//T09P/09PT//f39//7+/v/q5+X/saWd/31pXP9yXE3/c11P/3BbTf9wW07/Y1RL/0ND - Q/9GRkb/SkZE/29bTv9zXU//c11P/3NdT/9wW03/cFtO/3BbTf9yXE6gZmZmBQAAAAAAAAAAc19QM3Fb - T+dzXU//c11P/3NdT/9zXU//c11P/3NdT/9zXU//cltN/4l2a//j39z/kYJ3/21YS/9vWkz/fWlc/7+1 - rv/i3tv/kIJ5/2FUTP92c3H/cnJy/2ZmZv9lZWX/d3d3/5iYmP/Gxsb/9/b2/9fQzP+Jd2v/clxO/3Nd - T/9nVkz/RkVF/0ZGRv9IR0X/bFlN/3NdT/9zXU//c11P/3NdT/9zXU//cFtN/3BbTv9tWkzoc2BRNQAA - AAAAAAAAc11PgHNdT/9zXU//c11P/3NdT/9yXE//clxO/3NdT/9zXU//c11P/3JcTv+toJj/z8fD/3to - XP91YlX/g3Fl/2hYT/9dWlf/RkZG/0ZGRv9GRkb/RkZG/0ZGRv9GRkb/RkZG/0ZGRv9GRkb/T09P/5iY - mP/Iwr7/fGda/2xZTf9IRkX/RkZG/0ZFRf9nV0z/c11P/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3Bb - Tf9wW07/bFlMhn9/fwJtYVQVc11NxXNdT/9zXU//c11P/3NdT/9yXE//cVxO/3JcTv9zXU//c11P/3Jc - Tv96ZVj/0MnE/8S7tf9wXlP/XFhV/0ZGRv9GRkb/RkZG/0dHRv9TTUr/cGtn/4WBfv+JhYT/fHt6/11d - Xf9GRkb/RkZG/0ZGRv9NTU3/cWhi/0tHRf9GRkb/Q0ND/2NUS/9wW07/cFtN/3NdT/9zXU//c11P/3Nd - T/9zXU//c11P/3NdT/9wW03/blpMyFRNTSFyW09DcV1P7nNdT/9zXU//c11P/3NdT/9yXE//clxP/3Fc - Tv9yXE7/clxN/3NdT/9yW03/i3lu/8C9u/9OTEz/RkZG/0ZGRv9fXVz/a11U/25ZSv9zXU//emVY/3pl - WP94YlX/f2xf/5GCd/+km5b/hoSE/0tLS/9GRkb/RkZG/0ZGRv9GRkb/X1JK/3NdT/9wW03/cFtO/3Bb - Tf9zXU//c11P/3NdT/9zXU//c11P/3NdT/9zXU//bVpM72hUS05yXU99cVtN/XNdT/9zXU//c11P/3Nd - T/9zXU//cVxO/3BbTv91YFT/h3Zq/3lkVv9xW03/Z1ZK/0hIR/9GRkb/R0ZG/2hcVP/Ox8T/0MvH/4x7 - cP9yXE7/mop//83Gwf/Iv7n/q56V/4t6b/90YFP/e2hc/5iNhv9sa2v/RkZG/0ZGRv9MSUf/clxO/3Nd - T/9zXU//cFtN/3BbTv9wW03/c11P/3NdT/9zXU//c11P/3NdT/9zXU//cVtN/WxYS4RzXU+xc11P/3Nd - T/9zXU//c11P/3NdT/9zXU//clxO/29aTP+JeGz/39vZ/9TNyf+ZjYX/SUdG/0ZGRv9OTUz/t7Cs/3di - VP+Id2z/4N3b/+He3P+fkIb/dmFT/5+Qh//p5uT///////Ty8f/Uzcn/nY+G/3ZjVf9+a2D/XlZR/0ZG - Rv9GRkb/WE9J/3NdT/9zXU//c11P/3BbTf9wW07/cFtN/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3Jd - TrJxXU/Vc11P/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3FbTf99al3/2dTS//T09P91dXX/RkZG/0xM - S/99bWP/kX90/3diVP9xW03/mYuD/+ro5//s6un/tami/3lkV/+KeGz/1tDM//7+/v//////+vn5/87I - xP+OfnT/bllL/1RMR/9GRkb/RkZG/2ZWTP9zXU//c11P/3NdT/9wW03/cFtO/3BbTf9zXU//c11P/3Nd - T/9zXU//c11P/3FdT9VxXU/uc11P/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3NdT/9xW03/qJuU/7y7 - u/9GRkb/RkZG/8HBwP/r5+X/taqi/3lkVv99aFv/dmFT/66jnP/x8fD/8vLx/8zEv/+EcGT/gW1g/97Z - 1f////////////39/f/l4+H/opSM/29bT/9MSUf/RkZG/01JR/9yXE//c11P/3NdT/9zXU//cFtN/3Bb - Tv9wW03/c11P/3NdT/9zXU//c11P/3FdT+5zXU/+c11P/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3Nd - T/9yXE7/fmpd/2NiYf9GRkb/cnJy//39/f//////7Onn/4NwZP+gkYj/oJGI/3lkVv/DvLf/9PT0//T0 - 9P/X0c3/e2ZZ/66hmf/////////////////9/f3/7ezr/6eblP9jVUv/RkZG/0ZGRv9kVUz/c11P/3Nd - T/9zXU//c11P/3BbTf9wW07/cFtN/3NdT/9zXU//c11P/3NdT/5zXU//c11P/3NdT/9zXU//c11P/3Nd - T/9zXU//c11P/3NdT/9zXU//aVdL/0ZGRv9GRkb/xsbG//T09P/9/f3/9PLx/4x6b/+aioD/5uLg/458 - cP+Bb2L/1dDO//T09P/u7ez/koF3/5OCeP/39vX//////////////////f39/+vp6P+cjoX/S0dF/0ZG - Rv9SS0f/c11P/3NdT/9zXU//c11P/3NdT/9wW03/cFtO/3BbTf9zXU//c11P/3NdT/9zXU//c11P/3Nd - T/9zXU//c11P/3NdT/9zXU//c11P/3NdT/9zXU//XVFK/0ZGRv9TUlL/8/Pz//T09P/09PT/+/v7/56P - hf+HdGj/8O7t/9nTz/9/al3/inlt/762sP/RzMj/kYF2/4t6bv/08vH///////////////////////39 - /f/g3Nr/aF9Z/0ZGRv9HRkb/cVxO/3NdT/9zXU//c11P/3NdT/9zXU//cFtN/3BbTv9wW03/c11P/3Nd - T/9zXU/+c11P/3NdT/9zXU//c11P/3NdT/9yXE//clxO/3NdT/9zXU//VE1I/0ZGRv9jXVn/9vX0//T0 - 9P/09PT/9PT0/7mup/94Y1b/29XS///////Kwbz/h3Ro/3ZhU/91YVT/cl1R/6KVjf/7+vr//f38//Ty - 8f/5+Pf////////////9/f3/qqSg/0ZGRv9GRkb/aFdM/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3Bb - Tf9wW07/cFtN/3NdT/5xXU/uc11P/3NdT/9zXU//c11P/3NdT/9yXE//cVxO/3JcTv9zXU//TEhF/0ZG - Rv9eU03/y8O+//39/f/09PT/9PT0/9DLyP95Y1b/t6uk///////+/v7/7ero/9PMyP/Bt7H/wLiz/+Xk - 4v/e2tj/p5mR/458cf+YiH7/zcXA//z7+///////7ezs/0ZGRv9GRkb/YVNL/3NdT/9zXU//c11P/3Nd - T/9zXU//c11P/3NdT/9wW03/cFtO/21aTO9xXU/Vc11P/3NdT/9zXU//c11P/3NdT/9yXE//clxP/3Fc - Tv9yXE7/SkdF/0ZGRv9eUkr/kYB1//Hv7v/9/f3/9PT0/+ro5/+MfHH/i3lu//Hv7f////////////// - /////////f39/+jm5f+Rgnf/bVhL/3FbTf9xWkz/e2ZZ/9LLx////////////0RERP9GRkb/XVFJ/3Bb - Tf9zXU//c11P/3NdT/9zXU//c11P/3NdT/9zXU//cFtN/25bTtdzXU+xc11P/3NdT/9zXU//c11P/3Nd - T/9zXU//cVxO/3BbTv9xW07/SkZE/0ZGRv9fUkv/dF5Q/7uxqv/+/v7//f39//T09P+5sKr/cV5Q/8S7 - tf///////////////////////////9PNyP9zX1H/cFtO/3BbTf9zXU//cFpM/6aYj//+/f3//f39/0ZG - Rv9GRkb/XlFJ/3BbTv9wW03/c11P/3NdT/9zXU//c11P/3NdT/9zXU//c11P/21aTbVyXU99cVtN/XNd - T/9zXU//c11P/3NdT/9zXU//clxO/3FcTv9wW07/TklG/0ZGRv9aUEn/clxO/39rX//Sy8f//v7+//39 - /f/m4+L/iHht/4Z0av/q5+X//////////////////////87Hwv90XlD/cFtN/3BbTv9wW03/cFpM/6GS - if/8/Pz/6enp/0ZGRv9GRkb/ZVZM/3BbTf9wW07/cFtN/3NdT/9zXU//c11P/3NdT/9zXU//cVtN/XFd - Tn5yW09DcV1P7nNdT/9zXU//c11P/3NdT/9zXU//c11P/3JcTv9xW07/Vk1I/0ZGRv9QS0f/c11P/3Jc - Tv+AbF//saSc/9HKxf/c19T/qJuU/3BbTv+ilY3/9/b1/////////////////+rn5f+IdWn/cVpM/29a - TP9vWk3/cVxO/8K4sv//////xcXF/0ZGRv9GRkb/eGdc/3JcTv9wW03/cFtO/3BbTf9zXU//c11P/3Nd - T/9zXU//cV1P7nJbT0NtYVQVc11NxXNdT/9zXU//c11P/3NdT/9zXU//c11P/3NdT/9yXE7/YFNL/0ZG - Rv9EQ0P/b1pN/3NdT/9yXE7/clxN/3RfUf95ZFf/eWRW/3BbTf9zXlH/raOb//j39/////////////// - ///RycX/jXtv/3tnWf9+a1//rKGZ/+ro5//p5uP/h4aF/0ZGRv9XV1f/l4d8/3FbTf9zXU//cFtN/3Bb - Tv9wW03/c11P/3NdT/9zXU//c11NxW1hVBUAAAAAc11PgHNdT/9zXU//c11P/3NdT/9zXU//c11P/3Nd - T/9zXU//cFtO/0RDQ/9GRkb/XVFK/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3NdT/9vWkz/c19S/6qf - l//z8vH////////////+/v7/8O7s/+Db2P/n4+H/8/Ly/8fBvP96aF3/RkVE/0ZGRv+UlJT/sKSc/3Fb - TP9zXU//c11P/3BbTf9wW07/cFtN/3NdT/9zXU//c11PgAAAAAAAAAAAc19QM3FbT+dzXU//c11P/3Nd - T/9zXU//c11P/3NdT/9zXU//c11P/1VNSP9GRkb/SEZF/21aTf9zXU//c11P/3NdT/9zXU//c11P/3Nd - T/9zXU//cFpM/3FcT/+YioH/49/c//7+/v///////////////////////f39/62imv9XTEb/RkZG/0ZG - Rv/e3t7/w7q0/3NdT/9zXU//c11P/3NdT/9wW03/cFtO/3BbTf9xW0/nc19QMwAAAAAAAAAAZmZmBXNd - Tp9zXU//c11P/3NdT/9zXU//c11P/3NdT/9zXU//c11P/2xZTf9EQ0P/RkZG/1RNR/9wW03/c11P/3Nd - T/9zXU//c11P/3NdT/9zXU//c11P/3BbTf9vWUz/gW5i/760rv/w7u3//////////////////////766 - uP9GRkb/RkZG/3l4d//9/f3/zsbB/3ZgUv9zXU//c11P/3NdT/9zXU//cFtN/3BbTv9uWkykbW1tBwAA - AAAAAAAAAAAAAHJdUDxzXU/oc11P/3NdT/9yXE//clxO/3NdT/9zXU//c11P/3NdT/9cUUr/RkZG/0ZG - Rv9cUUr/cFtN/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3NdT/9wW03/b1pN/3FcTv+NfHD/wbex/+vn - 5f/9/Pz/6Ojo/1dXV/9GRkb/UFBQ/+Hh4f/09PT/zsfC/3ZgU/9zXU//c11P/3NdT/9zXU//c11P/25a - TOloVktHOjo6DX9/fwIAAAAAAAAAAFVVVQNyXE6Mc11P/3NdT/9yXE//cVxO/3JcTv9zXU//c11P/3Nd - T/9yXE//UUtH/0ZGRv9GRkb/WlBJ/3BbTv9zXU//c11P/3NdT/9zXU//c11P/3NdT/9zXU//cFtN/3Bb - Tv9vWUz/dF5Q/4VyZv+TiID/UlFR/0ZGRv9FRUX/xMPC//Hx8f/x8PD/u7Gr/3ReUP9zXU//c11P/3Nd - T/9zXU//c11P/3FcTY0/Pz8QREREDzo6Og0AAAAAAAAAAAAAAABvX08gc1tPy3NdT/9yXE//clxP/3Fc - Tv9yXE7/c11P/3NdT/9zXU//cFtO/05JRv9GRkb/RkZG/09KR/9oV0z/c11P/3NdT/9zXU//c11P/3Nd - T/9zXU//c11P/3BbTf9wW07/blpN/1tQSf9EQ0P/RkZG/0NDQ/9wZF3/l4Z8/5+Qhv+Vhnz/fWtf/3Bb - TP9zXU//c11P/3NdT/9zXU//c1tPy29fTyB/f38COjo6DURERA8AAAAAAAAAAAAAAAAAAAAAcV1PSnFd - TelzXU//cVxO/3BbTv9xW07/c11P/3NdT/9zXU//c11P/3FcTv9TTEf/RkZG/0ZGRv9GRkb/UUtH/2JU - S/9tWk3/c11P/3NdT/9zXU//cVtO/2dWTP9YT0n/SEZF/0ZGRv9GRkb/R0ZF/2RVS/9yW03/cVtN/3Fb - Tf9xW03/b1pM/3BbTv9wW03/c11P/3NdT/9xXU3pcV1PSgAAAAAAAAAAf39/Ajo6Og0AAAAAAAAAAAAA - AAAAAAAAf39/AnJbTm9yW0/1clxO/3FcTv9wW07/cFtN/3NdT/9zXU//c11P/3NdT/9zXU//YlRL/0hG - Rf9GRkb/RkZG/0ZGRv9GRkb/RERD/0hGRf9IRkX/RkZG/0ZGRv9GRkb/RkZG/0ZGRv9TTEj/bVlN/3Nd - T/9zXU//c11P/3NdT/9zXU//c11P/3BbTf9wW07/cFtN/3JbT/VyW05vf39/AgAAAAAAAAAAAAAAAH9/ - fwIAAAAAAAAAAAAAAAAAAAAAAAAAAH9fPwhzXU+AcV1N+XJcTv9xW07/cFtO/3FbTv9yXE7/c11P/3Nd - T/9zXU//c11P/3FcTv9gU0r/TUlG/0ZGRv9GRkb/RkZG/0ZGRv9GRkb/RkZG/0ZGRv9IR0b/Vk5I/2hX - TP9wW07/cVtO/3JcTv9zXU//c11P/3NdT/9zXU//c11P/3JcTv9xW07/bltM+W9aToVxVDgJAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABzXEULc11PgHJbT/VyXE7/cVxO/3Bb - Tv9xXE7/clxO/3NdT/9zXU//c11P/3NdT/9zXU//clxO/25aTv9lVkz/X1JK/11RSv9fUkv/YlRL/2pY - TP9zXU//c11P/3JcTv9xXE7/cFtO/3FcTv9yXE7/c11P/3NdT/9zXU//c11P/3NdT/9xWk71blpNhFlM - PxQ/Pz8IAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf18/CHJb - Tm9xXU3pclxO/3FcTv9yXE//cVxO/3JcTv9zXU//c11P/3NdT/9zXU//c11P/3JcTv9xXE7/clxP/3Fc - Tv9yXE7/c11P/3NdT/9zXU//c11P/3NdT/9yXE7/cVxO/3JcT/9xXE7/clxO/3NdT/9zXU//c11P/3Fd - TelyW05vcVQ4CTMzMwVVVVUGMzMzBQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAH9/fwJxXU9Kc1xNzHNdT/5yXE//clxP/3JcT/9zXU//c11P/3NdT/9zXU//c11P/3Nd - T/9zXU//clxP/3JcT/9yXE//c11P/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3JcT/9yXE//clxP/3Nd - T/9zXU/+c1xNzHFdT0p/f38CAAAAAAAAAABVVVUDVVVVA1VVVQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAb19PIHJcToxxXU3pc11P/3NdT/9zXU//c11P/3Nd - T/9zXU//c11P/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3Nd - T/9zXU//c11P/3FdTelyXE6Mb19PIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGZmZgVyXVA8c11On3Nd - T+hzXU/+c11P/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3Nd - T/9zXU//c11P/3NdT/5zXU/oc11On3JdUDxmZmYFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAf1VVBnVbTDJzXU+AcltOxnNbTe9xW039c11P/3NdT/9zXU//c11P/3NdT/9zXU//c11P/3Nd - T/9zXU//c11P/3FbTf1zW03vcltOxnNdT4B1W0wyf1VVBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABcllMFHJbT0NyXU99c11PsXFdT9VxXU/uc11P/nNd - T/9zXU//c11P/nFdT+5xXU/Vc11PsXJdT31yW09DcllMFAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//+AD//8AAP/+AAB/8QAA//gAAB/g - AAD/4AAAB8EAAP/AAAADgQAA/4AAAAEDAAD+AAAAAAcAAPwAAAAADwAA/AAAAAAfAAD4AAAAAB8AAPAA - AAAADwAA4AAAAAAHAADgAAAAAAcAAMAAAAAAAwAAwAAAAAADAACAAAAAAAEAAIAAAAAAAQAAgAAAAAAB - AACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAABAACAAAAAAAEAAIAAAAAAAQAAgAAAAAAB - AADAAAAAAAMAAMAAAAAAAwAA4AAAAAAHAADgAAAAAAcAAPAAAAAADwAA+AAAAAAfAAD8AAAAAD8AAPwA - AAAAPwAA/gAAAAB/AAD/gAAAAf8AAP/AAAAD/wAA/+AAAAf/AAD/+AAAH/8AAP/+AAB//wAA///gB/// - AAA= - - - \ No newline at end of file diff --git a/tmp/NTRDebuggerTool/Forms/MainFormThreadButtonState.cs b/tmp/NTRDebuggerTool/Forms/MainFormThreadButtonState.cs deleted file mode 100644 index 5e49ebd..0000000 --- a/tmp/NTRDebuggerTool/Forms/MainFormThreadButtonState.cs +++ /dev/null @@ -1,91 +0,0 @@ -using NTRDebuggerTool.Forms.FormEnums; -using NTRDebuggerTool.Objects; -using System; -using System.Threading; -namespace NTRDebuggerTool.Forms -{ - class MainFormThreadButtonState - { - private const uint BUTTON_STATES_START = 0x0010C0B5; - private const uint BUTTON_STATES_SIZE = 0x00000027; - - private const int Offset_Button = 0x23, Offset_Shoulder = 0x24, Offset_Stick = 0x26, Offset_Horiz = 0x00, Offset_Vert = 0x02; - - public ButtonState ButtonState; - public ShoulderState ShoulderState; - public StickState StickState; - public byte StickHoriz; - public byte StickVert; - private MainForm Form; - - public MainFormThreadButtonState(MainForm Form) - { - // TODO: Complete member initialization - this.Form = Form; - } - - internal void ThreadButtonState() - { - int LastSearchTime = Config.ButtonStateUpdateInterval; - while (true) - { - if (Form.NTRConnection.HardwarePID != null) - { - SearchCriteria Criteria = new SearchCriteria(); - Criteria.ProcessID = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Form.NTRConnection.HardwarePID), 0); - Criteria.DataType = DataTypeExact.Bytes1; - Criteria.StartAddress = BUTTON_STATES_START; - Criteria.Length = BUTTON_STATES_SIZE; - Criteria.SearchType = SearchTypeBase.Unknown; - Criteria.SearchValue = new byte[] { 0 }; - Criteria.Size = 1; - Criteria.HideSearch = true; - Form.NTRConnection.SearchCriteria.Add(Criteria); - - Form.NTRConnection.SendReadMemoryPacket(Criteria); - - ButtonState = (ButtonState)Criteria.AddressesFound[BUTTON_STATES_START + Offset_Button][0]; - ShoulderState = (ShoulderState)Criteria.AddressesFound[BUTTON_STATES_START + Offset_Shoulder][0]; - StickState = (StickState)Criteria.AddressesFound[BUTTON_STATES_START + Offset_Stick][0]; - StickHoriz = Criteria.AddressesFound[BUTTON_STATES_START + Offset_Horiz][0]; - StickVert = Criteria.AddressesFound[BUTTON_STATES_START + Offset_Vert][0]; - - LastSearchTime = Math.Max(LastSearchTime, (int)Criteria.Duration); - - Form.NTRConnection.SetCurrentOperationText2 = ButtonState.ToString() + "|" + ShoulderState.ToString() + "|" + StickState.ToString() + "|" + StickHoriz + "|" + StickVert + "|" + LastSearchTime; - } - - Thread.Sleep(LastSearchTime * 2); - } - } - } - - [Flags] - public enum ButtonState - { - A = 0x01, - B = 0x02, - Select = 0x04, - Start = 0x08, - DPAD_Right = 0x10, - DPAD_Left = 0x20, - DPAD_Up = 0x40, - DPAD_Down = 0x80 - } - - [Flags] - public enum ShoulderState - { - R = 0x01, - L = 0x02 - } - - [Flags] - public enum StickState - { - LStick_Right = 0x10, - LStick_Left = 0x20, - LStick_Up = 0x40, - LStick_Down = 0x80 - } -} diff --git a/tmp/NTRDebuggerTool/Forms/MainFormThreadEventDispatcher.cs b/tmp/NTRDebuggerTool/Forms/MainFormThreadEventDispatcher.cs deleted file mode 100644 index 2093454..0000000 --- a/tmp/NTRDebuggerTool/Forms/MainFormThreadEventDispatcher.cs +++ /dev/null @@ -1,387 +0,0 @@ -using NTRDebuggerTool.Forms.FormEnums; -using NTRDebuggerTool.Objects; -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Text.RegularExpressions; -using System.Threading; -using System.Windows.Forms; - -namespace NTRDebuggerTool.Forms -{ - class MainFormThreadEventDispatcher - { - internal bool DispatchConnect = false; - internal bool DispatchOpenProcess = false; - internal bool DispatchSearch = false; - internal bool DispatchConfig = false; - internal string DispatchPointerSearch = null; - public ConcurrentQueue RefreshValueAddresses = new ConcurrentQueue(), - RefreshValueReturn = new ConcurrentQueue(), - WriteAddress = new ConcurrentQueue(); - - internal string CurrentSelectedProcess = ""; - internal string CurrentMemoryRange = ""; - internal DataTypeExact CurrentSelectedDataType; - internal SearchTypeBase CurrentSelectedSearchType; - - internal string FoundPointerAddress = null; - - private MainForm Form; - private Regex HexRegex = new Regex("^[0-9A-F]+$", RegexOptions.Compiled | RegexOptions.IgnoreCase); - private Regex ParserRegex = new Regex("\\(\\*(?
.+)\\)(?(?:\\[[0-9A-F]+\\])?)", RegexOptions.Compiled | RegexOptions.IgnoreCase); - private Dictionary Pointers = new Dictionary(); - - internal MainFormThreadEventDispatcher(MainForm Form) - { - // TODO: Complete member initialization - this.Form = Form; - } - - internal void ThreadEventDispatcher() - { - while (true) - { - if (DispatchConnect) - { - DispatchConnect = false; - DoConnect(); - } - if (DispatchOpenProcess) - { - DispatchOpenProcess = false; - DoOpenProcess(); - } - if (DispatchSearch) - { - DispatchSearch = false; - DoSearch(); - } - if (DispatchConfig) - { - DispatchConfig = false; - DoConfig(); - } - if (DispatchPointerSearch != null) - { - string TempAddress = DispatchPointerSearch; - DispatchPointerSearch = null; - DoPointerSearch(TempAddress); - } - while (RefreshValueAddresses.Count > 0) - { - MemoryDispatch Row = new MemoryDispatch(); - RefreshValueAddresses.TryDequeue(out Row); - uint Address; - - if (HexRegex.IsMatch(Row.TextAddress)) - { - Address = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Row.TextAddress).Reverse().ToArray(), 0); ; - } - else - { - Match TopMatch = ParserRegex.Match(Row.TextAddress); - - if (!TopMatch.Success) - { - return; - } - - Address = ResolvePointer(TopMatch); - } - - if (Form.IsValidMemoryAddress(Address)) - { - Row.ResolvedAddress = Utilities.GetStringFromByteArray(BitConverter.GetBytes(Address).Reverse().ToArray()); - Row.Value = GetMemoryAtAddress(CurrentSelectedProcess, Address, Row.Type); - RefreshValueReturn.Enqueue(Row); - } - } - while (WriteAddress.Count > 0) - { - MemoryDispatch Row = new MemoryDispatch(); - WriteAddress.TryDequeue(out Row); - uint Address; - - if (HexRegex.IsMatch(Row.TextAddress)) - { - Address = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Row.TextAddress).Reverse().ToArray(), 0); ; - } - else - { - Match TopMatch = ParserRegex.Match(Row.TextAddress); - - if (!TopMatch.Success) - { - return; - } - - Address = ResolvePointer(TopMatch); - } - - if (Form.IsValidMemoryAddress(Address)) - { - Row.ResolvedAddress = Utilities.GetStringFromByteArray(BitConverter.GetBytes(Address).Reverse().ToArray()); - uint ProcessID = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(CurrentSelectedProcess.Split('|')[0]), 0); - Form.NTRConnection.SendWriteMemoryPacket(ProcessID, Address, Row.Value); - } - } - - Thread.Sleep(100); - } - } - - private void DoPointerSearch(string TempAddress) - { - Form.FormEnabled = false; - PointerScanDialog Dialog = new PointerScanDialog(Form, TempAddress, CurrentSelectedProcess); - Dialog.ShowDialog(); - FoundPointerAddress = Dialog.PointerFound; - Dialog.Dispose(); - Form.FormEnabled = true; - } - - private void DoConfig() - { - Form.FormEnabled = false; - ConfigDialog Dialog = new ConfigDialog(Form); - Dialog.ShowDialog(); - Dialog.Dispose(); - Form.FormEnabled = true; - } - - private void DoConnect() - { - if (Form.NTRConnection.IsConnected || Form.ButtonConnectDisconnect.Text == "Disconnect") - { - Form.NTRConnection.SetCurrentOperationText = "Disconnecting"; - Form.NTRConnection.Disconnect(); - Form.SetConnectedControls(false); - Form.SetProcessSelectedControls(false); - Form.SetConnectText = "Connect"; - Form.ControlEnabledButtonConnectDisconnect = true; - Form.NTRConnection.SetCurrentOperationText = ""; - } - else - { - Form.SetConnectionControls(false); - Form.NTRConnection.SetCurrentOperationText = "Connecting"; - Form.NTRConnection.IP = Form.IP.Text; - Form.NTRConnection.Port = short.Parse(Form.Port.Text); - - bool Connected = false; - - for (int i = 0; i < Config.ConnectTries && !Connected; ++i) - { - Connected = Form.NTRConnection.Connect(); - } - - if (Connected) - { - Form.SetConnectText = "Disconnect"; - Form.NTRConnection.SetCurrentOperationText = "Fetching Processes"; - Form.NTRConnection.SendListProcessesPacket(); - } - else - { - Form.SetConnectionControls(true); - Form.NTRConnection.SetCurrentOperationText = ""; - } - } - } - - private void DoOpenProcess() - { - Form.SetConnectedControls(false); - Form.NTRConnection.SetCurrentOperationText = "Fetching Memory Ranges"; - //Dummy search criteria to prevent operation collision - while (Form.NTRConnection.SearchCriteria.Count > 0) - { - Thread.Sleep(10); - } - Form.NTRConnection.SearchCriteria.Add(new SearchCriteria()); - Form.NTRConnection.SendReadMemoryAddressesPacket(CurrentSelectedProcess.Split('|')[0]); - while (!Form.NTRConnection.IsMemoryListUpdated && !Form.ControlEnabledButtonOpenProcess) - { - Thread.Sleep(10); - } - Form.NTRConnection.SearchCriteria.RemoveAt(0); - } - - private void DoSearch() - { - if (CurrentSelectedSearchType != SearchTypeBase.Same && CurrentSelectedSearchType != SearchTypeBase.Different && CurrentSelectedSearchType != SearchTypeBase.Unknown) - { - if (string.IsNullOrWhiteSpace(Form.SearchValue.Text)) - { - Form.NTRConnection.SetCurrentOperationText = "Invalid search criteria!"; - Form.SearchComplete = true; - if (Form.LastSearchCriteria == null) - { - Form.ControlEnabledSearchButton = Form.ControlEnabledDataType = Form.ControlEnabledMemoryRange = true; - } - return; - } - if (CurrentSelectedSearchType == SearchTypeBase.Range && string.IsNullOrWhiteSpace(Form.SearchValue2.Text)) - { - Form.NTRConnection.SetCurrentOperationText = "Invalid range criteria!"; - Form.SearchComplete = true; - if (Form.LastSearchCriteria == null) - { - Form.ControlEnabledSearchButton = Form.ControlEnabledDataType = Form.ControlEnabledMemoryRange = true; - } - return; - } - } - if (Form.LastSearchCriteria == null) - { - Form.LastSearchCriteria = new SearchCriteria(); - Form.LastSearchCriteria.ProcessID = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(CurrentSelectedProcess.Split('|')[0]), 0); - Form.LastSearchCriteria.DataType = this.CurrentSelectedDataType; - - if (CurrentMemoryRange.Equals("All")) - { - Form.LastSearchCriteria.StartAddress = Form.LastSearchCriteria.Length = uint.MaxValue; - } - else - { - Form.LastSearchCriteria.StartAddress = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Form.MemoryStart.Text).Reverse().ToArray(), 0); - Form.LastSearchCriteria.Length = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Form.MemorySize.Text).Reverse().ToArray(), 0); - } - } - Form.LastSearchCriteria.SearchType = this.CurrentSelectedSearchType; - - Form.NTRConnection.SetCurrentOperationText = "Searching Memory"; - - string Value1 = Form.SearchValue.Text; - - if (string.IsNullOrWhiteSpace(Value1)) - { - Value1 = "0"; - } - - Form.LastSearchCriteria.SearchValue = GetValueForDataType(CurrentSelectedDataType, Value1); - Form.LastSearchCriteria.Size = (uint)Form.LastSearchCriteria.SearchValue.Length; - if (CurrentSelectedSearchType == SearchTypeBase.Range) - { - Form.LastSearchCriteria.SearchValue2 = GetValueForDataType(CurrentSelectedDataType, Form.SearchValue2.Text); - } - - if (Form.LastSearchCriteria.FirstSearch && CurrentMemoryRange.Equals("All") && Form.LastSearchCriteria.SearchType != SearchTypeBase.Range && Form.LastSearchCriteria.SearchValue.All(x => x.Equals(0))) - { - Form.FormEnabled = false; - DialogResult DialogResult = MessageBox.Show("You're about to search for value 0 (or functional equivalent) across all memory ranges. This operation will take a long time and may cause issues. Are you sure you want to search for this value?", "Warning", MessageBoxButtons.YesNo); - Form.FormEnabled = true; - if (DialogResult != DialogResult.Yes) - { - Form.LastSearchCriteria = null; - Form.SearchComplete = true; - Form.ControlEnabledSearchButton = Form.ControlEnabledDataType = Form.ControlEnabledMemoryRange = true; - return; - } - } - - Form.NTRConnection.SearchCriteria.Add(Form.LastSearchCriteria); - - Form.NTRConnection.SendReadMemoryPacket(Form.LastSearchCriteria); - - Form.SearchComplete = true; - } - - private byte[] GetValueForDataType(DataTypeExact CurrentSelectedDataType, string Value) - { - switch (CurrentSelectedDataType) - { - case DataTypeExact.Bytes1: //1 Byte - return new byte[] { (byte)uint.Parse(Value) }; - case DataTypeExact.Bytes2: //2 Bytes - return BitConverter.GetBytes(ushort.Parse(Value)); - case DataTypeExact.Bytes4: //4 Bytes - return BitConverter.GetBytes(uint.Parse(Value)); - case DataTypeExact.Bytes8: //8 Bytes - return BitConverter.GetBytes(ulong.Parse(Value)); - case DataTypeExact.Float: //Float - return BitConverter.GetBytes(float.Parse(Value)); - case DataTypeExact.Double: //Double - return BitConverter.GetBytes(double.Parse(Value)); - case DataTypeExact.Raw: //Raw Bytes - return Utilities.GetByteArrayFromByteString(Value); - default: //Text - return System.Text.Encoding.Default.GetBytes(Value); - } - } - - private uint ResolvePointer(Match Match) - { - string AddressString = Match.Groups["Address"].Value; - string OffsetString = Match.Groups["Offset"].Value; - - - uint Address; - - Match RecurseMatch = ParserRegex.Match(AddressString); - - if (RecurseMatch.Success) - { - Address = ResolvePointer(RecurseMatch); - } - else - { - uint Pointer = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(AddressString).Reverse().ToArray(), 0); - if (!Pointers.ContainsKey(Pointer)) - { - byte[] Data = GetMemoryAtAddress(CurrentSelectedProcess, AddressString, DataTypeExact.Bytes4); - - Address = BitConverter.ToUInt32(Data, 0); - Pointers[Pointer] = Address; - } - else if (!Form.IsValidMemoryAddress(Pointer)) - { - return 0; - } - else - { - Address = Pointers[Pointer]; - } - } - - if (Address != 0 && !string.IsNullOrWhiteSpace(OffsetString)) - { - OffsetString = OffsetString.Replace("[", "").Replace("]", ""); - Address += BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(OffsetString.PadLeft(8, '0')).Reverse().ToArray(), 0); - } - - return Address; - } - - internal byte[] GetMemoryAtAddress(string ProcessID, string Address, DataTypeExact DataType) - { - return GetMemoryAtAddress(BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(ProcessID), 0), BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Address).Reverse().ToArray(), 0), DataType); - } - - internal byte[] GetMemoryAtAddress(uint ProcessID, string Address, DataTypeExact DataType) - { - return GetMemoryAtAddress(ProcessID, BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Address).Reverse().ToArray(), 0), DataType); - } - - internal byte[] GetMemoryAtAddress(string ProcessID, uint Address, DataTypeExact DataType) - { - return GetMemoryAtAddress(BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(ProcessID), 0), Address, DataType); - } - - internal byte[] GetMemoryAtAddress(uint ProcessID, uint Address, DataTypeExact DataType) - { - SearchCriteria Criteria = new SearchCriteria(); - Criteria.ProcessID = ProcessID; - Criteria.DataType = DataType; - Criteria.StartAddress = Address; - Criteria.Length = Criteria.Size = Form.GetSearchMemorySize(DataType); - Criteria.SearchType = SearchTypeBase.Unknown; - Criteria.SearchValue = new byte[] { 0 }; - Form.NTRConnection.SearchCriteria.Add(Criteria); - Form.NTRConnection.SendReadMemoryPacket(Criteria); - return Criteria.AddressesFound.Values.First(); - } - } -} diff --git a/tmp/NTRDebuggerTool/Forms/PointerScanDialog.Designer.cs b/tmp/NTRDebuggerTool/Forms/PointerScanDialog.Designer.cs deleted file mode 100644 index 6733242..0000000 --- a/tmp/NTRDebuggerTool/Forms/PointerScanDialog.Designer.cs +++ /dev/null @@ -1,183 +0,0 @@ -namespace NTRDebuggerTool.Forms -{ - partial class PointerScanDialog - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.TextAddress = new System.Windows.Forms.TextBox(); - this.LabelAddress = new System.Windows.Forms.Label(); - this.TextMaxOffset = new System.Windows.Forms.TextBox(); - this.LabelMaxOffset = new System.Windows.Forms.Label(); - this.ResultsDataGrid = new System.Windows.Forms.DataGridView(); - this.AddressColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.OffsetColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.CancelButton = new System.Windows.Forms.Button(); - this.SearchButton = new System.Windows.Forms.Button(); - this.CheckFullSearch = new System.Windows.Forms.CheckBox(); - ((System.ComponentModel.ISupportInitialize)(this.ResultsDataGrid)).BeginInit(); - this.SuspendLayout(); - // - // TextAddress - // - this.TextAddress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.TextAddress.Location = new System.Drawing.Point(63, 9); - this.TextAddress.Name = "TextAddress"; - this.TextAddress.ReadOnly = true; - this.TextAddress.Size = new System.Drawing.Size(65, 20); - this.TextAddress.TabIndex = 28; - // - // LabelAddress - // - this.LabelAddress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.LabelAddress.Location = new System.Drawing.Point(12, 9); - this.LabelAddress.Name = "LabelAddress"; - this.LabelAddress.Size = new System.Drawing.Size(45, 23); - this.LabelAddress.TabIndex = 29; - this.LabelAddress.Text = "Address"; - this.LabelAddress.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // TextMaxOffset - // - this.TextMaxOffset.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.TextMaxOffset.Location = new System.Drawing.Point(142, 9); - this.TextMaxOffset.Name = "TextMaxOffset"; - this.TextMaxOffset.Size = new System.Drawing.Size(65, 20); - this.TextMaxOffset.TabIndex = 30; - // - // LabelMaxOffset - // - this.LabelMaxOffset.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.LabelMaxOffset.Location = new System.Drawing.Point(213, 9); - this.LabelMaxOffset.Name = "LabelMaxOffset"; - this.LabelMaxOffset.Size = new System.Drawing.Size(59, 23); - this.LabelMaxOffset.TabIndex = 31; - this.LabelMaxOffset.Text = "Max Offset"; - this.LabelMaxOffset.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // ResultsDataGrid - // - this.ResultsDataGrid.AllowUserToAddRows = false; - this.ResultsDataGrid.AllowUserToDeleteRows = false; - this.ResultsDataGrid.AllowUserToResizeRows = false; - this.ResultsDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.ResultsDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.AddressColumn, - this.OffsetColumn}); - this.ResultsDataGrid.Location = new System.Drawing.Point(12, 35); - this.ResultsDataGrid.Name = "ResultsDataGrid"; - this.ResultsDataGrid.ReadOnly = true; - this.ResultsDataGrid.RowHeadersVisible = false; - this.ResultsDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; - this.ResultsDataGrid.Size = new System.Drawing.Size(260, 146); - this.ResultsDataGrid.TabIndex = 32; - this.ResultsDataGrid.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.ResultsDataGrid_CellDoubleClick); - // - // AddressColumn - // - this.AddressColumn.HeaderText = "Address"; - this.AddressColumn.Name = "AddressColumn"; - this.AddressColumn.ReadOnly = true; - // - // OffsetColumn - // - this.OffsetColumn.HeaderText = "Offset"; - this.OffsetColumn.Name = "OffsetColumn"; - this.OffsetColumn.ReadOnly = true; - // - // CancelButton - // - this.CancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.CancelButton.Location = new System.Drawing.Point(15, 187); - this.CancelButton.Name = "CancelButton"; - this.CancelButton.Size = new System.Drawing.Size(75, 23); - this.CancelButton.TabIndex = 33; - this.CancelButton.Text = "Cancel"; - this.CancelButton.UseVisualStyleBackColor = true; - this.CancelButton.Click += new System.EventHandler(this.CancelButton_Click); - // - // SearchButton - // - this.SearchButton.Location = new System.Drawing.Point(197, 187); - this.SearchButton.Name = "SearchButton"; - this.SearchButton.Size = new System.Drawing.Size(75, 23); - this.SearchButton.TabIndex = 34; - this.SearchButton.Text = "Search"; - this.SearchButton.UseVisualStyleBackColor = true; - this.SearchButton.Click += new System.EventHandler(this.SearchButton_Click); - // - // CheckFullSearch - // - this.CheckFullSearch.AutoSize = true; - this.CheckFullSearch.Location = new System.Drawing.Point(97, 192); - this.CheckFullSearch.Name = "CheckFullSearch"; - this.CheckFullSearch.Size = new System.Drawing.Size(79, 17); - this.CheckFullSearch.TabIndex = 35; - this.CheckFullSearch.Text = "Full Search"; - this.CheckFullSearch.UseVisualStyleBackColor = true; - // - // PointerScanDialog - // - this.AcceptButton = this.SearchButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(284, 222); - this.ControlBox = false; - this.Controls.Add(this.CheckFullSearch); - this.Controls.Add(this.SearchButton); - this.Controls.Add(this.CancelButton); - this.Controls.Add(this.ResultsDataGrid); - this.Controls.Add(this.LabelMaxOffset); - this.Controls.Add(this.TextMaxOffset); - this.Controls.Add(this.LabelAddress); - this.Controls.Add(this.TextAddress); - this.MaximumSize = new System.Drawing.Size(300, 260); - this.MinimumSize = new System.Drawing.Size(300, 260); - this.Name = "PointerScanDialog"; - this.ShowIcon = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Pointer Scan"; - ((System.ComponentModel.ISupportInitialize)(this.ResultsDataGrid)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - internal System.Windows.Forms.TextBox TextAddress; - private System.Windows.Forms.Label LabelAddress; - internal System.Windows.Forms.TextBox TextMaxOffset; - private System.Windows.Forms.Label LabelMaxOffset; - private System.Windows.Forms.DataGridView ResultsDataGrid; - private System.Windows.Forms.DataGridViewTextBoxColumn AddressColumn; - private System.Windows.Forms.DataGridViewTextBoxColumn OffsetColumn; - private System.Windows.Forms.Button CancelButton; - private System.Windows.Forms.Button SearchButton; - private System.Windows.Forms.CheckBox CheckFullSearch; - } -} \ No newline at end of file diff --git a/tmp/NTRDebuggerTool/Forms/PointerScanDialog.cs b/tmp/NTRDebuggerTool/Forms/PointerScanDialog.cs deleted file mode 100644 index 68980dc..0000000 --- a/tmp/NTRDebuggerTool/Forms/PointerScanDialog.cs +++ /dev/null @@ -1,68 +0,0 @@ -using NTRDebuggerTool.Forms.FormEnums; -using NTRDebuggerTool.Objects; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows.Forms; - -namespace NTRDebuggerTool.Forms -{ - public partial class PointerScanDialog : Form - { - MainForm MainForm; - - internal string PointerFound = null; - internal string ProcessID; - - public PointerScanDialog(MainForm MainForm, string Address, string ProcessID) - { - InitializeComponent(); - TextAddress.Text = Address; - TextMaxOffset.Text = "1000"; - this.MainForm = MainForm; - this.ProcessID = ProcessID; - } - - private void ResultsDataGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) - { - PointerFound = "(*" + (string)ResultsDataGrid[0, e.RowIndex].Value + ")[" + (string)ResultsDataGrid[1, e.RowIndex].Value + "]"; - this.Close(); - } - - private void CancelButton_Click(object sender, EventArgs e) - { - this.Close(); - } - - private void SearchButton_Click(object sender, EventArgs e) - { - uint Pointer = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(TextAddress.Text).Reverse().ToArray(), 0); - SearchCriteria Criteria = new SearchCriteria(); - Criteria.ProcessID = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(ProcessID), 0); - Criteria.DataType = DataTypeExact.Bytes4; - if (CheckFullSearch.Checked) - { - Criteria.StartAddress = Criteria.Length = uint.MaxValue; - Criteria.Length = 4; - } - else - { - KeyValuePair KVP = MainForm.GetAddressSpaceForAddress(Pointer).Value; - Criteria.StartAddress = KVP.Key; - Criteria.Length = KVP.Value; - } - Criteria.Size = 4; - Criteria.SearchType = SearchTypeBase.Range; - Criteria.SearchValue = BitConverter.GetBytes(Pointer - BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(TextMaxOffset.Text.PadLeft(8, '0')).Reverse().ToArray(), 0)); - Criteria.SearchValue2 = BitConverter.GetBytes(Pointer); - MainForm.NTRConnection.SearchCriteria.Add(Criteria); - MainForm.NTRConnection.SendReadMemoryPacket(Criteria); - foreach (var a in Criteria.AddressesFound.OrderByDescending(x => BitConverter.ToUInt32(x.Value, 0)).ThenBy(x => x.Key)) - { - int RowIndex = ResultsDataGrid.Rows.Add(); - ResultsDataGrid[0, RowIndex].Value = Utilities.GetStringFromByteArray(BitConverter.GetBytes(a.Key).Reverse().ToArray()); - ResultsDataGrid[1, RowIndex].Value = Utilities.GetStringFromByteArray(BitConverter.GetBytes(Pointer - BitConverter.ToUInt32(a.Value, 0)).Reverse().ToArray()).TrimStart('0'); - } - } - } -} diff --git a/tmp/NTRDebuggerTool/Forms/PointerScanDialog.resx b/tmp/NTRDebuggerTool/Forms/PointerScanDialog.resx deleted file mode 100644 index 53e918b..0000000 --- a/tmp/NTRDebuggerTool/Forms/PointerScanDialog.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - True - - \ No newline at end of file diff --git a/tmp/NTRDebuggerTool/NTRDebuggerTool.csproj b/tmp/NTRDebuggerTool/NTRDebuggerTool.csproj deleted file mode 100644 index c0911b7..0000000 --- a/tmp/NTRDebuggerTool/NTRDebuggerTool.csproj +++ /dev/null @@ -1,182 +0,0 @@ - - - - - Debug - AnyCPU - {86AF1318-9584-4CDE-93BC-C2F0DCF958C5} - WinExe - Properties - NTRDebuggerTool - NTRDebuggerTool - v4.0 - 512 - false - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - NTRDebuggerTool.Program - 65001 - - - x86 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - - - - false - - - x86 - pdbonly - true - bin\Release\ - prompt - 4 - true - false - - - - - - - - - - - - - Resources\log4net.dll - False - - - - - - - - Form - - - ConfigDialog.cs - - - - - Form - - - MainForm.cs - - - - - Form - - - PointerScanDialog.cs - - - - - - - - - - - - - - - ConfigDialog.cs - - - MainForm.cs - - - PointerScanDialog.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - Designer - - - - - - - - False - Microsoft .NET Framework 4.5 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - - - - - - - - - - \ No newline at end of file diff --git a/tmp/NTRDebuggerTool/Objects/GateSharkCode.cs b/tmp/NTRDebuggerTool/Objects/GateSharkCode.cs deleted file mode 100644 index 5389854..0000000 --- a/tmp/NTRDebuggerTool/Objects/GateSharkCode.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace NTRDebuggerTool.Objects -{ - class GateSharkCode - { - GateSharkCodeOperation operation; - - internal uint loadedValue; - internal bool returnToTopLevel = false, isInCType = false; - - public GateSharkCode() { } - - public void ParseCode(string code) - { - operation = new GateSharkCodeOperation(); - operation.operationType = OperationType.TopLevelOperation; - operation.ParseCode(code); - } - - private class GateSharkCodeOperation - { - private List operations = new List(); - internal OperationType operationType; - - private uint leftCode, rightCode; - - public string ParseCode(string code) - { - string[] codeLines = code.Split(new string[] { "\r\n", "\n", "\r" }, StringSplitOptions.RemoveEmptyEntries); - for (int i = 0; i < codeLines.Length; ++i) - { - string[] lineParts = codeLines[i].Split(' '); - - uint leftCode = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(lineParts[0]), 0); - uint rightCode = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(lineParts[1]), 0); - - OperationType opType = (OperationType)(leftCode & 0xF0000000); - if (opType == OperationType.DTypeTest) - { - opType = (OperationType)(leftCode & 0xFF000000); - } - - GateSharkCodeOperation operation = new GateSharkCodeOperation(); - operation.operationType = opType; - operation.leftCode = leftCode; - operation.rightCode = rightCode; - - switch (opType) - { - case OperationType.ConditionalGreaterThan4Byte: - case OperationType.ConditionalLessThan4Byte: - case OperationType.ConditionalEqual4Byte: - case OperationType.ConditionalNotEqual4Byte: - case OperationType.ConditionalGreaterThan2Byte: - case OperationType.ConditionalLessThan2Byte: - case OperationType.ConditionalEqual2Byte: - case OperationType.ConditionalNotEqual2Byte: - case OperationType.ButtonStateRequire: - break; - case OperationType.WriteRange: - break; - } - } - return null; - } - } - - #region Pulled from http://gbatemp.net/threads/i-need-help-understanding-these-d-code-lines-please.417985/#post-6151997 - - private enum OperationType : uint - { - Write4Byte = 0x00000000, - Write2Byte = 0x10000000, - Write1Byte = 0x20000000, - ConditionalGreaterThan4Byte = 0x30000000, - ConditionalLessThan4Byte = 0x40000000, - ConditionalEqual4Byte = 0x50000000, - ConditionalNotEqual4Byte = 0x60000000, - ConditionalGreaterThan2Byte = 0x70000000, - ConditionalLessThan2Byte = 0x80000000, - ConditionalEqual2Byte = 0x90000000, - ConditionalNotEqual2Byte = 0xA0000000, - LoadOffset = 0xB0000000, - WriteRange = 0xC0000000, - DTypeTest = 0xD0000000, - EndConditional = 0xD0000000, - EndRepeat = 0xD1000000, - ResetState = 0xD2000000, - LoadPointer = 0xD3000000, - AddToLoadedPointer = 0xD4000000, - SetLoadedPointer = 0xD5000000, - SetAndInc4Byte = 0xD6000000, - SetAndInc2Byte = 0xD7000000, - SetAndInc1Byte = 0xD8000000, - LoadValue4Byte = 0xD9000000, - LoadValue2Byte = 0xDA000000, - LoadValue1Byte = 0xDB000000, - Unknown24Byte = 0xDC000000, - ButtonStateRequire = 0xDD000000, - WriteRegion = 0xE0000000, - UnusedFCode = 0xF0000000, - TopLevelOperation = 0xFFFFFFFF - } - - [Flags] - private enum GateSharkButtonState - { - A = 0x00000001, - B = 0x00000002, - Select = 0x00000004, - Start = 0x00000008, - Right = 0x00000010, - Left = 0x00000020, - Up = 0x00000040, - Down = 0x00000080, - R = 0x00000100, - L = 0x00000200, - X = 0x00000400, - Y = 0x00000800, - } - - #endregion - } -} diff --git a/tmp/NTRDebuggerTool/Objects/MemoryDispatch.cs b/tmp/NTRDebuggerTool/Objects/MemoryDispatch.cs deleted file mode 100644 index 6ee0f6a..0000000 --- a/tmp/NTRDebuggerTool/Objects/MemoryDispatch.cs +++ /dev/null @@ -1,12 +0,0 @@ -using NTRDebuggerTool.Forms.FormEnums; - -namespace NTRDebuggerTool.Objects -{ - public struct MemoryDispatch - { - public int Row; - public DataTypeExact Type; - public string TextAddress, ResolvedAddress; - public byte[] Value; - } -} diff --git a/tmp/NTRDebuggerTool/Objects/Saving/SaveCode.cs b/tmp/NTRDebuggerTool/Objects/Saving/SaveCode.cs deleted file mode 100644 index bf0c770..0000000 --- a/tmp/NTRDebuggerTool/Objects/Saving/SaveCode.cs +++ /dev/null @@ -1,28 +0,0 @@ -using NTRDebuggerTool.Forms.FormEnums; -using System; - -namespace NTRDebuggerTool.Objects.Saving -{ - public class SaveCode - { - public DataTypeExact type; - public String address; - - public SaveCode() - { - type = DataTypeExact.Raw; - address = null; - } - - public SaveCode(DataTypeExact type, String address) - { - this.type = type; - this.address = address; - } - - public override string ToString() - { - return type + ": " + address; - } - } -} diff --git a/tmp/NTRDebuggerTool/Objects/Saving/SaveManager.cs b/tmp/NTRDebuggerTool/Objects/Saving/SaveManager.cs deleted file mode 100644 index cf06db5..0000000 --- a/tmp/NTRDebuggerTool/Objects/Saving/SaveManager.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Windows.Forms; - -namespace NTRDebuggerTool.Objects.Saving -{ - public class SaveManager - { - private static readonly log4net.ILog LOGGER = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - - public String titleId; - public List codes; - - public void Init() - { - titleId = null; - codes = new List(); - } - - public override string ToString() - { - return titleId + ",[" + codes.ToString() + "]"; - } - - public static void SaveToXml(string filePath, SaveManager sourceObj) - { - if (sourceObj.titleId == null || sourceObj.codes.Count == 0) - { - return; - } - try - { - using (StreamWriter writer = new StreamWriter(filePath)) - { - System.Xml.Serialization.XmlSerializer xmlSerializer = - new System.Xml.Serialization.XmlSerializer(sourceObj.GetType()); - xmlSerializer.Serialize(writer, sourceObj); - } - } - catch (Exception ex) - { - LOGGER.Error("Exception saving codes [" + sourceObj + "] to XML file", ex); - MessageBox.Show(ex.Message); - } - } - - public static SaveManager LoadFromXml(string filePath) - { - try - { - using (StreamReader reader = new StreamReader(filePath)) - { - System.Xml.Serialization.XmlSerializer xmlSerializer = - new System.Xml.Serialization.XmlSerializer(typeof(SaveManager)); - return (SaveManager)xmlSerializer.Deserialize(reader); - } - } - catch (Exception ex) - { - LOGGER.Warn("Exception loading codes from XML file " + filePath, ex); - } - return new SaveManager(); - } - } -} \ No newline at end of file diff --git a/tmp/NTRDebuggerTool/Objects/SearchCriteria.cs b/tmp/NTRDebuggerTool/Objects/SearchCriteria.cs deleted file mode 100644 index c50786a..0000000 --- a/tmp/NTRDebuggerTool/Objects/SearchCriteria.cs +++ /dev/null @@ -1,25 +0,0 @@ -using NTRDebuggerTool.Forms.FormEnums; -using System.Collections.Generic; - -namespace NTRDebuggerTool.Objects -{ - public class SearchCriteria - { - public uint Duration; - public uint ProcessID; - public uint StartAddress, Length; - public uint Size; - public SearchTypeBase SearchType; - public DataTypeExact DataType; - public byte[] SearchValue; - public byte[] SearchValue2; - - public bool SearchComplete = false; - public bool AllSearchesComplete = false; - - public bool FirstSearch = true; - public bool HideSearch = false; - - public Dictionary AddressesFound = new Dictionary(); - } -} diff --git a/tmp/NTRDebuggerTool/Program.cs b/tmp/NTRDebuggerTool/Program.cs deleted file mode 100644 index 58ffd18..0000000 --- a/tmp/NTRDebuggerTool/Program.cs +++ /dev/null @@ -1,85 +0,0 @@ -using NTRDebuggerTool.Forms; -using NTRDebuggerTool.Remote; -using System; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Windows.Forms; - -namespace NTRDebuggerTool -{ - static class Program - { - static Program() - { - AppDomain.CurrentDomain.AssemblyResolve += (sender, bargs) => - { - String dllName = new AssemblyName(bargs.Name).Name + ".dll"; - var assem = Assembly.GetExecutingAssembly(); - String resourceName = assem.GetManifestResourceNames().FirstOrDefault(rn => rn.EndsWith(dllName)); - if (resourceName == null) return null; // Not found, maybe another handler will find it - using (var stream = assem.GetManifestResourceStream(resourceName)) - { - Byte[] assemblyData = new Byte[stream.Length]; - stream.Read(assemblyData, 0, assemblyData.Length); - return Assembly.Load(assemblyData); - } - }; - } - - public const bool DEBUG = false; - - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main(string[] args) - { - try - { - if (DEBUG || (args.Length > 0 && args[0].Equals("-c"))) - { - ConsoleHelper.EnableConsole(); - } - try - { - File.Open(Path.GetTempPath() + "3dsreleases.xml", FileMode.Open).Close(); - } - catch (FileNotFoundException ex) - { - try - { - using (WebClient client = new WebClient()) - { - client.DownloadFile("http://3dsdb.com/xml.php", Path.GetTempPath() + "3dsreleases.xml"); - } - } - catch (Exception e) - { - //log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType).Error(null, ex); - //log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType).Error(null, e); - } - } - - //Debug code - if (!DEBUG) - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm(new NTRRemoteConnection())); - } - else - { - Debug.Execute(); - } - } - catch (Exception ex) - { - //log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType).Error(null, ex); - MessageBox.Show("An exception has occurred. Check the log file at " + System.IO.Path.GetTempPath() + System.IO.Path.DirectorySeparatorChar + "NTRDebuggerTool-Log.txt"); - Application.Exit(); - } - } - } -} diff --git a/tmp/NTRDebuggerTool/Properties/AssemblyInfo.cs b/tmp/NTRDebuggerTool/Properties/AssemblyInfo.cs deleted file mode 100644 index 9d488f5..0000000 --- a/tmp/NTRDebuggerTool/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("NTRDebuggerTool")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NTRDebuggerTool")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] -[assembly: Guid("290cd39f-c191-4212-9985-0584c9200acc")] -[assembly: AssemblyVersion("0.8.6.2")] -[assembly: AssemblyFileVersion("0.8.6.2")] diff --git a/tmp/NTRDebuggerTool/Properties/Resources.Designer.cs b/tmp/NTRDebuggerTool/Properties/Resources.Designer.cs deleted file mode 100644 index 5187a67..0000000 --- a/tmp/NTRDebuggerTool/Properties/Resources.Designer.cs +++ /dev/null @@ -1,73 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace NTRDebuggerTool.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NTRDebuggerTool.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap cog2 { - get { - object obj = ResourceManager.GetObject("cog2", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} diff --git a/tmp/NTRDebuggerTool/Properties/Resources.resx b/tmp/NTRDebuggerTool/Properties/Resources.resx deleted file mode 100644 index ca80b5c..0000000 --- a/tmp/NTRDebuggerTool/Properties/Resources.resx +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - ..\Resources\cog2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/tmp/NTRDebuggerTool/Properties/Settings.Designer.cs b/tmp/NTRDebuggerTool/Properties/Settings.Designer.cs deleted file mode 100644 index e8bc796..0000000 --- a/tmp/NTRDebuggerTool/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace NTRDebuggerTool.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/tmp/NTRDebuggerTool/Properties/Settings.settings b/tmp/NTRDebuggerTool/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/tmp/NTRDebuggerTool/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tmp/NTRDebuggerTool/Remote/NTRPacketReceiverThread.cs b/tmp/NTRDebuggerTool/Remote/NTRPacketReceiverThread.cs deleted file mode 100644 index 728b67d..0000000 --- a/tmp/NTRDebuggerTool/Remote/NTRPacketReceiverThread.cs +++ /dev/null @@ -1,479 +0,0 @@ -using NTRDebuggerTool.Forms.FormEnums; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Xml; - -namespace NTRDebuggerTool.Remote -{ - class NTRPacketReceiverThread - { - private static readonly log4net.ILog LOGGER = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - - private NTRRemoteConnection NTRConnection; - - private uint DataRead = 0; - - internal NTRPacketReceiverThread(NTRRemoteConnection NTRConnection) - { - this.NTRConnection = NTRConnection; - } - - #region Receiving Packets - - internal void ThreadReceivePackets() - { - byte[] Buffer = new byte[84]; - uint[] Arguments = new uint[16]; - uint Magic, Sequence, Type, Command; - - while (true) - { - try - { - Array.Clear(Buffer, 0, Buffer.Length); - int PacketSize = ReadBasePacket(Buffer, true); - if (PacketSize == 0) - { - break; - } - if (PacketSize < Buffer.Length && ShouldSkipPacket(Buffer)) - { - continue; - } - int t = 0; - Magic = BitConverter.ToUInt32(Buffer, t); - Sequence = BitConverter.ToUInt32(Buffer, t += 4); - Type = BitConverter.ToUInt32(Buffer, t += 4); - Command = BitConverter.ToUInt32(Buffer, t += 4); - for (int i = 0; i < Arguments.Length; i++) - { - Arguments[i] = BitConverter.ToUInt32(Buffer, t += 4); - } - uint ExtraDataLength = BitConverter.ToUInt32(Buffer, t += 4); - - if (Magic != 0x12345678) - { - break; - } - - if (ExtraDataLength > 0) - { - ReadExtraData(Command, Sequence, ExtraDataLength); - } - - if (Type == PacketType.General && Command == PacketCommand.Heartbeat) - { - this.NTRConnection.CanSendHeartbeat = true; - } - } - catch (Exception e) - { - LOGGER.Error(null, e); - break; - } - } - - this.NTRConnection.Disconnect(); - } - - private bool ShouldSkipPacket(byte[] Buffer) - { - if (System.Text.Encoding.Default.GetString(Buffer).Equals("finished")) //Finshed writing memory - { - return true; - } - return false; - } - - int ReadBasePacket(byte[] Buffer) - { - return ReadBasePacket(Buffer, false); - } - - int ReadBasePacket(byte[] Buffer, bool MainLoop) - { - int Read = 0; - int Position = this.NTRConnection.Client.GetStream().Read(Buffer, 0, Buffer.Length); - if (Position == 0) - { - return 0; - } - if (MainLoop) - { - if (ShouldSkipPacket(Buffer)) - { - return Read; - } - } - while (Position < Buffer.Length) - { - if (this.NTRConnection.ProgressReadMax > 0) - { - this.NTRConnection.ProgressRead = (uint)Position; - } - Read = this.NTRConnection.Client.GetStream().Read(Buffer, Position, Buffer.Length - Position); - if (Read == 0) - { - return 0; - } - Position += Read; - DataRead = (uint)Position; - } - DataRead = (uint)Position; - return Position; - } - - private void ReadExtraData(uint Command, uint Sequence, uint DataLength) - { - if (Sequence == this.NTRConnection.LastListProcessesSequence + 1000) - { - ReadProcessesPacket(DataLength); - } - else if (Sequence == this.NTRConnection.LastListMemoryRegionsSequence + 1000) - { - ReadAddressesPacket(DataLength); - } - else if (Sequence == this.NTRConnection.LastReadMemorySequence) //For some reason, not +1000? - { - ReadMemoryPacket(DataLength); - } - else - { - switch (Command) - { - default: - ReadBasePacket(new byte[DataLength]); - break; - } - } - } - - private void ReadProcessesPacket(uint DataLength) - { - this.NTRConnection.Processes.Clear(); - byte[] Buffer = new byte[DataLength]; - ReadBasePacket(Buffer); - string BufferText = System.Text.Encoding.Default.GetString(Buffer); - BufferText = BufferText.Replace("rtRecvSocket failed: 00000000", ""); - //Line format: - //pid: 0x00000029, pname: ro, tid: 0004013000003702, kpobj: fff7b5f8 - //Split on comma, then split KV on `: `, trim both key and value - foreach (string Line in BufferText.Split('\n')) - { - if (!Line.StartsWith("pid")) - { - continue; - } - string[] KVStrings = Line.Split(','); - string ProcessID = KVStrings[0].Split(new String[] { ": " }, StringSplitOptions.None)[1].Trim().Substring(2); - string ProcessName = KVStrings[1].Split(new String[] { ": " }, StringSplitOptions.None)[1].Trim(); - string TitleID = KVStrings[2].Split(new String[] { ": " }, StringSplitOptions.None)[1].Trim(); - XmlNode Node = null; - if (ProcessName.Equals("hid")) - { - NTRConnection.HardwarePID = ProcessID; - } - - if (NTRConnection.ReleasesDocument != null) - { - Node = NTRConnection.ReleasesDocument.DocumentElement.SelectSingleNode("/releases/release[translate(./titleid, 'ABCDEF', 'abcdef') = '" + TitleID.ToLower() + "']/name"); - } - - if (Node != null) - { - this.NTRConnection.Processes.Add(ProcessID + "|" + Node.InnerText); - } - else - { - this.NTRConnection.Processes.Add(ProcessID + "|" + ProcessName + "," + TitleID); - } - } - - if (this.NTRConnection.Processes.Count > 0) - { - //Bubble processes we ID'd to the top - List TempProcesses = this.NTRConnection.Processes.FindAll(x => x.Contains(',')); - this.NTRConnection.Processes.RemoveAll(x => TempProcesses.Contains(x)); - foreach (string Process in TempProcesses) - { - this.NTRConnection.Processes.Add(Process); - } - - this.NTRConnection.IsProcessListUpdated = true; - } - } - - private void ReadAddressesPacket(uint DataLength) - { - Dictionary AddressSpaces = new Dictionary(); - byte[] Buffer = new byte[DataLength]; - ReadBasePacket(Buffer); - string BufferText = System.Text.Encoding.Default.GetString(Buffer); - BufferText = BufferText.Replace("rtRecvSocket failed: 00000000", ""); - //Line format: - //00100000 - 0093cfff , size: 0083d000 - //Split on comma, then split on ` - ` for address start and `: ` for size - foreach (string Line in BufferText.Split('\n')) - { - if (!Line.Contains("size")) - { - continue; - } - string[] Parts = Line.Split(new String[] { " , " }, StringSplitOptions.None); - string StartString = Parts[0].Split(new String[] { " - " }, StringSplitOptions.None)[0].Trim().PadLeft(8, '0'); - string SizeString = Parts[1].Split(new String[] { ": " }, StringSplitOptions.None)[1].Trim().PadLeft(8, '0'); - uint Start = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(StartString).Reverse().ToArray(), 0); - uint Size = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(SizeString).Reverse().ToArray(), 0); - - AddressSpaces.Add(Start, Size); - } - - if (AddressSpaces.Count > 0) - { - this.NTRConnection.AddressSpaces = new Dictionary(AddressSpaces); - - this.NTRConnection.IsMemoryListUpdated = true; - } - } - - private void ReadMemoryPacket(uint DataLength) - { - this.NTRConnection.ProgressReadMax = this.NTRConnection.ProgressScanMax = DataLength; - if (DataLength < NTRConnection.SearchCriteria[0].Size) - { - NTRConnection.SearchCriteria[0].SearchComplete = true; - return; - } - - byte[] Buffer = new byte[DataLength]; - byte[] TemporaryBuffer = new byte[NTRConnection.SearchCriteria[0].Size]; - - DataRead = 0; - - Thread MemoryScanThread = new Thread(delegate() - { - uint RealAddress; - for (uint i = 0; i <= DataLength - NTRConnection.SearchCriteria[0].Size; ++i) - { - if (DataRead < i + NTRConnection.SearchCriteria[0].Size) - { - --i; - Thread.Sleep(50); - continue; - } - this.NTRConnection.ProgressScan = i; - RealAddress = (uint)(NTRConnection.SearchCriteria[0].StartAddress + i); - if (NTRConnection.SearchCriteria[0].FirstSearch || NTRConnection.SearchCriteria[0].AddressesFound.ContainsKey(RealAddress)) - { - Array.Copy(Buffer, i, TemporaryBuffer, 0, TemporaryBuffer.Length); - if (CheckCriteria(RealAddress, TemporaryBuffer)) - { - NTRConnection.SearchCriteria[0].AddressesFound.Remove(RealAddress); - NTRConnection.SearchCriteria[0].AddressesFound.Add(RealAddress, (byte[])TemporaryBuffer.Clone()); - } - else - { - NTRConnection.SearchCriteria[0].AddressesFound.Remove(RealAddress); - } - } - } - }); - - MemoryScanThread.Start(); - - ReadBasePacket(Buffer); - - MemoryScanThread.Join(); - - DataRead = 0; - - this.NTRConnection.SetCurrentOperationText = "Scanning Read Memory"; - - NTRConnection.SearchCriteria[0].SearchComplete = true; - this.NTRConnection.ProgressReadMax = this.NTRConnection.ProgressScanMax = this.NTRConnection.ProgressRead = this.NTRConnection.ProgressScan = 0; - } - - #endregion - - #region ReadMemoryPacket Helpers - - private bool CheckCriteria(uint RealAddress, byte[] RemoteValue) - { - switch (NTRConnection.SearchCriteria[0].SearchType) - { - case SearchTypeBase.Exact: - return Enumerable.SequenceEqual(NTRConnection.SearchCriteria[0].SearchValue, RemoteValue); - case SearchTypeBase.Range: - IComparable valc = GetValueFromByteArray(RemoteValue); - IComparable vall = GetValueFromByteArray(NTRConnection.SearchCriteria[0].SearchValue); - IComparable valh = GetValueFromByteArray(NTRConnection.SearchCriteria[0].SearchValue2); - if (vall.CompareTo(valh) > 0) - { - IComparable tmp = vall; - vall = valh; - valh = tmp; - } - return vall.CompareTo(valc) <= 0 && valc.CompareTo(valh) <= 0; - case SearchTypeBase.IncreasedBy: - if (!NTRConnection.SearchCriteria[0].AddressesFound.ContainsKey(RealAddress)) - { - return false; - } - return IsIncreasedBy(RealAddress, RemoteValue); - return GetValueFromByteArray(NTRConnection.SearchCriteria[0].AddressesFound[RealAddress]).CompareTo(GetValueFromByteArray(RemoteValue)) == BitConverter.ToUInt32(NTRConnection.SearchCriteria[0].SearchValue, 0); - case SearchTypeBase.DecreasedBy: - if (!NTRConnection.SearchCriteria[0].AddressesFound.ContainsKey(RealAddress)) - { - return false; - } - return IsDecreasedBy(RealAddress, RemoteValue); - case SearchTypeBase.Increased: - if (!NTRConnection.SearchCriteria[0].AddressesFound.ContainsKey(RealAddress)) - { - return false; - } - return GetValueFromByteArray(NTRConnection.SearchCriteria[0].AddressesFound[RealAddress]).CompareTo(GetValueFromByteArray(RemoteValue)) < 0; - case SearchTypeBase.Decreased: - if (!NTRConnection.SearchCriteria[0].AddressesFound.ContainsKey(RealAddress)) - { - return false; - } - return GetValueFromByteArray(NTRConnection.SearchCriteria[0].AddressesFound[RealAddress]).CompareTo(GetValueFromByteArray(RemoteValue)) > 0; - case SearchTypeBase.Same: - if (!NTRConnection.SearchCriteria[0].AddressesFound.ContainsKey(RealAddress)) - { - return false; - } - return GetValueFromByteArray(NTRConnection.SearchCriteria[0].AddressesFound[RealAddress]).CompareTo(GetValueFromByteArray(RemoteValue)) == 0; - case SearchTypeBase.Different: - if (!NTRConnection.SearchCriteria[0].AddressesFound.ContainsKey(RealAddress)) - { - return false; - } - return GetValueFromByteArray(NTRConnection.SearchCriteria[0].AddressesFound[RealAddress]).CompareTo(GetValueFromByteArray(RemoteValue)) != 0; - case SearchTypeBase.Unknown: - return true; - default: - throw new InvalidOperationException("Invalid search type " + NTRConnection.SearchCriteria[0].SearchType.ToString() + " passed to NTRPacketReceiverThread.CheckCriteria"); - } - } - - private IComparable GetValueFromByteArray(byte[] Value) - { - switch (NTRConnection.SearchCriteria[0].DataType) - { - case DataTypeExact.Bytes1: - return Value[0]; - case DataTypeExact.Bytes2: - return BitConverter.ToUInt16(Value, 0); - case DataTypeExact.Bytes4: - return BitConverter.ToUInt32(Value, 0); - case DataTypeExact.Bytes8: - return BitConverter.ToUInt64(Value, 0); - case DataTypeExact.Float: - return BitConverter.ToSingle(Value, 0); - case DataTypeExact.Double: - return BitConverter.ToDouble(Value, 0); - default: - throw new InvalidOperationException("Invalid data type " + NTRConnection.SearchCriteria[0].DataType.ToString() + " passed to NTRPacketReceiverThread.GetValueFromByteArray"); - } - } - - private bool IsIncreasedBy(uint RealAddress, byte[] RemoteValue) - { - checked - { - switch (NTRConnection.SearchCriteria[0].DataType) - { - case DataTypeExact.Bytes1: - return NTRConnection.SearchCriteria[0].AddressesFound[RealAddress][0] == - RemoteValue[0] - NTRConnection.SearchCriteria[0].SearchValue[0]; - case DataTypeExact.Bytes2: - return BitConverter.ToUInt16(NTRConnection.SearchCriteria[0].AddressesFound[RealAddress], 0) == - BitConverter.ToUInt16(RemoteValue, 0) - BitConverter.ToUInt16(NTRConnection.SearchCriteria[0].SearchValue, 0); - case DataTypeExact.Bytes4: - return BitConverter.ToUInt32(NTRConnection.SearchCriteria[0].AddressesFound[RealAddress], 0) == - BitConverter.ToUInt32(RemoteValue, 0) - BitConverter.ToUInt32(NTRConnection.SearchCriteria[0].SearchValue, 0); - case DataTypeExact.Bytes8: - return BitConverter.ToUInt64(NTRConnection.SearchCriteria[0].AddressesFound[RealAddress], 0) == - BitConverter.ToUInt64(RemoteValue, 0) - BitConverter.ToUInt64(NTRConnection.SearchCriteria[0].SearchValue, 0); - case DataTypeExact.Float: - return IsLessThan(BitConverter.ToSingle(NTRConnection.SearchCriteria[0].AddressesFound[RealAddress], 0), - BitConverter.ToSingle(RemoteValue, 0) + BitConverter.ToSingle(NTRConnection.SearchCriteria[0].SearchValue, 0)); - case DataTypeExact.Double: - return IsLessThan(BitConverter.ToDouble(NTRConnection.SearchCriteria[0].AddressesFound[RealAddress], 0), - BitConverter.ToDouble(RemoteValue, 0) + BitConverter.ToDouble(NTRConnection.SearchCriteria[0].SearchValue, 0)); - default: - throw new InvalidOperationException("Invalid data type " + NTRConnection.SearchCriteria[0].DataType.ToString() + " passed to NTRPacketReceiverThread.GetValueFromByteArray"); - } - } - } - - private bool IsDecreasedBy(uint RealAddress, byte[] RemoteValue) - { - checked - { - switch (NTRConnection.SearchCriteria[0].DataType) - { - case DataTypeExact.Bytes1: - return NTRConnection.SearchCriteria[0].AddressesFound[RealAddress][0] == - RemoteValue[0] + NTRConnection.SearchCriteria[0].SearchValue[0]; - case DataTypeExact.Bytes2: - return BitConverter.ToUInt16(NTRConnection.SearchCriteria[0].AddressesFound[RealAddress], 0) == - BitConverter.ToUInt16(RemoteValue, 0) + BitConverter.ToUInt16(NTRConnection.SearchCriteria[0].SearchValue, 0); - case DataTypeExact.Bytes4: - return BitConverter.ToUInt32(NTRConnection.SearchCriteria[0].AddressesFound[RealAddress], 0) == - BitConverter.ToUInt32(RemoteValue, 0) + BitConverter.ToUInt32(NTRConnection.SearchCriteria[0].SearchValue, 0); - case DataTypeExact.Bytes8: - return BitConverter.ToUInt64(NTRConnection.SearchCriteria[0].AddressesFound[RealAddress], 0) == - BitConverter.ToUInt64(RemoteValue, 0) + BitConverter.ToUInt64(NTRConnection.SearchCriteria[0].SearchValue, 0); - case DataTypeExact.Float: - return IsGreaterThan(BitConverter.ToSingle(NTRConnection.SearchCriteria[0].AddressesFound[RealAddress], 0), - BitConverter.ToSingle(RemoteValue, 0) + BitConverter.ToSingle(NTRConnection.SearchCriteria[0].SearchValue, 0)); - case DataTypeExact.Double: - return IsGreaterThan(BitConverter.ToDouble(NTRConnection.SearchCriteria[0].AddressesFound[RealAddress], 0), - BitConverter.ToDouble(RemoteValue, 0) + BitConverter.ToDouble(NTRConnection.SearchCriteria[0].SearchValue, 0)); - default: - throw new InvalidOperationException("Invalid data type " + NTRConnection.SearchCriteria[0].DataType.ToString() + " passed to NTRPacketReceiverThread.GetValueFromByteArray"); - } - } - } - - #endregion - - #region Handle comparison of precision numbers (float, double) - - private bool IsLessThan(float Left, float Right) - { - checked - { - return Left < Right + float.Epsilon; - } - } - private bool IsGreaterThan(float Left, float Right) - { - checked - { - return Left + float.Epsilon > Right; - } - } - private bool IsLessThan(double Left, double Right) - { - checked - { - return Left < Right + double.Epsilon; - } - } - private bool IsGreaterThan(double Left, double Right) - { - checked - { - return Left + double.Epsilon > Right; - } - } - - #endregion - } -} diff --git a/tmp/NTRDebuggerTool/Remote/NTRRemoteConnection.cs b/tmp/NTRDebuggerTool/Remote/NTRRemoteConnection.cs deleted file mode 100644 index 73e875b..0000000 --- a/tmp/NTRDebuggerTool/Remote/NTRRemoteConnection.cs +++ /dev/null @@ -1,384 +0,0 @@ -using NTRDebuggerTool.Objects; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Net.Sockets; -using System.Threading; -using System.Xml; - -namespace NTRDebuggerTool.Remote -{ - public class NTRRemoteConnection - { - private static readonly log4net.ILog LOGGER = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #region Members - - public string HardwarePID = null; - - public String IP { get; set; } - public Int16 Port { get; set; } - - public Dictionary AddressSpaces; - - public uint ProgressRead = 0; - public uint ProgressReadMax = 0; - - public uint ProgressScan = 0; - public uint ProgressScanMax = 0; - - internal TcpClient Client; - - private uint Sequence = 0u; - - private object SendLock = new object(); - private object ReceiveLock = new object(); - public bool LockControls = false; - public bool IsConnected = false; - public bool IsProcessListUpdated = false; - public bool IsMemoryListUpdated = false; - - private long LastHeartbeat = 0; - - internal uint LastListProcessesSequence = 0u; - internal uint LastListMemoryRegionsSequence = 0u; - internal uint LastReadMemorySequence = 0u; - - private Thread PacketThread = null; - internal bool CanSendHeartbeat = true; - public List Processes = new List(); - - public string SetCurrentOperationText = ""; - public string SetCurrentOperationText2 = ""; - private NTRPacketReceiverThread PacketReceiverThread; - - internal XmlDocument ReleasesDocument; - public List SearchCriteria = new List(); - private Stopwatch SearchTimerStopwatch = new Stopwatch(); - - #endregion - - #region Constructor - - public NTRRemoteConnection() - { - this.PacketReceiverThread = new NTRPacketReceiverThread(this); - try - { - this.ReleasesDocument = new XmlDocument(); - ReleasesDocument.Load(File.OpenRead(Path.GetTempPath() + "3dsreleases.xml")); - } - catch (Exception e) - { - LOGGER.Error(null, e); - this.ReleasesDocument = null; - } - } - - #endregion - - #region Connection Management - - public bool Connect() - { - if (Client != null) - { - bool Disconnected = false; - try - { - if (Client.Connected) - { - if (!SendHeartbeatPacket(true)) - { - Disconnected = true; - } - } - else - { - Disconnected = true; - } - } - catch (Exception e) - { - LOGGER.Error(null, e); - Disconnected = true; - } - if (Disconnected) - { - Disconnect(); - } - } - if (Client == null) - { - try - { - Client = new TcpClient(); - Client.NoDelay = true; - IAsyncResult res = Client.BeginConnect(IP, Port, null, null); - if (!res.AsyncWaitHandle.WaitOne(TimeSpan.FromMilliseconds(Config.ConnectTimeout))) - { - Client.Close(); - Client = null; - throw new Exception("Connect timeout"); - } - Client.EndConnect(res); - PacketThread = new Thread(new ThreadStart(this.PacketReceiverThread.ThreadReceivePackets)); - PacketThread.Name = "ReadPacketsThread"; - PacketThread.Start(); - IsConnected = true; - CanSendHeartbeat = true; - SendHeartbeatPacket(true); - } - catch (Exception e) - { - LOGGER.Error(null, e); - return false; - } - } - return true; - } - - public void Disconnect() - { - try - { - if (Client != null) - { - Client.Close(); - } - if (PacketThread != null) - { - PacketThread.Abort(); - } - } - catch (Exception e) - { - LOGGER.Error(null, e); - } - Client = null; - IsConnected = false; - HardwarePID = null; - } - - #endregion - - #region Sending Packets - - public void SendWriteMemoryPacket(uint ProcessID, uint Address, byte Value) - { - SendWriteMemoryPacket(ProcessID, Address, new byte[] { Value }); - } - - public void SendWriteMemoryPacket(uint ProcessID, uint Address, ushort Value) - { - SendWriteMemoryPacket(ProcessID, Address, BitConverter.GetBytes(Value)); - } - - public void SendWriteMemoryPacket(uint ProcessID, uint Address, uint Value) - { - SendWriteMemoryPacket(ProcessID, Address, BitConverter.GetBytes(Value)); - } - - public void SendWriteMemoryPacket(uint ProcessID, uint Address, ulong Value) - { - SendWriteMemoryPacket(ProcessID, Address, BitConverter.GetBytes(Value)); - } - - public void SendWriteMemoryPacket(uint ProcessID, uint Address, float Value) - { - SendWriteMemoryPacket(ProcessID, Address, BitConverter.GetBytes(Value)); - } - - public void SendWriteMemoryPacket(uint ProcessID, uint Address, double Value) - { - SendWriteMemoryPacket(ProcessID, Address, BitConverter.GetBytes(Value)); - } - - public void SendWriteMemoryPacket(uint ProcessID, uint Address, byte[] Values) - { - this.SendPacket(PacketType.GeneralMemory, PacketCommand.Write, new uint[] { BitConverter.ToUInt32(BitConverter.GetBytes(ProcessID).Reverse().ToArray(), 0), Address, (uint)Values.Length }, Values); - } - - public void SendReadMemoryPacket(SearchCriteria NewSearchCriteria) - { - if (!NewSearchCriteria.HideSearch) - { - this.LockControls = true; - } - while (SearchCriteria[0] != NewSearchCriteria) - { - Thread.Sleep(10); - } - SearchTimerStopwatch.Start(); - SendReadMemoryPacketPre(); - SearchTimerStopwatch.Stop(); - NewSearchCriteria.Duration = (uint)SearchTimerStopwatch.ElapsedMilliseconds; - SearchTimerStopwatch.Reset(); - if (!NewSearchCriteria.HideSearch) - { - this.LockControls = false; - } - } - - private void SendReadMemoryPacketPre() - { - SearchCriteria[0].AllSearchesComplete = false; - if (SearchCriteria[0].AddressesFound.Count > 0 && (SearchCriteria[0].AddressesFound.Count < 200 || SearchCriteria[0].StartAddress == uint.MaxValue)) - { - uint TempAddress = SearchCriteria[0].StartAddress; - uint TempLength = SearchCriteria[0].Length; - SearchCriteria[0].Length = (uint)SearchCriteria[0].AddressesFound[SearchCriteria[0].AddressesFound.Keys.First()].Length; - //Clone the list to an array to prevent concurrent modification - foreach (uint Address in new List(SearchCriteria[0].AddressesFound.Keys)) - { - SearchCriteria[0].SearchComplete = false; - SearchCriteria[0].StartAddress = Address; - SendReadMemoryPacket(); - } - SearchCriteria[0].Length = TempLength; - SearchCriteria[0].StartAddress = TempAddress; - } - else if (SearchCriteria[0].StartAddress == uint.MaxValue) - { - foreach (uint ActualAddressSpace in AddressSpaces.Keys) - { - SearchCriteria[0].StartAddress = ActualAddressSpace; - SearchCriteria[0].Length = AddressSpaces[ActualAddressSpace]; - SearchCriteria[0].SearchComplete = false; - SendReadMemoryPacket(); - } - SearchCriteria[0].StartAddress = uint.MaxValue; - SearchCriteria[0].Length = uint.MaxValue; - } - else - { - SearchCriteria[0].SearchComplete = false; - SendReadMemoryPacket(); - } - SearchCriteria[0].AllSearchesComplete = SearchCriteria[0].SearchComplete = true; - SearchCriteria[0].FirstSearch = false; - SearchCriteria.RemoveAt(0); - } - - private void SendReadMemoryPacket() - { - if (!SearchCriteria[0].HideSearch) - { - SetCurrentOperationText = "Searching Memory " + Utilities.GetStringFromByteArray(BitConverter.GetBytes(SearchCriteria[0].StartAddress).Reverse().ToArray()) + " - " + Utilities.GetStringFromByteArray(BitConverter.GetBytes(SearchCriteria[0].StartAddress + SearchCriteria[0].Length).Reverse().ToArray()); - } - - this.SendPacket(PacketType.General, PacketCommand.Read, new uint[] { BitConverter.ToUInt32(BitConverter.GetBytes(SearchCriteria[0].ProcessID).Reverse().ToArray(), 0), SearchCriteria[0].StartAddress, SearchCriteria[0].Length }); - while (SearchCriteria[0].SearchComplete != true) - { - Thread.Sleep(100); - } - if (!SearchCriteria[0].HideSearch) - { - SetCurrentOperationText = ""; - } - } - public void SendListProcessesPacket() - { - this.SendPacket(PacketType.General, PacketCommand.ListProcesses, null); - } - - public void SendReadMemoryAddressesPacket(string ProcessID) - { - uint ActualProcessID = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(ProcessID).Reverse().ToArray(), 0); - this.SendPacket(PacketType.General, PacketCommand.ListAddresses, new uint[1] { ActualProcessID }); - } - - public void sendReloadPacket() - { - this.SendPacket(PacketType.General, PacketCommand.Reload, null); - } - - public void SendHelloPacket() - { - this.SendPacket(PacketType.General, PacketCommand.Hello, null); - } - - public bool SendHeartbeatPacket() - { - return SendHeartbeatPacket(false); - } - - public bool SendHeartbeatPacket(bool IsConnecting) - { - if (IsConnecting || this.Client != null) - { - if (IsConnecting || (this.Client != null && this.Client.Connected)) - { - if (CanSendHeartbeat && LastHeartbeat < (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) - 30000) - { - CanSendHeartbeat = false; - LastHeartbeat = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond; - try - { - SendPacket(PacketType.General, PacketCommand.Heartbeat, null); - return true; - } - catch (Exception e) - { - LOGGER.Error(null, e); - } - } - } - } - return false; - } - - private void SendPacket(uint Type, uint Command, uint[] Arguments) - { - SendPacket(Type, Command, Arguments, new byte[0]); - } - - private void SendPacket(uint Type, uint Command, uint[] Arguments, byte[] AdditionalData) - { - lock (this.SendLock) - { - int num = 0; - byte[] array = new byte[84]; - Array.Clear(array, 0, 84); //Force to zero - BitConverter.GetBytes(0x12345678).CopyTo(array, num); - BitConverter.GetBytes(this.Sequence += 1000u).CopyTo(array, num += 4); - SetPacketSequence(Type, Command); - BitConverter.GetBytes(Type).CopyTo(array, num += 4); - BitConverter.GetBytes(Command).CopyTo(array, num += 4); - if (Arguments != null) - { - for (int i = 0; i < 16 && i < Arguments.Length; i++) - { - BitConverter.GetBytes(Arguments[i]).CopyTo(array, num += 4); - } - } - - BitConverter.GetBytes(AdditionalData.Length).CopyTo(array, array.Length - 4); - this.Client.GetStream().Write(array, 0, array.Length); - if (AdditionalData.Length > 0u) - { - this.Client.GetStream().Write(AdditionalData, 0, AdditionalData.Length); - } - } - } - - private void SetPacketSequence(uint Type, uint Command) - { - if (Type == PacketType.General && Command == PacketCommand.ListProcesses) - { - LastListProcessesSequence = Sequence; - } - else if (Type == PacketType.General && Command == PacketCommand.ListAddresses) - { - LastListMemoryRegionsSequence = Sequence; - } - else if (Type == PacketType.General && Command == PacketCommand.Read) - { - LastReadMemorySequence = Sequence; - } - } - - #endregion - } -} diff --git a/tmp/NTRDebuggerTool/Remote/PacketCommand.cs b/tmp/NTRDebuggerTool/Remote/PacketCommand.cs deleted file mode 100644 index f0127fb..0000000 --- a/tmp/NTRDebuggerTool/Remote/PacketCommand.cs +++ /dev/null @@ -1,17 +0,0 @@ - -namespace NTRDebuggerTool.Remote -{ - static class PacketCommand - { - //General - public const uint Heartbeat = 0u; - public const uint Hello = 3u; - public const uint Reload = 4u; - public const uint ListProcesses = 5u; - - //Memory - public const uint ListAddresses = 8u; - public const uint Read = 9u; - public const uint Write = 10u; - } -} diff --git a/tmp/NTRDebuggerTool/Remote/PacketType.cs b/tmp/NTRDebuggerTool/Remote/PacketType.cs deleted file mode 100644 index 958d122..0000000 --- a/tmp/NTRDebuggerTool/Remote/PacketType.cs +++ /dev/null @@ -1,9 +0,0 @@ - -namespace NTRDebuggerTool.Remote -{ - static class PacketType - { - public const uint General = 0u; - public const uint GeneralMemory = 1u; - } -} diff --git a/tmp/NTRDebuggerTool/Resources/cog2.png b/tmp/NTRDebuggerTool/Resources/cog2.png deleted file mode 100644 index e510e52..0000000 Binary files a/tmp/NTRDebuggerTool/Resources/cog2.png and /dev/null differ diff --git a/tmp/NTRDebuggerTool/Resources/log4net.dll b/tmp/NTRDebuggerTool/Resources/log4net.dll deleted file mode 100644 index 9a653d6..0000000 Binary files a/tmp/NTRDebuggerTool/Resources/log4net.dll and /dev/null differ diff --git a/tmp/NTRDebuggerTool/Utilities.cs b/tmp/NTRDebuggerTool/Utilities.cs deleted file mode 100644 index 909e57b..0000000 --- a/tmp/NTRDebuggerTool/Utilities.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Linq; - -namespace NTRDebuggerTool -{ - static class Utilities - { - public static byte[] GetByteArrayFromByteString(string Text) - { - return Enumerable.Range(0, Text.Length) - .Where(x => x % 2 == 0) - .Select(x => Convert.ToByte(Text.Substring(x, 2), 16)) - .ToArray(); - } - - public static string GetStringFromByteArray(byte[] Buffer) - { - return BitConverter.ToString(Buffer).Replace("-", ""); - } - - } -} diff --git a/tmp/NTRDebuggerTool/packages.config b/tmp/NTRDebuggerTool/packages.config deleted file mode 100644 index 8c1f1bf..0000000 --- a/tmp/NTRDebuggerTool/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/tmp/README.md b/tmp/README.md deleted file mode 100644 index 035331a..0000000 --- a/tmp/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# NTRRemoteDebugger -Tool to interface with NTR CFW's remote debugging. - -# Features - -* Nice GUI for searching for memory addresses and modifying them. -* No messing about with files or other external resources. -* Allows searching for byte, short, int, long, float, double, list of bytes, and text strings. -* Subsequent searches will narrow search results by only requesting the memory addresses needed, speeding up things significantly. -* Ability to "lock" memory addresses to a given value. This means that they are set automatically based on a configured value. -* Can convert AR3DS codes to work with the tool. -* Works on mono and via wine. Thanks to u/Melon__Bread for verifying mono support (and MonoDevelop compile support) and u/MattKimura for verifying wine support. - -# Untested - -* Search for float, double, and raw bytes. - -# Notes - -* Editing items in the bottom-right grid (the 'Values' grid) requires double clicking. This is strange behavior for the checkbox and dropdown cells. -* The first half of the progress bar at the bottom is for receiving memory values from the 3DS. The second half is for searching for the value. -* The progress bar does not work for narrowing search results, just be patient. It's about 1/3rd of a second per result check for me. -* NTR's performance seems to degrade over time if the connection gets interrupted at all. I find that after about 10 interrupted connections, I have to reboot my 3DS to get NTR's Debugger to start responding properly again. Apparently running [NTR 3.3 fork](https://github.com/Shadowtrance/BootNTR) from Shadowtrance with the 3.2 ntr.bin (same repo) is better for stability and also works on 10.6.