@@ -13,7 +13,7 @@ class Payload
13
13
include Msf ::Ui ::Console ::ModuleCommandDispatcher
14
14
15
15
# Load supported formats
16
- supported_formats = \
16
+ @@ supported_formats = \
17
17
Msf ::Simple ::Buffer . transform_formats + \
18
18
Msf ::Util ::EXE . to_executable_fmt_formats
19
19
@@ -25,7 +25,7 @@ class Payload
25
25
"-o" => [ true , "A comma separated list of options in VAR=VAL format." ] ,
26
26
"-s" => [ true , "NOP sled length." ] ,
27
27
"-f" => [ true , "The output file name (otherwise stdout)" ] ,
28
- "-t" => [ true , "The output format: #{ supported_formats . join ( ',' ) } " ] ,
28
+ "-t" => [ true , "The output format: #{ @@ supported_formats. join ( ',' ) } " ] ,
29
29
"-p" => [ true , "The Platform for output." ] ,
30
30
"-k" => [ false , "Keep the template executable functional" ] ,
31
31
"-x" => [ true , "The executable template to use" ] ,
@@ -151,6 +151,25 @@ def cmd_generate(*args)
151
151
end
152
152
true
153
153
end
154
+
155
+ def cmd_generate_tabs ( str , words )
156
+ last_word = words [ -1 ]
157
+ fmt = @@generate_opts . fmt
158
+ fmt = fmt . select { |key , value | last_word == key || !words . include? ( key ) }
159
+
160
+ option = fmt [ last_word ]
161
+ return fmt . keys if !option || !option [ 0 ]
162
+
163
+ tabs = [ ]
164
+ case last_word
165
+ when '-e'
166
+ tabs = framework . encoders . map { |refname , mod | refname }
167
+ when '-f'
168
+ tabs = tab_complete_filenames ( str , words )
169
+ when '-t'
170
+ tabs = @@supported_formats
171
+ end
172
+ end
154
173
end
155
174
end
156
175
end
0 commit comments