dotscope 0.6.0

A high-performance, cross-platform framework for analyzing and reverse engineering .NET PE executables
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Factory methods for AssemblyRef table operations.
//!
//! Contains helper methods migrated from AssemblyRef table source files
//! for creating test data related to assembly reference operations.

use crate::{cilassembly::CilAssembly, metadata::cilassemblyview::CilAssemblyView, Result};
use std::path::PathBuf;

/// Helper function to get a test assembly for AssemblyRef operations
///
/// Originally from: `src/metadata/tables/assemblyref/builder.rs`
pub fn get_test_assembly() -> Result<CilAssembly> {
    let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/samples/WindowsBase.dll");
    let view = CilAssemblyView::from_path(&path)?;
    Ok(CilAssembly::new(view))
}