architect exporters
PatternGenerator - create wildcard patterns from hex regions.
- class PatternGenerator[source]
Bases:
objectGenerate wildcard byte patterns from a region and its static mask.
Static bytes become exact match values; volatile bytes become wildcards (??). The result can be exported as YARA or JSON.
- static generate(reference_bytes, static_mask, name='unnamed_pattern', min_static_ratio=0.3)[source]
Generate a pattern dict from reference bytes and static mask.
- Parameters:
- Returns:
Pattern dict with hex_pattern, wildcard_pattern, metadata. None if insufficient static bytes.
- Return type:
dict | None
- static find_anchors(static_mask, min_anchor_length=4)[source]
Find contiguous runs of static bytes that can serve as anchors.
- static infer_fields(variance, key_offset, key_length, threshold=2000.0)[source]
Segment variance into structural fields and dynamic regions.
Walks the variance array and groups contiguous bytes by whether their variance is below threshold (static) or above (dynamic). The known key region is labeled
key_materialregardless of individual byte variance.
YaraExporter - export patterns as YARA rules.
- class YaraExporter[source]
Bases:
objectExport byte patterns as YARA detection rules.
JsonExporter - export patterns as JSON signature files.
- class JsonExporter[source]
Bases:
objectExport byte patterns as JSON signatures compatible with pattern_loader.
- static export(pattern, library='', tls_version='', description='', structural_rules=None)[source]
Export a pattern as a JSON signature dict.
- Parameters:
- Returns:
JSON-serializable dict compatible with pattern_loader.
- Return type:
Volatility3Exporter - generate self-contained Volatility3 plugins from patterns.
- class Volatility3Exporter[source]
Bases:
objectExport byte patterns as self-contained Volatility3 Python plugins.
- static export(pattern, plugin_name=None, description=None, yara_rule=None)[source]
Export a pattern dict as a Volatility3 plugin Python source.
- Parameters:
pattern (dict) – Pattern dict from PatternGenerator.generate(), optionally enriched with key_offset, key_length, vtypes, and fields by
vol3_emit.plugin_name (str | None) – Plugin class name (defaults to CamelCase of pattern name).
description (str | None) – Human-readable description.
yara_rule (str | None) – Pre-built YARA rule string. Generated if not provided.
- Returns:
Complete Python source code for a Volatility3 plugin.
- Return type: