From 0ad5dca9fa550d5246ca8e657ea2c7393325d9ae Mon Sep 17 00:00:00 2001 From: William Vu Date: Wed, 24 Apr 2019 11:26:52 -0500 Subject: [PATCH] Revert to RelatedModules and handle Array/Hash --- lib/msf/base/serializer/readable_text.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/msf/base/serializer/readable_text.rb b/lib/msf/base/serializer/readable_text.rb index 2dea1bf992..a3b812baf7 100644 --- a/lib/msf/base/serializer/readable_text.rb +++ b/lib/msf/base/serializer/readable_text.rb @@ -686,16 +686,24 @@ class ReadableText when 'NOCVE' output << "CVE not available:\n" \ "#{indent}#{val}\n" - when 'RELATED' + when 'RelatedModules' output << "Related modules:\n" val.each { |related| output << "#{indent}#{related}\n" } when 'Stability', 'SideEffects', 'Reliability' # Handled by dump_traits next else - # Display the raw note output << "#{name}:\n" \ - "#{indent}#{val}\n" + + case val + when Array + val.each { |v| output << "#{indent}#{v}\n" } + when Hash + val.each { |k, v| output << "#{indent}#{k}: #{v}\n" } + else + # Display the raw note + output << "#{indent}#{val}\n" + end end output << "\n"