(data: &[u8], offset: usize)
| 26 | } |
| 27 | |
| 28 | fn read_cstring(data: &[u8], offset: usize) -> Option<String> { |
| 29 | let end = data[offset..].iter().position(|&b| b == 0)?; |
| 30 | String::from_utf8(data[offset..offset + end].to_vec()).ok() |
| 31 | } |
| 32 | |
| 33 | fn parse_sections(data: &[u8], pe_offset: usize, num_sections: u16) -> Vec<(u32, u32, u32)> { |
| 34 | let opt_header_size = read_u16(data, pe_offset + 20) as usize; |