Skip to content

Commit 0035f2e

Browse files
committed
Speed up msfcli help
If the user only wants to see help, then no point to load things that will actually never be used by msfcli. Only rex is needed.
1 parent 48666f1 commit 0035f2e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

msfcli

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,7 @@ while File.symlink?(msfbase)
1616
end
1717

1818
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), 'lib')))
19-
require 'fastlib'
20-
require 'msfenv'
21-
22-
23-
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
24-
2519
require 'rex'
26-
require 'msf/ui'
27-
require 'msf/base'
2820

2921
Indent = ' '
3022

@@ -61,6 +53,12 @@ module_class = "exploit"
6153

6254
if(exploit_name == "-h")
6355
usage()
56+
else
57+
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
58+
require 'fastlib'
59+
require 'msfenv'
60+
require 'msf/ui'
61+
require 'msf/base'
6462
end
6563

6664
# Initialize the simplified framework instance.

0 commit comments

Comments
 (0)