Class: Rex::Java::Serialization::Model::ClassDesc
- Includes:
- Contents
- Defined in:
- lib/rex/java/serialization/model/class_desc.rb
Overview
This class provides a Java classDesc representation
Constant Summary
Constants included from Rex::Java::Serialization
BASE_WIRE_HANDLE, OBJECT_TYPE_CODES, PRIMITIVE_TYPE_CODES, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, TC_ARRAY, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING, TYPE_CODES
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
Attributes inherited from Element
Instance Method Summary collapse
-
#decode(io) ⇒ self
Deserializes a Rex::Java::Serialization::Model::ClassDesc.
-
#encode ⇒ String
Serializes the Rex::Java::Serialization::Model::ClassDesc.
-
#initialize(stream = nil) ⇒ ClassDesc
constructor
A new instance of ClassDesc.
-
#to_s ⇒ String
Creates a print-friendly string representation.
Methods included from Contents
#decode_content, #encode_content, #print_class, #print_content
Methods inherited from Element
Constructor Details
#initialize(stream = nil) ⇒ ClassDesc
Returns a new instance of ClassDesc.
15 16 17 18 |
# File 'lib/rex/java/serialization/model/class_desc.rb', line 15 def initialize(stream = nil) super(stream) self.description = nil end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
12 13 14 |
# File 'lib/rex/java/serialization/model/class_desc.rb', line 12 def description @description end |
Instance Method Details
#decode(io) ⇒ self
Deserializes a Rex::Java::Serialization::Model::ClassDesc
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rex/java/serialization/model/class_desc.rb', line 25 def decode(io) content = decode_content(io, stream) allowed_contents = [NullReference, NewClassDesc, Reference] unless allowed_contents.include?(content.class) raise ::RuntimeError, 'ClassDesc unserialize failed' end self.description = content self end |
#encode ⇒ String
Serializes the Rex::Java::Serialization::Model::ClassDesc
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/rex/java/serialization/model/class_desc.rb', line 41 def encode encoded = '' allowed_contents = [NullReference, NewClassDesc, Reference] unless allowed_contents.include?(description.class) raise ::RuntimeError, 'Failed to serialize ClassDesc' end encoded << encode_content(description) encoded end |
#to_s ⇒ String
Creates a print-friendly string representation
57 58 59 |
# File 'lib/rex/java/serialization/model/class_desc.rb', line 57 def to_s print_content(description) end |