From 2eddfa344457b2ab26751709121e5de9ae3c6e12 Mon Sep 17 00:00:00 2001 From: Alexandre Maloteaux Date: Mon, 25 Jun 2012 03:12:33 +0100 Subject: [PATCH] fix bsd ans solaris platform when using encoder too --- lib/msf/util/exe.rb | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/msf/util/exe.rb b/lib/msf/util/exe.rb index 498610b721..a317a90fb3 100755 --- a/lib/msf/util/exe.rb +++ b/lib/msf/util/exe.rb @@ -1870,12 +1870,20 @@ End Sub end when 'elf' - if (not arch or (arch.index(ARCH_X86))) - output = Msf::Util::EXE.to_linux_x86_elf(framework, code, exeopts) - end - - if (arch and (arch.index( ARCH_X86_64 ) or arch.index( ARCH_X64 ))) - output = Msf::Util::EXE.to_linux_x64_elf(framework, code, exeopts) + if (not plat or (plat.index(Msf::Module::Platform::Linux))) + if (not arch or (arch.index(ARCH_X86))) + output = Msf::Util::EXE.to_linux_x86_elf(framework, code, exeopts) + elsif (arch and (arch.index( ARCH_X86_64 ) or arch.index( ARCH_X64 ))) + output = Msf::Util::EXE.to_linux_x64_elf(framework, code, exeopts) + end + elsif(plat and (plat.index(Msf::Module::Platform::BSD))) + if (not arch or (arch.index(ARCH_X86))) + output = Msf::Util::EXE.to_bsd_x86_elf(framework, code, exeopts) + end + elsif(plat and (plat.index(Msf::Module::Platform::Solaris))) + if (not arch or (arch.index(ARCH_X86))) + output = Msf::Util::EXE.to_solaris_x86_elf(framework, code, exeopts) + end end when 'macho'