Add support for NewClass

bug/bundler_fix
jvazquez-r7 2015-09-30 12:30:52 -05:00
parent 54f9a3b25a
commit 8590c79021
No known key found for this signature in database
GPG Key ID: 38D99152B9352D83
3 changed files with 8 additions and 2 deletions

View File

@ -19,6 +19,7 @@ module Rex
autoload :NewClassDesc, 'rex/java/serialization/model/new_class_desc' autoload :NewClassDesc, 'rex/java/serialization/model/new_class_desc'
autoload :NewEnum, 'rex/java/serialization/model/new_enum' autoload :NewEnum, 'rex/java/serialization/model/new_enum'
autoload :NewObject, 'rex/java/serialization/model/new_object' 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 :NullReference, 'rex/java/serialization/model/null_reference'
autoload :Reference, 'rex/java/serialization/model/reference' autoload :Reference, 'rex/java/serialization/model/reference'
autoload :Reset, 'rex/java/serialization/model/reset' autoload :Reset, 'rex/java/serialization/model/reset'

View File

@ -28,7 +28,7 @@ module Rex
when TC_OBJECT when TC_OBJECT
content = NewObject.decode(io, stream) content = NewObject.decode(io, stream)
when TC_CLASS when TC_CLASS
content = ClassDesc.decode(io, stream) content = NewClass.decode(io, stream)
when TC_ARRAY when TC_ARRAY
content = NewArray.decode(io, stream) content = NewArray.decode(io, stream)
when TC_STRING when TC_STRING
@ -75,7 +75,7 @@ module Rex
encoded << [TC_ENDBLOCKDATA].pack('C') encoded << [TC_ENDBLOCKDATA].pack('C')
when NewObject when NewObject
encoded << [TC_OBJECT].pack('C') encoded << [TC_OBJECT].pack('C')
when ClassDesc when NewClass
encoded << [TC_CLASS].pack('C') encoded << [TC_CLASS].pack('C')
when NewArray when NewArray
encoded << [TC_ARRAY].pack('C') encoded << [TC_ARRAY].pack('C')
@ -122,6 +122,8 @@ module Rex
str << "#{print_class(content)} { #{content.to_s} }" str << "#{print_class(content)} { #{content.to_s} }"
when ClassDesc when ClassDesc
str << "#{print_class(content)} { #{content.to_s} }" str << "#{print_class(content)} { #{content.to_s} }"
when NewClass
str << "#{print_class(content)} { #{content.to_s} }"
when NewArray when NewArray
str << "#{print_class(content)} { #{content.to_s} }" str << "#{print_class(content)} { #{content.to_s} }"
when Utf when Utf

View File

@ -71,6 +71,7 @@ module Rex
# @return [String] # @return [String]
def to_s def to_s
str = '' str = ''
case class_desc.description case class_desc.description
when NewClassDesc when NewClassDesc
str << class_desc.description.class_name.to_s str << class_desc.description.class_name.to_s
@ -84,6 +85,8 @@ module Rex
data_str = class_data.collect { |data| data.to_s } data_str = class_data.collect { |data| data.to_s }
str << data_str.join(', ') str << data_str.join(', ')
str << ' }' str << ' }'
str
end end
private private