Add support for NewClass
parent
54f9a3b25a
commit
8590c79021
|
@ -19,6 +19,7 @@ module Rex
|
|||
autoload :NewClassDesc, 'rex/java/serialization/model/new_class_desc'
|
||||
autoload :NewEnum, 'rex/java/serialization/model/new_enum'
|
||||
autoload :NewObject, 'rex/java/serialization/model/new_object'
|
||||
autoload :NewClass, 'rex/java/serialization/model/new_class'
|
||||
autoload :NullReference, 'rex/java/serialization/model/null_reference'
|
||||
autoload :Reference, 'rex/java/serialization/model/reference'
|
||||
autoload :Reset, 'rex/java/serialization/model/reset'
|
||||
|
|
|
@ -28,7 +28,7 @@ module Rex
|
|||
when TC_OBJECT
|
||||
content = NewObject.decode(io, stream)
|
||||
when TC_CLASS
|
||||
content = ClassDesc.decode(io, stream)
|
||||
content = NewClass.decode(io, stream)
|
||||
when TC_ARRAY
|
||||
content = NewArray.decode(io, stream)
|
||||
when TC_STRING
|
||||
|
@ -75,7 +75,7 @@ module Rex
|
|||
encoded << [TC_ENDBLOCKDATA].pack('C')
|
||||
when NewObject
|
||||
encoded << [TC_OBJECT].pack('C')
|
||||
when ClassDesc
|
||||
when NewClass
|
||||
encoded << [TC_CLASS].pack('C')
|
||||
when NewArray
|
||||
encoded << [TC_ARRAY].pack('C')
|
||||
|
@ -122,6 +122,8 @@ module Rex
|
|||
str << "#{print_class(content)} { #{content.to_s} }"
|
||||
when ClassDesc
|
||||
str << "#{print_class(content)} { #{content.to_s} }"
|
||||
when NewClass
|
||||
str << "#{print_class(content)} { #{content.to_s} }"
|
||||
when NewArray
|
||||
str << "#{print_class(content)} { #{content.to_s} }"
|
||||
when Utf
|
||||
|
|
|
@ -71,6 +71,7 @@ module Rex
|
|||
# @return [String]
|
||||
def to_s
|
||||
str = ''
|
||||
|
||||
case class_desc.description
|
||||
when NewClassDesc
|
||||
str << class_desc.description.class_name.to_s
|
||||
|
@ -84,6 +85,8 @@ module Rex
|
|||
data_str = class_data.collect { |data| data.to_s }
|
||||
str << data_str.join(', ')
|
||||
str << ' }'
|
||||
|
||||
str
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in New Issue