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.
170 171 172 |
# File 'lib/ronin/fuzzing/core_ext/string.rb', line 170 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.
200 201 202 |
# File 'lib/ronin/fuzzing/core_ext/string.rb', line 200 def mutate(mutations={},&block) Ronin::Fuzzing::Mutator.new(mutations).each(self,&block) end |
#repeating(lengths) {|repeated| ... } ⇒ Enumerator
Repeats the String.
125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/ronin/fuzzing/core_ext/string.rb', line 125 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 |