@@ -17,32 +17,32 @@ class RPC_Plugin < RPC_Base
17
17
# # Load the nexpose plugin
18
18
# rpc.call('plugin.load', 'nexpose')
19
19
def rpc_load ( path , xopts = { } )
20
- opts = { }
20
+ opts = { }
21
21
22
- xopts . each do |k , v |
22
+ xopts . each do |k , v |
23
23
if k . class == String
24
24
opts [ k . to_sym ] = v
25
25
end
26
26
end
27
27
28
- if ( path !~ /#{ File ::SEPARATOR } / )
28
+ if path !~ /#{ File ::SEPARATOR } /
29
29
plugin_file_name = path
30
30
31
31
# If the plugin isn't in the user direcotry (~/.msf3/plugins/), use the base
32
32
path = Msf ::Config . user_plugin_directory + File ::SEPARATOR + plugin_file_name
33
- if not File . exist? ( path + ".rb" )
33
+ if not File . exist? ( path + ".rb" )
34
34
# If the following "path" doesn't exist it will be caught when we attempt to load
35
35
path = Msf ::Config . plugin_directory + File ::SEPARATOR + plugin_file_name
36
36
end
37
37
end
38
38
39
39
begin
40
- if ( inst = self . framework . plugins . load ( path , opts ) )
41
- return { "result" => "success" }
40
+ if self . framework . plugins . load ( path , opts )
41
+ return { "result" => "success" }
42
42
end
43
43
rescue ::Exception => e
44
- elog ( "Error loading plugin #{ path } : #{ e } \n \n #{ e . backtrace . join ( "\n " ) } " , src = 'core' , level = 0 , from = caller )
45
- return { "result" => "failure" }
44
+ elog ( "Error loading plugin #{ path } : #{ e } \n \n #{ e . backtrace . join ( "\n " ) } " , 'core' , 0 , caller )
45
+ return { "result" => "failure" }
46
46
end
47
47
48
48
end
@@ -63,10 +63,10 @@ def rpc_unload(name)
63
63
# Unload the plugin if it matches the name we're searching for
64
64
if plugin
65
65
self . framework . plugins . unload ( plugin )
66
- return { "result" => "success" }
66
+ return { "result" => "success" }
67
67
end
68
68
69
- return { "result" => "failure" }
69
+ { "result" => "failure" }
70
70
end
71
71
72
72
@@ -79,7 +79,7 @@ def rpc_unload(name)
79
79
def rpc_loaded
80
80
ret = { }
81
81
ret [ :plugins ] = [ ]
82
- self . framework . plugins . each do |plugin |
82
+ self . framework . plugins . each do |plugin |
83
83
ret [ :plugins ] << plugin . name
84
84
end
85
85
ret
0 commit comments