metasploit-framework/lib/rex/string_utils.rb

20 lines
323 B
Ruby
Raw Normal View History

#!/usr/bin/ruby
module Rex
module StringUtils
#
# Return the index of the first badchar in data, otherwise return
# nil if there wasn't any badchar occurences.
#
def self.badchar_index(data, badchars)
badchars.each_byte { |badchar|
pos = data.index(badchar)
return pos if pos
}
return nil
end
end end