Skip to content

Commit 8cb1bde

Browse files
committed
Landing rapid7#1849 - 32 and 64bit compatible to_winpe_only() function
2 parents deea66b + e48cfca commit 8cb1bde

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/msf/util/exe.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,11 @@ def self.to_win32pe(framework, code, opts={})
364364
exe
365365
end
366366

367-
def self.to_win32pe_only(framework, code, opts={})
367+
def self.to_winpe_only(framework, code, opts={}, arch="x86")
368368

369369
# Allow the user to specify their own EXE template
370-
set_template_default(opts, "template_x86_windows_old.exe")
370+
371+
set_template_default(opts, "template_"+arch+"_windows.exe")
371372

372373
pe = Rex::PeParsey::Pe.new_from_file(opts[:template], true)
373374

@@ -1968,7 +1969,11 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
19681969

19691970
when 'exe-only'
19701971
if(not arch or (arch.index(ARCH_X86)))
1971-
output = Msf::Util::EXE.to_win32pe_only(framework, code, exeopts)
1972+
output = Msf::Util::EXE.to_winpe_only(framework, code, exeopts)
1973+
end
1974+
1975+
if(arch and (arch.index( ARCH_X86_64 ) or arch.index( ARCH_X64 )))
1976+
output = Msf::Util::EXE.to_winpe_only(framework, code, exeopts, "x64")
19721977
end
19731978

19741979
when 'elf'

0 commit comments

Comments
 (0)