Last active
December 11, 2015 18:49
-
-
Save KINGSABRI/4644444 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class Pattern | |
def initialize | |
@pattern = [] | |
@offset = String | |
end | |
def create(length) | |
if length != 0 or nil | |
@pattern = ('Aa0A'..'Zz9Z').to_a.join.each_char.first(length.to_i).join # default permutations 702940 | |
else | |
puts "\n[+] Error: Pattern create accepts INTEGER values only!\n\n" | |
length = 0 | |
end | |
return @pattern.join | |
end | |
def offset(string , length = 10000) | |
@pattern = ('Aa0A'..'Zz9Z').to_a.first(length.to_i).join | |
@offset = @pattern.index(string.to_s) | |
if @offset.nil? | |
puts "\n[+] Error: Your pattern is bigger than 10000, plz mention it!\npatter offset #{string} Pattern_Size\n" | |
# exit 1 | |
end | |
return @offset | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment