Fix constant names and 'exe-only'

That'll teach me to commit before the specs finish.

Really [FixRM #8149]
bug/bundler_fix
James Lee 2013-07-06 12:39:15 -05:00
parent 1b504197be
commit 00c7581099
2 changed files with 15 additions and 13 deletions

View File

@ -365,8 +365,11 @@ require 'digest/sha1'
def self.to_winpe_only(framework, code, opts={}, arch="x86") def self.to_winpe_only(framework, code, opts={}, arch="x86")
# Allow the user to specify their own EXE template if arch == ARCH_X86_64
arch = ARCH_X64
end
# Allow the user to specify their own EXE template
set_template_default(opts, "template_"+arch+"_windows.exe") set_template_default(opts, "template_"+arch+"_windows.exe")
pe = Rex::PeParsey::Pe.new_from_file(opts[:template], true) pe = Rex::PeParsey::Pe.new_from_file(opts[:template], true)
@ -1962,28 +1965,26 @@ End Sub
output = case arch output = case arch
when ARCH_X86,nil then to_win32pe_dll(framework, code, exeopts) when ARCH_X86,nil then to_win32pe_dll(framework, code, exeopts)
when ARCH_X86_64 then to_win64pe_dll(framework, code, exeopts) when ARCH_X86_64 then to_win64pe_dll(framework, code, exeopts)
when ARCH_64 then to_win64pe_dll(framework, code, exeopts) when ARCH_X64 then to_win64pe_dll(framework, code, exeopts)
end end
when 'exe' when 'exe'
output = case arch output = case arch
when ARCH_X86,nil then to_win32pe(framework, code, exeopts) when ARCH_X86,nil then to_win32pe(framework, code, exeopts)
when ARCH_X86_64 then to_win64pe(framework, code, exeopts) when ARCH_X86_64 then to_win64pe(framework, code, exeopts)
when ARCH_64 then to_win64pe(framework, code, exeopts) when ARCH_X64 then to_win64pe(framework, code, exeopts)
end end
when 'exe-small' when 'exe-small'
if(not arch or (arch.index(ARCH_X86))) output = case arch
output = Msf::Util::EXE.to_win32pe_old(framework, code, exeopts) when ARCH_X86,nil then to_win32pe_old(framework, code, exeopts)
end end
when 'exe-only' when 'exe-only'
if(not arch or (arch.index(ARCH_X86))) output = case arch
output = Msf::Util::EXE.to_winpe_only(framework, code, exeopts) when ARCH_X86,nil then to_winpe_only(framework, code, exeopts, arch)
end when ARCH_X86_64 then to_winpe_only(framework, code, exeopts, arch)
when ARCH_X64 then to_winpe_only(framework, code, exeopts, arch)
if(arch and (arch.index( ARCH_X86_64 ) or arch.index( ARCH_X64 ))) end
output = Msf::Util::EXE.to_winpe_only(framework, code, exeopts, "x64")
end
when 'elf' when 'elf'
if (not plat or (plat.index(Msf::Module::Platform::Linux))) if (not plat or (plat.index(Msf::Module::Platform::Linux)))

View File

@ -14,6 +14,7 @@ shared_context 'Msf::Util::Exe' do
#{ :format => "exe-small", :arch => "x64", :file_fp => /PE32\+/ }, #{ :format => "exe-small", :arch => "x64", :file_fp => /PE32\+/ },
{ :format => "exe-only", :arch => "x86", :file_fp => /PE32 / }, { :format => "exe-only", :arch => "x86", :file_fp => /PE32 / },
{ :format => "exe-only", :arch => "x64", :file_fp => /PE32\+ / }, { :format => "exe-only", :arch => "x64", :file_fp => /PE32\+ / },
{ :format => "exe-only", :arch => "x86_64", :file_fp => /PE32\+ / },
], ],
"linux" => [ "linux" => [
{ :format => "elf", :arch => "x86", :file_fp => /ELF 32.*SYSV/ }, { :format => "elf", :arch => "x86", :file_fp => /ELF 32.*SYSV/ },