Skip to content

Commit

Permalink
Updated to 3.5 with code optimizations from Wangtao03's fork.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohoki committed Jan 13, 2020
1 parent 60144a6 commit 8883a0b
Show file tree
Hide file tree
Showing 6 changed files with 504 additions and 345 deletions.
2 changes: 1 addition & 1 deletion PointerSearcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public List<PointerSearcherLog> FindPointers(
address += _memory_start;
if (address > _memory_end)
{
MessageBox.Show("地址值错误,请检查后再次输入。");
MessageBox.Show("Address value is too large, please input a smaller value for the address.");
return pointerSearcherLogList;
}
for (int index = 0; index < MemoryDump.Length; ++index)
Expand Down
6 changes: 3 additions & 3 deletions PointerSearcherLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public PointerSearcherLog(

public PointerSearcherLog(string s, uint memory_start)
{
var match = new Regex("地址:\\s*0x(.*);\\s*偏移:\\s*(-?)0x(.*);\\s*数值:\\s*0x(.*);").Match(s);
var match = new Regex("Address:\\s*0x(.*);\\s*Offset:\\s*(-?)0x(.*);\\s*Value:\\s*0x(.*);").Match(s);
Address = uint.Parse(match.Groups[1].Value, NumberStyles.AllowHexSpecifier);
Negative = match.Groups[2].Value == "-";
Offset = uint.Parse(match.Groups[3].Value, NumberStyles.AllowHexSpecifier);
Expand All @@ -40,12 +40,12 @@ public PointerSearcherLog(string s, uint memory_start)

public override string ToString()
{
return $"地址: 0x{Address:X08}; 偏移: {(Negative ? "-" : "")}0x{Offset:X}; 数值: 0x{Value:X08};";
return $"Address: 0x{Address:X08}; Offset: {(Negative ? "-" : "")}0x{Offset:X}; Value: 0x{Value:X08};";
}

public string ToString(uint address_base)
{
return $"地址: 0x{(uint)((int)Address - (int)address_base):X08}; 偏移: {(Negative ? "-" : "")}0x{Offset:X}; 数值: 0x{(uint)((int)Value - (int)address_base):X08};";
return $"Address: 0x{(uint)((int)Address - (int)address_base):X08}; Offset: {(Negative ? "-" : "")}0x{Offset:X}; Value: 0x{(uint)((int)Value - (int)address_base):X08};";
}
}
}
13 changes: 13 additions & 0 deletions Properties/Resources.Designer.cs

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

14 changes: 10 additions & 4 deletions Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace TempAR
public static class Utils
{
/// <summary>
/// Convert DEC to HEX
/// 十六进制地址转10进制数值
/// </summary>
/// <param name="s"></param>
Expand All @@ -19,12 +20,13 @@ public static uint ParseNum(string s)
}

/// <summary>
/// Convert DEC to HEX
/// 十六进制地址转10进制数值
/// </summary>
/// <param name="s"></param>
/// <param name="numstyle"></param>
/// <returns></returns>
public static uint ParseNum(string s, NumberStyles numstyle, string title = "格式错误!")
public static uint ParseNum(string s, NumberStyles numstyle, string title = "Wrong Format!")
{
try
{
Expand All @@ -36,12 +38,13 @@ public static uint ParseNum(string s, NumberStyles numstyle, string title = "格
}
catch (Exception)
{
MessageBox.Show("无法解析,请确保数值为有效的16进制数。", title);
MessageBox.Show("Unable to parse, please make sure the value is a valid hexadecimal number.", title);
return 0;
}
}

/// <summary>
/// Open Directory
/// 打开目录
/// </summary>
/// <param name="defaultdir"></param>
Expand All @@ -63,13 +66,14 @@ public static string OpenDirectory(string defaultdir, string description)
}

/// <summary>
/// Open a File
/// 打开文件
/// </summary>
/// <param name="defaultfile"></param>
/// <param name="filter"></param>
/// <param name="title"></param>
/// <returns></returns>
public static string OpenFile(string defaultfile, string filter = null, string title = "打开")
public static string OpenFile(string defaultfile, string filter = null, string title = "Open file")
{
using (var openFileDialog = new OpenFileDialog
{
Expand All @@ -86,13 +90,14 @@ public static string OpenFile(string defaultfile, string filter = null, string t
}

/// <summary>
/// Save File
/// 保存文件
/// </summary>
/// <param name="defaultfile"></param>
/// <param name="filter"></param>
/// <param name="title"></param>
/// <returns></returns>
public static string SaveFile(string defaultfile, string filter = null, string title = "保存")
public static string SaveFile(string defaultfile, string filter = null, string title = "Save File")
{
using (var saveFileDialog = new SaveFileDialog
{
Expand All @@ -109,6 +114,7 @@ public static string SaveFile(string defaultfile, string filter = null, string t
}

/// <summary>
/// Data Sorting
/// 数据排序
/// </summary>
/// <typeparam name="T"></typeparam>
Expand Down
Loading

0 comments on commit 8883a0b

Please sign in to comment.