Skip to content

Commit ab976dd

Browse files
committed
Fix genarate command in msfconsole
Thanks @Meatballs1 for spotting
1 parent 55147d9 commit ab976dd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/msf/util/exe.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1952,7 +1952,16 @@ def self.win32_rwx_exec_thread(code, block_offset, which_offset='start')
19521952
# @return [nil] If the format is unrecognized or the arch and plat don't
19531953
# make sense together.
19541954
def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
1955-
output = nil
1955+
# For backwards compatibility with the way this gets called when
1956+
# generating from Msf::Simple::Payload.generate_simple
1957+
if arch.kind_of? Array
1958+
output = nil
1959+
arch.each do |a|
1960+
output = to_executable_fmt(framework, a, plat, code, fmt, exeopts)
1961+
break if output
1962+
end
1963+
return output
1964+
end
19561965

19571966
case fmt
19581967
when 'asp'

0 commit comments

Comments
 (0)