Enum ParseStage
#[non_exhaustive]pub enum ParseStage {
Show 27 variants
DosHeader,
PeSignature,
CoffHeader,
OptionalHeader,
SectionTable,
Cor20Header,
MetadataRoot,
StreamHeader,
TildeStream,
TableRow,
Heap,
DataDirectory,
Resources,
VTableFixup,
StrongName,
Signature,
MethodBody,
CustomAttribute,
PermissionSet,
InstructionDecoder,
InstructionEncoder,
AssemblyWriter,
ImportsExports,
TypeSystem,
Validation,
EmulationLoader,
Generic,
}Expand description
dotscope Error type.
The main error type for all operations in this crate. Provides detailed error information for file parsing, metadata validation, and disassembly operations.
§Usage Examples
use dotscope::{Error, CilObject};
match CilObject::from_path(std::path::Path::new("tests/samples/crafted_2.exe")) {
Ok(assembly) => println!("Loaded successfully"),
Err(Error::NotSupported) => println!("File format not supported"),
Err(Error::Parse(parse_err)) => println!("Malformed: {}", parse_err),
Err(e) => println!("Error: {}", e),
}Pipeline stage at which a parse error originated.
Returned as part of ParseFailure. Lets consumers act on the error
category (e.g. retry an upgrade only for Cor20Header/MetadataRoot
failures) without parsing string messages.
#[non_exhaustive] — additional stages may be added as the parser
surface grows.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DosHeader
DOS / MZ header at the very start of the PE file.
PeSignature
PE signature (“PE\0\0”) immediately following the DOS stub.
CoffHeader
COFF file header following the PE signature.
OptionalHeader
Optional header (PE32 / PE32+).
SectionTable
Section table immediately after the optional header.
Cor20Header
CLI / COR20 runtime header located via the data-directory entry.
MetadataRoot
Metadata root header (signature, versions, stream count).
StreamHeader
Per-stream header inside the metadata root.
TildeStream
Tilde (#~) stream containing metadata table rows.
TableRow
Per-table row layout/decoding within the tilde stream.
Heap
One of the heap streams (#Strings, #US, #Blob, #GUID).
DataDirectory
Generic data-directory entry traversal.
Resources
Resource directory (.NET embedded resources).
VTableFixup
VTableFixup directory.
StrongName
Strong-name signature blob.
Signature
Signature parsing within blobs (method/field/etc.).
MethodBody
Method body header / code / EH-clause parsing.
CustomAttribute
Custom-attribute decoding from the blob heap.
PermissionSet
DeclSecurity permission-set decoding.
InstructionDecoder
CIL instruction decoding (disassembly).
InstructionEncoder
CIL instruction encoding (assembler/serializer write paths).
AssemblyWriter
Assembly / metadata writer paths (crate::cilassembly::writer).
ImportsExports
Imports/exports table decoding.
TypeSystem
Type system construction post-parse (crate::metadata::tables,
owned-type construction).
Validation
Validation passes (crate::metadata::validation).
EmulationLoader
Emulation/runtime loader (crate::emulation::loader).
Generic
Generic byte-parser primitives — used by helpers that have no
inherent stage (e.g. crate::file::parser::Parser).
Trait Implementations§
§impl Clone for ParseStage
impl Clone for ParseStage
§fn clone(&self) -> ParseStage
fn clone(&self) -> ParseStage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ParseStage
§impl Debug for ParseStage
impl Debug for ParseStage
§impl Display for ParseStage
impl Display for ParseStage
impl Eq for ParseStage
§impl Hash for ParseStage
impl Hash for ParseStage
§impl PartialEq for ParseStage
impl PartialEq for ParseStage
impl StructuralPartialEq for ParseStage
Auto Trait Implementations§
impl Freeze for ParseStage
impl RefUnwindSafe for ParseStage
impl Send for ParseStage
impl Sync for ParseStage
impl Unpin for ParseStage
impl UnsafeUnpin for ParseStage
impl UnwindSafe for ParseStage
Blanket Implementations§
impl<T> Boilerplate for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for T
impl<T> Downcast for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more