pub enum Atom {
ByteSequence {
seq_start: u16,
seq_end: u16,
},
ByteSequenceMasked {
seq_start: u16,
mask_start: u16,
len: u16,
},
WildcardFixed(u16),
WildcardRange {
min: u16,
max: u16,
},
Jump(JumpType),
Read(ReadWidth),
Branch {
left_len: u16,
right_len: u16,
},
CursorPush,
CursorPop {
advance: u16,
},
SaveCursor,
SaveConstant(u32),
}Expand description
An atom represents a single operation that the matcher should perform.
Variants§
ByteSequence
Match a sequence of bytes from the sequence array.
ByteSequenceMasked
Match a sequence of bytes from the sequence array using a custom bitmask.
Fields
WildcardFixed(u16)
Skip a fixed number of bytes.
WildcardRange
Skip a variable number of bytes.
Jump(JumpType)
Jump to the relative / absolute based on the binary data the current cursor location.
Read(ReadWidth)
Read the data value of a specified size at the current cursors location and save it to the save stack. This also advances the data cursor by the specified size.
Branch
Match any one of the two subexpressions and then continue where we left of.
CursorPush
Push the cursor location to the cursor stack
CursorPop
Pop the cursor location from the cursor stack and advance by X bytes
SaveCursor
Save the current cursor position to the save stack
SaveConstant(u32)
Save the constant to the save stack. This can be usefull to save which branch has been taken.