Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/ronin/fuzzing/core_ext/string.rb
Class Method Summary collapse
-
.generate(*fields) {|string| ... } ⇒ Enumerator
Generate permutations of Strings from a format template.
Instance Method Summary collapse
-
#fuzz(substitutions = {}) {|fuzz| ... } ⇒ Enumerator
Incrementally fuzzes the String.
-
#mutate(mutations = {}) {|mutant| ... } ⇒ Enumerator
Permutes over every possible mutation of the String.
-
#repeating(lengths) {|repeated| ... } ⇒ Enumerator
Repeats the String.
Class Method Details
Instance Method Details
#fuzz(substitutions = {}) {|fuzz| ... } ⇒ Enumerator
Incrementally fuzzes the String.
169 170 171 |
# File 'lib/ronin/fuzzing/core_ext/string.rb', line 169 def fuzz(substitutions={},&block) Ronin::Fuzzing::Fuzzer.new(substitutions).each(self,&block) end |
#mutate(mutations = {}) {|mutant| ... } ⇒ Enumerator
Permutes over every possible mutation of the String.
199 200 201 |
# File 'lib/ronin/fuzzing/core_ext/string.rb', line 199 def mutate(mutations={},&block) Ronin::Fuzzing::Mutator.new(mutations).each(self,&block) end |
#repeating(lengths) {|repeated| ... } ⇒ Enumerator
Repeats the String.
126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/ronin/fuzzing/core_ext/string.rb', line 126 def repeating(lengths,&block) case lengths when Integer # if lengths is an Integer, simply multiply the String and return repeated = (self * lengths) yield repeated if block_given? return repeated else return Ronin::Fuzzing::Repeater.new(lengths).each(self,&block) end end |