Skip to content

Commit e844247

Browse files
author
agix
committed
Little change in exe-only to work with x64 arch.
1 parent 993a733 commit e844247

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/msf/util/exe.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,13 @@ 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")
372+
373+
puts opts
371374

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

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

19691972
when 'exe-only'
19701973
if(not arch or (arch.index(ARCH_X86)))
1971-
output = Msf::Util::EXE.to_win32pe_only(framework, code, exeopts)
1974+
output = Msf::Util::EXE.to_winpe_only(framework, code, exeopts)
1975+
end
1976+
1977+
if(arch and (arch.index( ARCH_X86_64 ) or arch.index( ARCH_X64 )))
1978+
output = Msf::Util::EXE.to_winpe_only(framework, code, exeopts, "x64")
19721979
end
19731980

19741981
when 'elf'

0 commit comments

Comments
 (0)