lib/msf/core/module_manager.rb
#
# Ranks modules based on their constant rank value, if they have one.
#
Ranks modules based on their constant rank value, if they have one.
Ranks modules based on their constant rank value if they have one .
def rank_modules
		self.mod_ranked = self.sort { |a, b|
			a_name, a_mod = a
			b_name, b_mod = b
			a_mod = create(a_name) if a_mod == SymbolicModule
			b_mod = create(b_name) if b_mod == SymbolicModule
			a_rank = a_mod.const_defined?('Rank') ? a_mod.const_get('Rank') : NormalRanking
			b_rank = b_mod.const_defined?('Rank') ? b_mod.const_get('Rank') : NormalRanking
			b_rank <=> a_rank
		}
	end
def rank_modules self . mod_ranked = self . sort { | a , b | a_name , a_mod = a b_name , b_mod = b a_mod = create ( a_name ) if a_mod == SymbolicModule b_mod = create ( b_name ) if b_mod == SymbolicModule a_rank = a_mod . const_defined? ( 'Rank' ) ? a_mod . const_get ( 'Rank' ) : NormalRanking b_rank = b_mod . const_defined? ( 'Rank' ) ? b_mod . const_get ( 'Rank' ) : NormalRanking b_rank <=> a_rank } end
Ranks modules based on their constant rank value, if they have one.
Ranks modules based on their constant rank value if they have one .
# Dynamically loads the module if needed # Extract the ranking between the two modules # Compare their relevant rankings.  Since we want highest to lowest, # we compare b_rank to a_rank in terms of higher/lower precedence