Skip to content

Commit

Permalink
Added project files
Browse files Browse the repository at this point in the history
  • Loading branch information
valarnin committed Feb 8, 2016
1 parent 415c1a7 commit 8e675e3
Show file tree
Hide file tree
Showing 18 changed files with 2,514 additions and 0 deletions.
20 changes: 20 additions & 0 deletions NTRDebuggerTool.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

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
EndGlobal
6 changes: 6 additions & 0 deletions NTRDebuggerTool/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
556 changes: 556 additions & 0 deletions NTRDebuggerTool/Forms/MainForm.Designer.cs

Large diffs are not rendered by default.

461 changes: 461 additions & 0 deletions NTRDebuggerTool/Forms/MainForm.cs

Large diffs are not rendered by default.

314 changes: 314 additions & 0 deletions NTRDebuggerTool/Forms/MainForm.resx

Large diffs are not rendered by default.

134 changes: 134 additions & 0 deletions NTRDebuggerTool/Forms/MainFormThreadEventDispatcher.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
using System;
using System.Linq;
using System.Threading;

namespace NTRDebuggerTool.Forms
{
class MainFormThreadEventDispatcher
{
internal bool DispatchConnect = false;
internal bool DispatchOpenProcess = false;
internal bool DispatchSearch = false;

internal string CurrentSelectedProcess = "";
internal string CurrentMemoryRange = "";
internal int CurrentSelectedDataType = 2;
private MainForm Form;

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();
}

Thread.Sleep(100);
}
}

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);
if (Form.NTRConnection.Connect())
{
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";
Form.NTRConnection.SendReadMemoryAddressesPacket(CurrentSelectedProcess.Split('|')[0]);
}

private void DoSearch()
{
Form.NTRConnection.SetCurrentOperationText = "Searching Memory";
uint ProcessID = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(CurrentSelectedProcess.Split('|')[0]), 0);
uint StartAddress, MemorySize;
if (CurrentMemoryRange.Equals("All"))
{
StartAddress = MemorySize = uint.MaxValue;
}
else
{
StartAddress = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Form.MemoryStart.Text).Reverse().ToArray(), 0);
MemorySize = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Form.MemorySize.Text).Reverse().ToArray(), 0);
}

if (Form.ResultsGrid.Rows.Count > 0 || Form.NTRConnection.AddressesFound.Count > 0)
{
MemorySize = Form.GetSearchMemorySize();
}

switch (CurrentSelectedDataType)
{
case 0: //1 Byte
Form.NTRConnection.SendReadMemoryPacket(ProcessID, StartAddress, MemorySize, (byte)uint.Parse(Form.SearchValue.Text));
break;
case 1: //2 Bytes
Form.NTRConnection.SendReadMemoryPacket(ProcessID, StartAddress, MemorySize, ushort.Parse(Form.SearchValue.Text));
break;
case 2: //4 Bytes
Form.NTRConnection.SendReadMemoryPacket(ProcessID, StartAddress, MemorySize, uint.Parse(Form.SearchValue.Text));
break;
case 3: //8 Bytes
Form.NTRConnection.SendReadMemoryPacket(ProcessID, StartAddress, MemorySize, ulong.Parse(Form.SearchValue.Text));
break;
case 4: //Float
Form.NTRConnection.SendReadMemoryPacket(ProcessID, StartAddress, MemorySize, float.Parse(Form.SearchValue.Text));
break;
case 5: //Double
Form.NTRConnection.SendReadMemoryPacket(ProcessID, StartAddress, MemorySize, double.Parse(Form.SearchValue.Text));
break;
case 6: //Raw Bytes
Form.NTRConnection.SendReadMemoryPacket(ProcessID, StartAddress, MemorySize, Utilities.GetByteArrayFromByteString(Form.SearchValue.Text));
break;
}
Form.ControlEnabledSearchButton = true;
}
}
}
94 changes: 94 additions & 0 deletions NTRDebuggerTool/NTRDebuggerTool.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{86AF1318-9584-4CDE-93BC-C2F0DCF958C5}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NTRDebuggerTool</RootNamespace>
<AssemblyName>NTRDebuggerTool</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Forms\MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\MainFormThreadEventDispatcher.cs" />
<Compile Include="Remote\NTRPacketReceiverThread.cs" />
<Compile Include="Remote\NTRRemoteConnection.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Remote\PacketCommand.cs" />
<Compile Include="Remote\PacketType.cs" />
<Compile Include="Utilities.cs" />
<EmbeddedResource Include="Forms\MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
21 changes: 21 additions & 0 deletions NTRDebuggerTool/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using NTRDebuggerTool.Forms;
using NTRDebuggerTool.Remote;
using System;
using System.Windows.Forms;

namespace NTRDebuggerTool
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm(new NTRRemoteConnection()));
}
}
}
35 changes: 35 additions & 0 deletions NTRDebuggerTool/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("NTRDebuggerTool")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NTRDebuggerTool")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("290cd39f-c191-4212-9985-0584c9200acc")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.7.0.0")]
[assembly: AssemblyFileVersion("0.7.0.0")]
71 changes: 71 additions & 0 deletions NTRDebuggerTool/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8e675e3

Please sign in to comment.