Add Enum-type options for external modules

MS-2855/keylogger-mettle-extension
Adam Cammack 2018-02-02 14:40:04 -06:00
parent ab36b5dd5d
commit 02e81d166d
No known key found for this signature in database
GPG Key ID: C9378BA088092D66
1 changed files with 7 additions and 2 deletions

View File

@ -45,8 +45,13 @@ class Msf::Modules::External::Shim
end
meta[:options] = options.map do |n, o|
"Opt#{o['type'].camelize}.new(#{n.dump},
[#{o['required']}, #{o['description'].dump}, #{o['default'].inspect}])"
if o['values']
"Opt#{o['type'].camelize}.new(#{n.dump},
[#{o['required']}, #{o['description'].dump}, #{o['default'].inspect}, #{o['values'].inspect}])"
else
"Opt#{o['type'].camelize}.new(#{n.dump},
[#{o['required']}, #{o['description'].dump}, #{o['default'].inspect}])"
end
end.join(",\n ")
meta
end