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§
- Magic
Rule - Magic rule representation in the AST
- Regex
Flags - Regex modifier flags parsed from the
/[cs]suffix on aregexrule. - Value
Transform - A pre-comparison value transform:
(op, operand).
Enums§
- Endianness
- Endianness specification for multi-byte values
- Indirect
Adjustment Op - Arithmetic operation applied to the value read at an indirect offset’s
base_offsetbefore the result is used as the final file offset. - Magic
Rule Validation Error - Validation errors returned by
MagicRule::validate. - Meta
Type - Control-flow directive carried by
TypeKind::Meta. - Offset
Spec - Offset specification for locating data in files
- Operator
- Comparison and bitwise operators
- PString
Length Width - The width of the length prefix for Pascal strings.
- Regex
Count - Scan window specifier for a
TypeKind::Regexrule. - Strength
Modifier - Strength modifier for magic rules
- Type
Kind - Data type specifications for interpreting bytes
- Value
- Value types for rule matching
- Value
Transform Op - Arithmetic operation applied to a value read from the file before the rule’s comparison operator is evaluated.