forked from erfg12/memory.dll
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,426 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.30517.126 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApplication", "MemoryTestApp\TestApplication.csproj", "{75D0CEA2-0444-4959-B797-91ADD7FD3A4A}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Memory", "..\..\Memory\Memory.csproj", "{D506F6CE-1A4C-4655-809E-928893D45005}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Debug|x64 = Debug|x64 | ||
Release|Any CPU = Release|Any CPU | ||
Release|x64 = Release|x64 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{75D0CEA2-0444-4959-B797-91ADD7FD3A4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{75D0CEA2-0444-4959-B797-91ADD7FD3A4A}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{75D0CEA2-0444-4959-B797-91ADD7FD3A4A}.Debug|x64.ActiveCfg = Debug|x64 | ||
{75D0CEA2-0444-4959-B797-91ADD7FD3A4A}.Debug|x64.Build.0 = Debug|x64 | ||
{75D0CEA2-0444-4959-B797-91ADD7FD3A4A}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{75D0CEA2-0444-4959-B797-91ADD7FD3A4A}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{75D0CEA2-0444-4959-B797-91ADD7FD3A4A}.Release|x64.ActiveCfg = Release|x64 | ||
{75D0CEA2-0444-4959-B797-91ADD7FD3A4A}.Release|x64.Build.0 = Release|x64 | ||
{D506F6CE-1A4C-4655-809E-928893D45005}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{D506F6CE-1A4C-4655-809E-928893D45005}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{D506F6CE-1A4C-4655-809E-928893D45005}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
{D506F6CE-1A4C-4655-809E-928893D45005}.Debug|x64.Build.0 = Debug|Any CPU | ||
{D506F6CE-1A4C-4655-809E-928893D45005}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{D506F6CE-1A4C-4655-809E-928893D45005}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{D506F6CE-1A4C-4655-809E-928893D45005}.Release|x64.ActiveCfg = Release|Any CPU | ||
{D506F6CE-1A4C-4655-809E-928893D45005}.Release|x64.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {CAB30711-FD99-4F6D-B327-4D6A7114C98E} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> | ||
</startup> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="System.Security.Principal.Windows" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-4.1.3.0" newVersion="4.1.3.0" /> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Drawing; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
|
||
namespace TestApplication | ||
{ | ||
public partial class TrainerForm : Form | ||
{ | ||
public bool ProcOpen = false; | ||
|
||
/// <summary> | ||
/// Process opening code. Generates a list of modules too. | ||
/// </summary> | ||
public void OpenTheProc() | ||
{ | ||
if (String.Compare(ProcTypeBox.Text, "Name") == 0) // if combobox set to Name, use string | ||
ProcOpen = m.OpenProcess(ProcTextBox.Text); | ||
else // if combobox set to ID, use integer | ||
ProcOpen = m.OpenProcess(Convert.ToInt32(ProcTextBox.Text)); | ||
|
||
if (ProcOpen) // if process opens successfully | ||
{ | ||
foreach (KeyValuePair<string, IntPtr> kvp in m.modules) // iterate through process module list | ||
{ | ||
string[] arr = new string[4]; | ||
ListViewItem itm; | ||
arr[0] = "0x" + kvp.Value.ToString("x8"); | ||
arr[1] = kvp.Key; | ||
itm = new ListViewItem(arr); | ||
ModuleList.Items.Add(itm); | ||
} | ||
ProcStatus.Text = "Open"; | ||
ProcStatus.ForeColor = Color.Green; | ||
} | ||
else // on process open fail, show error message | ||
{ | ||
MessageBox.Show("ERROR: Process open failed!"); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// For the Read Address feature. Address goes in, value comes out. | ||
/// </summary> | ||
/// <param name="address">address to read from</param> | ||
/// <param name="type">type of value that should be returned</param> | ||
/// <returns></returns> | ||
public string ReadOutput(string address, string type) | ||
{ | ||
string ReadOutput = ""; | ||
|
||
switch (type) | ||
{ | ||
case "string": | ||
ReadOutput = m.ReadString(address); | ||
break; | ||
case "int": | ||
ReadOutput = m.ReadInt(address).ToString(); | ||
break; | ||
case "long": | ||
ReadOutput = m.ReadLong(address).ToString(); | ||
break; | ||
case "byte": | ||
ReadOutput = m.ReadByte(address).ToString(); | ||
break; | ||
case "double": | ||
ReadOutput = m.ReadDouble(address).ToString(); | ||
break; | ||
case "float": | ||
ReadOutput = m.ReadFloat(address).ToString(); | ||
break; | ||
case "UInt": | ||
ReadOutput = m.ReadUInt(address).ToString(); | ||
break; | ||
case "2 byte": | ||
ReadOutput = m.Read2Byte(address).ToString(); | ||
break; | ||
default: | ||
ReadOutput = ""; | ||
break; | ||
} | ||
|
||
return ReadOutput; | ||
} | ||
|
||
// this function is async, which means it does not block other code | ||
public async void SampleAoBScan(string ScanPattern) | ||
{ | ||
if (!ProcOpen) | ||
return; | ||
|
||
IEnumerable<long> AoBScanResults; | ||
|
||
// AoB scan and store it in AoBScanResults. We specify our start and end address regions to decrease scan time. | ||
if (String.Compare(StartAddrBox.Text, "") == 0 || String.Compare(EndAddrBox.Text, "") == 0) | ||
{ | ||
AoBScanResults = await m.AoBScan(ScanPattern, false, true); | ||
} | ||
else | ||
{ | ||
AoBScanResults = await m.AoBScan(Convert.ToInt64(StartAddrBox.Text), Convert.ToInt64(EndAddrBox.Text), ScanPattern, false, true); | ||
} | ||
|
||
// Ex: get the first found address, store it in the variable SingleAoBScanResult | ||
// long SingleAoBScanResult = AoBScanResults.FirstOrDefault(); | ||
|
||
// iterate through each found address. | ||
foreach (long res in AoBScanResults) | ||
{ | ||
string[] arr = new string[4]; | ||
ListViewItem itm; | ||
arr[0] = res.ToString("x8"); | ||
itm = new ListViewItem(arr); | ||
|
||
// because we run this in another thread, we need to invoke the UI thread elements | ||
AobScanList.Invoke((MethodInvoker) delegate | ||
{ | ||
AobScanList.Items.Add(itm); | ||
}); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.