Method: Rex::Text.badchar_index
- Defined in:
- lib/rex/text.rb
.badchar_index(data, badchars = '') ⇒ Fixnum?
Return the index of the first badchar in data
, otherwise return nil if there wasn’t any badchar occurences.
1510 1511 1512 1513 1514 1515 1516 |
# File 'lib/rex/text.rb', line 1510 def self.badchar_index(data, badchars = '') badchars.unpack("C*").each { |badchar| pos = data.index(badchar.chr) return pos if pos } return nil end |