Skip to main content

Module ast

Module ast 

Source
Expand description

Abstract Syntax Tree definitions for magic rules

This module contains the core data structures that represent parsed magic rules and their components, including offset specifications, type kinds, operators, and values.

Structs§

MagicRule
Magic rule representation in the AST
RegexFlags
Regex modifier flags parsed from the /[cs] suffix on a regex rule.
ValueTransform
A pre-comparison value transform: (op, operand).

Enums§

Endianness
Endianness specification for multi-byte values
IndirectAdjustmentOp
Arithmetic operation applied to the value read at an indirect offset’s base_offset before the result is used as the final file offset.
MagicRuleValidationError
Validation errors returned by MagicRule::validate.
MetaType
Control-flow directive carried by TypeKind::Meta.
OffsetSpec
Offset specification for locating data in files
Operator
Comparison and bitwise operators
PStringLengthWidth
The width of the length prefix for Pascal strings.
RegexCount
Scan window specifier for a TypeKind::Regex rule.
StrengthModifier
Strength modifier for magic rules
TypeKind
Data type specifications for interpreting bytes
Value
Value types for rule matching
ValueTransformOp
Arithmetic operation applied to a value read from the file before the rule’s comparison operator is evaluated.