Added basic timed API calls including: pre/post soft/hard module load (+config load). post extension load. Added name tag to all extension config files

git-svn-id: https://beef.googlecode.com/svn/trunk@1181 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
passbe
2011-08-11 05:59:30 +00:00
parent 3167722af2
commit 887d93697f
20 changed files with 125 additions and 24 deletions

View File

@@ -39,8 +39,6 @@ module Core
@config = self.load(configuration_file)
# set default value if key? does not exist
@config.default = nil
load_extensions_config
load_modules_config
end
#
@@ -96,6 +94,7 @@ module Core
# load extensions configurations
#
def load_extensions_config
self.set('beef.extension', {})
Dir.glob("#{$root_dir}/extensions/*/config.yaml") do | cf |
y = self.load(cf)
if y != nil
@@ -109,11 +108,14 @@ module Core
# Load module configurations
#
def load_modules_config
self.set('beef.module', {})
Dir.glob("#{$root_dir}/modules/**/*/config.yaml") do | cf |
y = self.load(cf)
if y != nil
y['beef']['module'][y['beef']['module'].keys.first]['path'] = cf.gsub(/config\.yaml/, '')
@config = y.deep_merge(@config)
# API call for post module config load
BeEF::API.fire(BeEF::API::Configuration, 'module_configuration_load', y['beef']['module'].keys.first)
end
end
end