Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix a bug generating executables when no arch was defined

git-svn-id: file:///home/svn/framework3/trunk@6976 4d416f70-5f16-0410-b530-b9f4589650da
  • Loading branch information...
commit 7555e259db12a680a7c50da898f70d69a949aece 1 parent 882ae5b
@hmoore-r7 hmoore-r7 authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 msfencode
View
11 msfencode
@@ -191,8 +191,15 @@ case cmd
case fmt
when 'exe'
- exe = Msf::Util::EXE.to_win32pe($framework, raw) if arch.index( ARCH_X86 )
- exe = Msf::Util::EXE.to_win64pe($framework, raw) if arch.index( ARCH_X86_64 ) or arch.index( ARCH_X64 )
+ exe = nil
+ if(not arch or (arch.index(ARCH_X86)))
+ exe = Msf::Util::EXE.to_win32pe($framework, raw)
+ end
+
+ if(arch and (arch.index( ARCH_X86_64 ) or arch.index( ARCH_X64 )))
+ exe = Msf::Util::EXE.to_win64pe($framework, raw) if arch.index( ARCH_X86_64 ) or arch.index( ARCH_X64 )
+ end
+
if(not output)
$stdout.write(exe)
else
Please sign in to comment.
Something went wrong with that request. Please try again.