实现了
1.搜索汇编上的地址
2.搜索匹配特征的内存地址
3.搜索到的地址再做+法计算,还没做读取内存指针,是直接16进制加法
4.支持通配符(就是用正则表达式来做的)
现在还不是很完善,因为一边学一边做,总觉得欠缺了啥,一些地方还得优化,先上图,过几天放源码
搜索界面:
搜索结果图:搜索运用了线程同时处理,用时单位是毫秒
生成规则界面:
这一版本的操作类:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading;
using System.Diagnostics;
using System.Text.RegularExpressions;
using System.ComponentModel;
using System.Globalization;
using System.Reflection;
public class Scan
{
/// <summary>
/// 所有需要扫描的列表
/// </summary>
private List<ScanCode> _scode;
public List<ScanCode> scode
{
get { return this._scode; }
set { this._scode = value; }
}
/// <summary>
/// 打开文件的byte[]数组
/// </summary>
private byte[] _fileBytes;
public byte[] fileBytes
{
get { return this._fileBytes; }
}
/// <summary>
/// 打开文件的16进制全字符串
/// </summary>
private string _fileHex;
public string fileHex
{
get { return this._fileHex; }
}
/// <summary>
/// 文件流的起始十六进制
/// </summary>
private int _beginHex;
public int beginHex
{
get { return this._beginHex; }
set { this._beginHex = value; }
}
/// <summary>
/// 文件缓冲区大小
/// </summary>
private int _bufferSize;
public int bufferSize
{
get { return this._beginHex; }
set { this._beginHex = value; }
}
/// <summary>
/// 当前扫描线程数
/// </summary>
private int _threadCount;
public int threadCount
{
get { return this._threadCount; }
set { this._threadCount = value; }
}
/// <summary>
/// 初始化
/// </summary>
/// <param name="filePath">打开应用程序文件</param>
/// <param name="beginHex">应用程序起始地址</param>
public Scan(string filePath, int beginHex)
{
this._beginHex = beginHex;
this._scode = new List<ScanCode>();
//打开文件
using (FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read))
{
int fsLength = (int)fs.Length;
//读取文件的byte[] 耗时约 1000ms 内
fs.Seek(0, SeekOrigin.Begin);
this._fileBytes = new byte[fsLength];
fs.Read(this._fileBytes, 0, fsLength);
//通过byte[]转成string

博主分享了一款自己开发的内存搜索工具,该工具能够搜索汇编上的地址,匹配特征码的内存地址,并支持使用正则表达式进行通配符搜索。虽然目前功能还有待完善,如未实现读取内存指针,但已具备多线程搜索能力。作者期待社区的优化建议和反馈,并计划后续发布源码和DEMO。
最低0.47元/天 解锁文章
4251





