class Crowbar::Engine

Overview

Central transformation engine orchestrating PRNG state, scoped targets, structure-preserving rules, adaptive mutator selection, and evolutionary feedback.

Defined in:

crowbar/engine.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(seed : UInt64 = PRNG.default_seed) #

Class Method Detail

def self.detect_format?(buffer : Buffer) : Symbol | Nil #

Auto-detects format/protocol of the given buffer


Instance Method Detail

def add_fixup(&block : Buffer -> Nil) #

def add_rule(rule : Rule) #

def add_sample(sample : Buffer | Bytes | String) : Nil #

def add_scope(scope : Scope) #

def context : Context #

def detect_format?(buffer : Buffer) : Symbol | Nil #

def evolution : Evolution::Manager #

def fixups : Array(Proc(Buffer, Nil)) #

def frame?(name : String | Symbol) : FrameDefinition | Nil #

def frames : Hash(String, FrameDefinition) #

def fuzz(input : Buffer | Bytes | String) : Buffer #

Convenient alias


def fuzz_frame(name : String | Symbol) : Buffer #

Fuzzes a declarative binary frame, automatically recomputing lengths and checksums


def generate(name : String | Symbol, start_symbol : Symbol = :start) : String #

Generates a string using a defined generative grammar


def grammar?(name : String | Symbol) : GrammarDefinition | Nil #

def grammars : Hash(String, GrammarDefinition) #

def harvest(text : String) : Array(String) #

def harvest_feedback(text : String) : Array(String) #

Extracts diagnostic tokens from error messages into active dictionary


def last_metadata : Metadata | Nil #

def pattern : Pattern #

def pattern=(pattern : Pattern) #

def pool : MutatorPool #

def register_frame(frame : FrameDefinition) #

def register_grammar(grammar : GrammarDefinition) #

def report(candidate : Buffer | Bytes | String, fitness : Float64, feature : String | Nil = nil, coverage_hash : UInt64 | Nil = nil) #

Report feedback to evolutionary optimizer with optional feature & coverage hash telemetry


def report(candidate : Buffer | Bytes | String, success : Bool, feature : String | Nil = nil, coverage_hash : UInt64 | Nil = nil) #

def rules : Array(Rule) #

def scopes : Array(Scope) #

def seed : UInt64 #

def seed=(new_seed : UInt64) #

def seek(offset : Int) : Nil #

def template : String | Nil #

def template=(template : String | Nil) #

def transform(input : Buffer | Bytes | String) : Buffer #

Core transform method: transforms an input buffer and returns mutated buffer


def uniqueness_filter : Evolution::UniquenessFilter | Nil #

def uniqueness_filter=(uniqueness_filter : Evolution::UniquenessFilter | Nil) #