Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
certcc-ghbot committed Dec 23, 2024
2 parents b9eef6c + a133b58 commit 30b64bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/msf/core/windows_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,10 @@ def major_release_name

# Get a Windows OS version string representation for a given major, minor and build number
def self.version_string(major, minor, build, version_module, mapping)
version_module.constants.each do |version_sym|
version = version_module.const_get(version_sym)
sorted_versions = version_module.constants
.map { |version_sym| [version_sym, version_module.const_get(version_sym)] }
.sort_by { |_version_sym, version| version.segments }
sorted_versions.each do |version_sym, version|
segments = version.segments
if segments[0..2] == [major, minor, build]
return mapping[version_sym]
Expand Down

0 comments on commit 30b64bd

Please sign in to comment.