mod relocation;
pub use relocation::*;
mod import;
pub use import::*;
mod export;
pub use export::*;
#[derive(Clone, Copy)]
pub enum DataDirectoryType {
ExportTable,
ImportTable,
ResourceTable,
ExceptionTable,
CertificateTable,
RelocationTable,
Debug,
Architecture,
GlobalPointer,
TLSTable,
LoadConfigTable,
BoundImportTable,
ImportAddressTable,
DelayImportDescriptor,
CLRRuntimeHeader,
Reserved,
}
#[derive(Clone, Copy)]
#[repr(C)]
pub struct DataDirectory {
pub rva: u32,
pub size: u32,
}
impl DataDirectory {
pub fn contains_rva(&self, rva: u32) -> bool {
(self.rva..self.rva + self.size).contains(&rva)
}
}
pub trait DataDirectoryTable<'a> {
fn new(bytes: &'a [u8], dir: &'a DataDirectory) -> Self;
fn typ() -> DataDirectoryType;
}