File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,8 @@ def exe_init_options(opts)
164
164
:sub_method => datastore [ 'EXE::OldMethod' ]
165
165
} )
166
166
167
+ # NOTE: If code and platform/arch are supplied, we use those values and skip initialization.
168
+ #
167
169
# This part is kind of tricky so we need to explain the logic behind the following load order.
168
170
# First off, platform can be seen from different sources:
169
171
#
@@ -180,7 +182,7 @@ def exe_init_options(opts)
180
182
#
181
183
# Architecture shares the same load order.
182
184
183
- unless opts [ :platform ]
185
+ unless opts [ :code ] && opts [ : platform]
184
186
if self . respond_to? ( :payload_instance ) && payload_instance . platform . platforms != [ Msf ::Module ::Platform ]
185
187
opts [ :platform ] = payload_instance . platform
186
188
elsif self . respond_to? :target_platform
@@ -190,11 +192,10 @@ def exe_init_options(opts)
190
192
end
191
193
end
192
194
193
- unless opts [ :arch ]
195
+ unless opts [ :code ] && opts [ : arch]
194
196
if self . respond_to? :payload_instance
195
197
opts [ :arch ] = payload_instance . arch
196
198
elsif self . respond_to? :target_arch
197
- $stderr. puts "target specific arch"
198
199
opts [ :arch ] = target_arch
199
200
elsif self . respond_to? :arch
200
201
opts [ :arch ] = arch
You can’t perform that action at this time.
0 commit comments