(bytes: &[u8], offset: u32)
| 63 | } |
| 64 | |
| 65 | fn read_c_string(bytes: &[u8], offset: u32) -> String { |
| 66 | let start = offset as usize; |
| 67 | let end = bytes[start..] |
| 68 | .iter() |
| 69 | .position(|&b| b == 0) |
| 70 | .map(|len| start + len) |
| 71 | .unwrap_or(bytes.len()); |
| 72 | String::from_utf8_lossy(&bytes[start..end]).into_owned() |
| 73 | } |
| 74 | |
| 75 | #[derive(Debug)] |
| 76 | struct SectionHeader { |
no outgoing calls
no test coverage detected