docs.rs failed to build moon-windows-symbols-0.1.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
moon-windows-symbols
Windows 平台下载并解析微软公开符号(PDB),获取函数 RVA 或内核绝对地址的 Rust 库。支持内核模块、win32k.sys、CI.dll 等。
安装
cargo add moon-windows-symbols
环境要求
- 仅支持 Windows
- 系统可用
dbghelp.dll与symsrv.dll - 默认使用微软符号服务器
https://msdl.microsoft.com/download/symbols - 支持系统代理:优先读取
HTTPS_PROXY/HTTP_PROXY环境变量,其次读取 Windows 代理设置
快速开始
use Symbols;
// 单符号 RVA
let rva = rva_from_file?;
// 批量 RVA
let map = rvas_from_file?;
// 内核绝对地址(需可获取基址的模块)
let addr = kernel_address?;
PDB 预下载与缓存校验
// 预下载指定模块 PDB(下载后立即校验可解析)
let file = prefetch_pdb?;
// 判断指定模块 PDB 是否已缓存且可解析
let cached = is_pdb_cached?;
完整性与校验
- 下载采用临时文件写入(
.part),完成后原子重命名,避免半成品被误判为已缓存 - 若响应包含
Content-Length,将进行字节数比对,不一致则删除临时文件并报错 - 下载后立即尝试以
pdbcrate 打开验证;失败会删除文件并返回错误 is_pdb_cached判定为“已缓存”必须同时满足“存在且可解析”,否则自动清理残缺文件
测试
- 基础单元测试可直接运行:
cargo test - 依赖网络与符号服务器的集成测试默认
#[ignore],在具备环境时运行:cargo test -- --ignored
许可
MIT License