File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed
modules/exploits/windows/fileformat Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,18 @@ def exploit
206
206
sploit << idx_line
207
207
208
208
file_create ( sploit )
209
- file_create ( '' , datastore [ 'FILENAME' ] . gsub ( /\. ccd$/ , '.img' ) )
209
+
210
+ # This extends the current class, and changes the file_format_name.
211
+ # This allows us to use the file_create(data) to store the created
212
+ # file in the correct directory.
213
+
214
+ class << self
215
+ def file_format_filename
216
+ datastore [ 'FILENAME' ] . gsub ( /\. ccd$/ , '.img' )
217
+ end
218
+ end
219
+
220
+ file_create ( '' )
210
221
end
211
222
212
- end
223
+ end
Original file line number Diff line number Diff line change @@ -111,9 +111,18 @@ def exploit
111
111
112
112
print_status ( "Creating '#{ datastore [ 'FILENAME' ] } ' using target '#{ target . name } ' ..." )
113
113
file_create ( cue_data )
114
- file_create ( '' , datastore [ 'FILENAME' ] . gsub ( /\. cue$/ , '.bin' ) )
115
114
115
+ # This extends the current class, and changes the file_format_name.
116
+ # This allows us to use the file_create(data) to store the created
117
+ # file in the correct directory.
116
118
119
+ class << self
120
+ def file_format_filename
121
+ datastore [ 'FILENAME' ] . gsub ( /\. cue$/ , '.bin' )
122
+ end
123
+ end
124
+
125
+ file_create ( '' )
117
126
end
118
127
119
- end
128
+ end
You can’t perform that action at this time.
0 commit comments