mod checksum;
mod method_tokens;
mod parse;
use std::fmt;
use super::NefFile;
#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) struct NefParseOutput {
pub(crate) nef: NefFile,
pub(crate) warnings: Vec<NefParseWarning>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) enum NefParseWarning {
InvalidMethodTokenCallFlags {
index: usize,
flags: u8,
allowed: u8,
},
}
impl fmt::Display for NefParseWarning {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
NefParseWarning::InvalidMethodTokenCallFlags {
index,
flags,
allowed,
} => write!(
f,
"method token #{index} call flags 0x{flags:02X} contain unsupported bits (allowed mask 0x{allowed:02X}); preserving raw flags for decompilation"
),
}
}
}
#[derive(Debug, Default, Clone, Copy)]
pub struct NefParser;
impl NefParser {
#[must_use]
pub fn new() -> Self {
Self
}
}