wraith/structures/pe/
data_directory.rs1#[repr(C)]
4#[derive(Debug, Clone, Copy, Default)]
5pub struct DataDirectory {
6 pub virtual_address: u32,
7 pub size: u32,
8}
9
10impl DataDirectory {
11 pub fn is_present(&self) -> bool {
13 self.virtual_address != 0 && self.size != 0
14 }
15}
16
17#[repr(usize)]
19#[derive(Debug, Clone, Copy, PartialEq, Eq)]
20pub enum DataDirectoryType {
21 Export = 0,
22 Import = 1,
23 Resource = 2,
24 Exception = 3,
25 Security = 4,
26 Basereloc = 5,
27 Debug = 6,
28 Architecture = 7,
29 Globalptr = 8,
30 Tls = 9,
31 LoadConfig = 10,
32 BoundImport = 11,
33 Iat = 12,
34 DelayImport = 13,
35 ComDescriptor = 14,
36}
37
38impl DataDirectoryType {
39 pub fn index(self) -> usize {
40 self as usize
41 }
42}