hao/
lib.rs

1//! `hao` is a library for reading and writing .net modules and assemblies in rust.
2//!
3//! Currently, `hao` is quite struct with the binaries it recieved, erroring with malfomed
4//! binaries rather than attempting to ignore the issues. Though the plan is to impliment
5//! a feature flag that can optionally continue parsing the file and expose the raw, non-sanitary
6//! parts that it encounters.
7//!
8//! The current state of this library is read-only with .net framework/core files and largely untested with mono, however
9//! mono support is definetly going to be supported in the future.
10//!
11//! The entrypoint for this library is the [`Module`] struct. You can get started with loading a module like so:
12//!
13//! ```no_run
14//! use hao::{dotnet::md::streams::tables_stream::FieldFlags, Module};
15//!
16//! fn main() {
17//!     let module = Module::from_path(r#"C:\re\dnspy\bin\dnlib.dll"#).unwrap();
18//!     println!("loaded");
19//!
20//!     for ty in module.types().values() {
21//!         println!("{} {{", ty);
22//!         if ty.is_enum() {
23//!             for field in ty
24//!                 .fields()
25//!                 .values()
26//!                 .filter(|x| !x.flags().contains(FieldFlags::SpecialName))
27//!             {
28//!                 println!("\t{},", field.name());
29//!             }
30//!         } else {
31//!             for field in ty.fields().values() {
32//!                 println!("\t{};", field);
33//!             }
34//!         }
35//!
36//!         println!("}}");
37//!     }
38//! }
39//! ```
40//!
41//! this will print out all the types close-to c# syntax.
42
43pub mod dotnet;
44pub mod error;
45pub mod io;
46
47pub use dotnet::{module::resolver, Module};