Class: Rex::Proto::Rmi::Model::CallData
- Defined in:
- lib/rex/proto/rmi/model/call_data.rb
Overview
This class provides a representation of an RMI return value
Constant Summary
Constants included from Rex::Proto::Rmi::Model
CALL_MESSAGE, DGC_ACK_MESSAGE, MULTIPLEX_PROTOCOL, PING_ACK, PING_MESSAGE, PROTOCOL_ACK, PROTOCOL_NOT_SUPPORTED, RETURN_DATA, RETURN_EXCEPTION, RETURN_VALUE, SIGNATURE, SINGLE_OP_PROTOCOL, STREAM_PROTOCOL
Instance Attribute Summary collapse
-
#arguments ⇒ Array
The returned exception or value according to code.
-
#hash ⇒ Integer
On JDK 1.1 stub protocol the stub’s interface hash.
-
#object_number ⇒ Integer
Random to identify the object being called.
-
#operation ⇒ Integer
On JDK 1.1 stub protocol the operation index in the interface.
-
#uid ⇒ Rex::Proto::Rmi::Model::UniqueIdentifier
Unique identifier for the target to call.
Instance Method Summary collapse
-
#decode(io) ⇒ Rex::Proto::Rmi::Model::CallData
Decodes the Rex::Proto::Rmi::Model::CallData from the input.
-
#encode ⇒ String
Encodes the Rex::Proto::Rmi::Model::CallData into an String.
Methods inherited from Element
attr_accessor, attributes, #attributes, decode, #initialize
Constructor Details
This class inherits a constructor from Rex::Proto::Rmi::Model::Element
Instance Attribute Details
#arguments ⇒ Array
Returns the returned exception or value according to code.
26 27 28 |
# File 'lib/rex/proto/rmi/model/call_data.rb', line 26 def arguments @arguments end |
#hash ⇒ Integer
Returns On JDK 1.1 stub protocol the stub’s interface hash. On JDK1.2 is a hash representing the method to call.
23 24 25 |
# File 'lib/rex/proto/rmi/model/call_data.rb', line 23 def hash @hash end |
#object_number ⇒ Integer
Returns Random to identify the object being called.
12 13 14 |
# File 'lib/rex/proto/rmi/model/call_data.rb', line 12 def object_number @object_number end |
#operation ⇒ Integer
Returns On JDK 1.1 stub protocol the operation index in the interface. On JDK 1.2 it is -1.
19 20 21 |
# File 'lib/rex/proto/rmi/model/call_data.rb', line 19 def operation @operation end |
#uid ⇒ Rex::Proto::Rmi::Model::UniqueIdentifier
Returns unique identifier for the target to call.
15 16 17 |
# File 'lib/rex/proto/rmi/model/call_data.rb', line 15 def uid @uid end |
Instance Method Details
#decode(io) ⇒ Rex::Proto::Rmi::Model::CallData
Decodes the Rex::Proto::Rmi::Model::CallData from the input.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/rex/proto/rmi/model/call_data.rb', line 45 def decode(io) stream = Rex::Java::Serialization::Model::Stream.decode(io) block_data = stream.contents[0] block_data_io = StringIO.new(block_data.contents, 'rb') self.object_number = decode_object_number(block_data_io) self.uid = decode_uid(block_data_io) self.operation = decode_operation(block_data_io) self.hash = decode_hash(block_data_io) self.arguments = [] stream.contents[1..stream.contents.length - 1].each do |content| self.arguments << content end self end |
#encode ⇒ String
Encodes the Rex::Proto::Rmi::Model::CallData into an String.
31 32 33 34 35 36 37 38 39 |
# File 'lib/rex/proto/rmi/model/call_data.rb', line 31 def encode stream = Rex::Java::Serialization::Model::Stream.new block_data = Rex::Java::Serialization::Model::BlockData.new(nil, encode_object_number + encode_uid + encode_operation + encode_hash) stream.contents << block_data stream.contents += arguments stream.encode end |