Files
GenericAgent/memory/mem_scanner_sop.md

33 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Memory Scanner SOP
## 1. 快速开始
内存特征搜索工具,支持 Hex (CE 风格) 和 字符串匹配。特别提供 LLM 模式,方便大模型分析内存上下文。
**Python 调用方式:**
```python
import sys
sys.path.append('../memory') # 直接挂载工具目录
from mem_scanner import scan_memory
# 示例:搜索特定 Hex 特征码,开启 llm_mode 以获取上下文
results = scan_memory(pid, "48 8b ?? ?? 00", mode="hex", llm_mode=True)
```
**CLI:**
```powershell
# 基础搜索
python ../memory/mem_scanner.py <PID> "pattern" --mode string
# LLM 增强模式(输出包含上下文的 JSON推荐
python ../memory/mem_scanner.py <PID> "pattern" --llm
```
## 2. 典型场景:结构体或关键数据定位
1. 确定目标数据的前导特征或已知常量(如特定的 Header 或 Magic Number
2. 在目标进程中搜索该特征:
`scan_memory(pid, "4D 5A 90 00", mode="hex", llm_mode=True)`
3. 分析返回的 JSON 中 `context` 字段,查看目标地址前后的原始字节及 ASCII 预览。
## 3. 注意事项
- **权限**: 并非强制要求管理员权限,但需具备对目标进程的 `PROCESS_QUERY_INFORMATION``PROCESS_VM_READ` 权限。
- **效率**: 搜索大块内存时,尽量提供更唯一的特征码以减少误报。