豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

microsoft/dia-rs

crates.io

Rust for Debug Interface Access (DIA) SDK

The Microsoft Debug Interface Access Software Development Kit (DIA SDK) provides access to debug information stored in program database (.pdb) files generated by Microsoft postcompiler tools.

Start by adding windows-core and microsoft-dia dependencies to Cargo.toml:

[dependencies.windows-core]
version = "0.62"

[dependencies.microsoft-dia]
version = "0.15"

Make use of any DIA SDK APIs as needed.

use microsoft_dia::{nsfRegularExpression, DiaSource, IDiaDataSource, SymTagFunction};
use windows_core::*;

fn main() -> Result<()> {
    unsafe {
        let source: IDiaDataSource = microsoft_dia::helpers::NoRegCoCreate(s!("msdia140.dll"), &DiaSource)?;
        let executable = std::env::current_exe().unwrap();
        source.loadDataForExe(&HSTRING::from(executable.as_os_str()), None, None)?;

        let session = source.openSession()?;
        let symbols = session.globalScope()?.findChildren(SymTagFunction, w!("*"), nsfRegularExpression.0 as u32)?;

        println!("Function symbols found in self: ({}):", &executable.to_string_lossy());

        for i in 0..symbols.Count()? {
            println!("\t{}", symbols.Item(i as u32)?.name()?);
        }

        Ok(())
    }
}

About

Rust for Debug Interface Access (DIA) SDK

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
license-apache-2.0
MIT
license-mit

Code of conduct

Security policy

Stars

Watchers

Forks

Contributors

Languages