Class: IO

Inherits:
Object
  • Object
show all
Includes:
Ronin::Support::Binary::Stream::Methods
Defined in:
lib/ronin/support/binary/core_ext/io.rb,
lib/ronin/support/cli/io_shell/core_ext/io.rb

Instance Method Summary collapse

Methods included from Ronin::Support::Binary::Stream::Methods

#read_array, #read_array_of, #read_array_of_byte, #read_array_of_char, #read_array_of_double, #read_array_of_float, #read_array_of_float32, #read_array_of_float64, #read_array_of_int, #read_array_of_int16, #read_array_of_int32, #read_array_of_int64, #read_array_of_int8, #read_array_of_long, #read_array_of_long_long, #read_array_of_short, #read_array_of_uchar, #read_array_of_uint, #read_array_of_uint16, #read_array_of_uint32, #read_array_of_uint64, #read_array_of_uint8, #read_array_of_ulong, #read_array_of_ulong_long, #read_array_of_ushort, #read_buffer, #read_byte, #read_char, #read_double, #read_float, #read_float32, #read_float64, #read_int, #read_int16, #read_int32, #read_int64, #read_int8, #read_into, #read_long, #read_long_long, #read_short, #read_string, #read_struct, #read_uchar, #read_uint, #read_uint16, #read_uint32, #read_uint64, #read_uint8, #read_ulong, #read_ulong_long, #read_union, #read_ushort, #read_value, #write_array_of, #write_array_of_byte, #write_array_of_char, #write_array_of_double, #write_array_of_float, #write_array_of_float32, #write_array_of_float64, #write_array_of_int, #write_array_of_int16, #write_array_of_int32, #write_array_of_int64, #write_array_of_int8, #write_array_of_long, #write_array_of_long_long, #write_array_of_short, #write_array_of_uchar, #write_array_of_uint, #write_array_of_uint16, #write_array_of_uint32, #write_array_of_uint64, #write_array_of_uint8, #write_array_of_ulong, #write_array_of_ulong_long, #write_array_of_ushort, #write_byte, #write_char, #write_double, #write_float, #write_float32, #write_float64, #write_int, #write_int16, #write_int32, #write_int64, #write_int8, #write_long, #write_long_long, #write_short, #write_string, #write_uchar, #write_uint, #write_uint16, #write_uint32, #write_uint64, #write_uint8, #write_ulong, #write_ulong_long, #write_ushort, #write_value

Instance Method Details

#shell(**kwargs) ⇒ Object

Starts an interactive session between STDIO and the IO object.

Examples:

socket = TCPSocket.new('irc.undernet.org',6667)
socket.shell
# NOTICE AUTH :*** Looking up your hostname
# NOTICE AUTH :*** Checking Ident
# NOTICE AUTH :*** Found your hostname
# NOTICE AUTH :*** No ident response
# USER test_ruby * * *
# NICK test_ruby
# PING :3167790481
# PONG 3167790481
# :Chicago.IL.US.Undernet.Org 001 test_ruby :Welcome to the UnderNet IRC Network, test_ruby
# :Chicago.IL.US.Undernet.Org 002 test_ruby :Your host is Chicago.IL.US.Undernet.Org, running version u2.10.12.19
# :Chicago.IL.US.Undernet.Org 003 test_ruby :This server was created Wed Apr 15 2020 at 22:02:43 UTC
# :Chicago.IL.US.Undernet.Org 004 test_ruby Chicago.IL.US.Undernet.Org u2.10.12.19 diOoswkgx biklmnopstvrDdRcC bklov
# :Chicago.IL.US.Undernet.Org 005 test_ruby WHOX WALLCHOPS WALLVOICES USERIP CPRIVMSG CNOTICE SILENCE=25 MODES=6 MAXCHANNELS=40 MAXBANS=100 NICKLEN=12 :are supported by this server
# :Chicago.IL.US.Undernet.Org 005 test_ruby MAXNICKLEN=15 TOPICLEN=160 AWAYLEN=160 KICKLEN=160 CHANNELLEN=200 MAXCHANNELLEN=200 CHANTYPES=#& PREFIX=(ov)@+ STATUSMSG=@+ CHANMODES=b,k,l,imnpstrDdRcC CASEMAPPING=rfc1459 NETWORK=UnderNet :are supported by this server
# :Chicago.IL.US.Undernet.Org 251 test_ruby :There are 3241 users and 9182 invisible on 38 servers
# :Chicago.IL.US.Undernet.Org 252 test_ruby 57 :operator(s) online
# :Chicago.IL.US.Undernet.Org 253 test_ruby 23 :unknown connection(s)
# :Chicago.IL.US.Undernet.Org 254 test_ruby 6230 :channels formed
# :Chicago.IL.US.Undernet.Org 255 test_ruby :I have 1179 clients and 1 servers
# :Chicago.IL.US.Undernet.Org NOTICE test_ruby :Highest connection count: 1388 (1387 clients)
# :Chicago.IL.US.Undernet.Org 422 test_ruby :MOTD File is missing
# :Chicago.IL.US.Undernet.Org NOTICE test_ruby :on 1 ca 1(4) ft 10(10)
# Ctrl^D

Parameters:

Options Hash (**kwargs):

  • :stdin (IO)

    Optional alternative STDIN stream. Defaults to $stdin.

  • :stdout (IO)

    Optional alternative STDOUT stream. Defaults to $stdout.



63
64
65
# File 'lib/ronin/support/cli/io_shell/core_ext/io.rb', line 63

def shell(**kwargs)
  Ronin::Support::CLI::IOShell.start(self,**kwargs)
end

#type_systemObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The type system which read_*/write_* methods will use.



34
35
36
# File 'lib/ronin/support/binary/core_ext/io.rb', line 34

def type_system
  Ronin::Support::Binary::CTypes
end