Module: Rex::Proto::TFTP

Defined in:
lib/rex/proto/tftp/client.rb,
lib/rex/proto/tftp/server.rb

Defined Under Namespace

Modules: Constants Classes: Client, Server

Class Method Summary collapse

Class Method Details

.get_string(data) ⇒ Object

Little util function



11
12
13
14
15
16
17
18
# File 'lib/rex/proto/tftp/server.rb', line 11

def self.get_string(data)
  idx = data.index("\x00")
  return nil if not idx
  ret = data.slice!(0, idx)
  # Slice off the nul byte.
  data.slice!(0,1)
  ret
end