Module: Msf::Simple::Framework::ModulePaths

Included in:
Msf::Simple::Framework
Defined in:
lib/msf/base/simple/framework/module_paths.rb

Instance Method Summary collapse

Instance Method Details

#init_module_paths(opts = {}) ⇒ void

This method returns an undefined value.

Initialize the module paths


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/msf/base/simple/framework/module_paths.rb', line 8

def init_module_paths(opts={})
  # Ensure the module cache is accurate
  self.modules.refresh_cache_from_database

  # Initialize the default module search paths
  if (Msf::Config.module_directory)
    self.modules.add_module_path(Msf::Config.module_directory, opts)
  end

  # Initialize the user module search path
  if (Msf::Config.user_module_directory)
    self.modules.add_module_path(Msf::Config.user_module_directory, opts)
  end

  # If additional module paths have been defined globally, then load them.
  # They should be separated by semi-colons.
  if self.datastore['MsfModulePaths']
    self.datastore['MsfModulePaths'].split(";").each { |path|
      self.modules.add_module_path(path, opts)
    }
  end
end