pub enum PeAnomaly {
WritableExecutableSection {
section_name: String,
},
EntryPointOutsideSections {
entry_point_rva: u32,
},
VirtualOnlySection {
section_name: String,
},
LargeVirtualToRawRatio {
section_name: String,
ratio: u32,
},
TlsCallbacksPresent {
count: usize,
},
OverlayPresent {
offset: u64,
size: u64,
},
RichHeaderAbsent,
}Expand description
A structural anomaly found in a PE binary.
Individual anomalies are low-to-medium confidence signals; clusters of multiple anomalies on the same binary are high confidence.
Variants§
WritableExecutableSection
A section has both executable and writable characteristics (W+X). Legitimate code sections are executable but not writable; shellcode injected at runtime needs both.
EntryPointOutsideSections
The entry-point RVA falls outside the virtual address range of every defined section. This is the classic hallmark of shellcode loading or in-memory PE patching.
VirtualOnlySection
A section’s raw size on disk is zero but its virtual size is non-zero. The runtime loader expands this section, which is where packed malware decompresses into.
LargeVirtualToRawRatio
A section’s virtual size exceeds its raw size by more than ratio×.
Legitimate compressed resources occasionally show this; ratios > 20
almost always indicate runtime decompression of an encrypted payload.
TlsCallbacksPresent
TLS (Thread Local Storage) callbacks are registered. These execute before the PE entry point, giving malware a window for anti-debug and anti-VM checks before the main payload runs.
OverlayPresent
Extra bytes are appended after the last section’s raw data. Legitimate packers (installers, SFX archives) use overlays; so do malware droppers that store an encrypted second stage here.
RichHeaderAbsent
No Rich header was found in the DOS stub area of a large binary.
Every MSVC/MinGW binary emits a Rich header; its absence on a file
4 KiB suggests deliberate stripping for anti-attribution.
Trait Implementations§
Source§impl Observation for PeAnomaly
impl Observation for PeAnomaly
Source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
None if the analyzer deliberately does not grade this kind.Source§fn category(&self) -> Category
fn category(&self) -> Category
Category::from_code of Observation::code.
Override when a code’s keyword classification is wrong.