lib/msf/core/module_manager.rb
#
# Load all of the modules from the supplied module path (independent of
# module type).
#
Load all of the modules from the supplied module path (independent of
module type).
Load all of the modules from the supplied module path ( independent of module type ) .
def load_modules_from_directory(bpath, demand = false)
		loaded = {}
		recalc = {}
		counts = {}
		delay  = {}
		ks     = true
		dbase  = ::Dir.new(bpath)
		dbase.entries.each do |ent|
			next if ent.downcase == '.svn'
			path  = ::File.join(bpath, ent)
			mtype = ent.gsub(/s$/, '')
			next if not ::File.directory?(path)
			next if not MODULE_TYPES.include?(mtype)
			next if not enabled_types[mtype]
			Rex::Find.find(path) do |file|
				next if file[-3,3] != ".rb"
				next if (file =~ /rb\.(ut|ts)\.rb$/)
				next if file[0,1] == "."
				load_module_from_file(bpath, file, loaded, recalc, counts, demand)
			end
		end
		recalc.each_key do |mtype|
			module_set(mtype).recalculate		
		end
		return counts
	end
def load_modules_from_directory ( bpath , demand = false ) loaded = { } recalc = { } counts = { } delay = { } ks = true dbase = :: Dir . new ( bpath ) dbase . entries . each do | ent | next if ent . downcase == '.svn' path = :: File . join ( bpath , ent ) mtype = ent . gsub ( / s$ / , '' ) next if not :: File . directory? ( path ) next if not MODULE_TYPES . include? ( mtype ) next if not enabled_types [ mtype ] Rex :: Find . find ( path ) do | file | next if file [ - 3 , 3 ] != ".rb" next if ( file =~ / rb \. (ut|ts) \. rb$ / ) next if file [ 0 , 1 ] == "." load_module_from_file ( bpath , file , loaded , recalc , counts , demand ) end end recalc . each_key do | mtype | module_set ( mtype ) . recalculate end return counts end
Load all of the modules from the supplied module path (independent of
module type).
Load all of the modules from the supplied module path ( independent of module type ) .
# Try to load modules from all the files in the supplied path # Skip non-ruby files # Skip unit test files # Skip files with a leading period # Return per-module loaded counts
bpath
<not_specific>
demand
<not_specific>