lib/msf/core/module_manager.rb
#
# Create an instance of the supplied module by its name
#
Create an instance of the supplied module by its name
Create an instance of the supplied module by its name
def create(name)
		klass    = get_hash_val(name)
		instance = nil
		if (klass.nil? or klass == SymbolicModule)
			if (module_type.nil?)
				MODULE_TYPES.each { |type|
					framework.modules.demand_load_module(type, name)
				}
			else
				framework.modules.demand_load_module(module_type, name)
			end
			recalculate
			klass = get_hash_val(name)
		end
		if (klass and klass != SymbolicModule)
			instance = klass.new
		end
		if (instance)
			self.framework.events.on_module_created(instance)
		end
		return instance
	end
def create ( name ) klass = get_hash_val ( name ) instance = nil if ( klass . nil? or klass == SymbolicModule ) if ( module_type . nil? ) MODULE_TYPES . each { | type | framework . modules . demand_load_module ( type , name ) } else framework . modules . demand_load_module ( module_type , name ) end recalculate klass = get_hash_val ( name ) end if ( klass and klass != SymbolicModule ) instance = klass . new end if ( instance ) self . framework . events . on_module_created ( instance ) end return instance end
Create an instance of the supplied module by its name
Create an instance of the supplied module by its name
# If there is no module associated with this class, then try to demand # load it. # If we are the root module set, then we need to try each module # type's demand loading until we find one that works for us. # If the klass is valid for this name, try to create it # Notify any general subscribers of the creation event
name
<not_specific>