Land #5097: resolve UUID namespace issues with pro

bug/bundler_fix
Brent Cook 2015-04-07 13:16:28 -05:00
commit 84411be606
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
1 changed files with 6 additions and 2 deletions

View File

@ -196,12 +196,16 @@ class Msf::Payload::UUID
# #
def self.find_platform_id(platform) def self.find_platform_id(platform)
# Handle a PlatformList input by grabbing the first entry # Handle a PlatformList input by grabbing the first entry
if platform.respond_to? :platforms if platform.respond_to?(:platforms)
platform = platform.platforms.first.realname.downcase platform = platform.platforms.first.realname.downcase
end end
# Map a platform abbreviation to the real name # Map a platform abbreviation to the real name
name = Msf::Platform::Abbrev[platform] name = Msf::Platform.find_platform(platform)
if name && name.respond_to?(:realname)
name = name.realname.downcase
end
( Platforms.keys.select{ |k| ( Platforms.keys.select{ |k|
Platforms[k] == name Platforms[k] == name
}.first || Platforms[0] ).to_i }.first || Platforms[0] ).to_i