@@ -365,8 +365,11 @@ def self.to_win32pe(framework, code, opts={})
365
365
366
366
def self . to_winpe_only ( framework , code , opts = { } , arch = "x86" )
367
367
368
- # Allow the user to specify their own EXE template
368
+ if arch == ARCH_X86_64
369
+ arch = ARCH_X64
370
+ end
369
371
372
+ # Allow the user to specify their own EXE template
370
373
set_template_default ( opts , "template_" +arch +"_windows.exe" )
371
374
372
375
pe = Rex ::PeParsey ::Pe . new_from_file ( opts [ :template ] , true )
@@ -1962,28 +1965,26 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
1962
1965
output = case arch
1963
1966
when ARCH_X86 , nil then to_win32pe_dll ( framework , code , exeopts )
1964
1967
when ARCH_X86_64 then to_win64pe_dll ( framework , code , exeopts )
1965
- when ARCH_64 then to_win64pe_dll ( framework , code , exeopts )
1968
+ when ARCH_X64 then to_win64pe_dll ( framework , code , exeopts )
1966
1969
end
1967
1970
when 'exe'
1968
1971
output = case arch
1969
1972
when ARCH_X86 , nil then to_win32pe ( framework , code , exeopts )
1970
1973
when ARCH_X86_64 then to_win64pe ( framework , code , exeopts )
1971
- when ARCH_64 then to_win64pe ( framework , code , exeopts )
1974
+ when ARCH_X64 then to_win64pe ( framework , code , exeopts )
1972
1975
end
1973
1976
1974
1977
when 'exe-small'
1975
- if ( not arch or ( arch . index ( ARCH_X86 ) ) )
1976
- output = Msf :: Util :: EXE . to_win32pe_old ( framework , code , exeopts )
1977
- end
1978
+ output = case arch
1979
+ when ARCH_X86 , nil then to_win32pe_old ( framework , code , exeopts )
1980
+ end
1978
1981
1979
1982
when 'exe-only'
1980
- if ( not arch or ( arch . index ( ARCH_X86 ) ) )
1981
- output = Msf ::Util ::EXE . to_winpe_only ( framework , code , exeopts )
1982
- end
1983
-
1984
- if ( arch and ( arch . index ( ARCH_X86_64 ) or arch . index ( ARCH_X64 ) ) )
1985
- output = Msf ::Util ::EXE . to_winpe_only ( framework , code , exeopts , "x64" )
1986
- end
1983
+ output = case arch
1984
+ when ARCH_X86 , nil then to_winpe_only ( framework , code , exeopts , arch )
1985
+ when ARCH_X86_64 then to_winpe_only ( framework , code , exeopts , arch )
1986
+ when ARCH_X64 then to_winpe_only ( framework , code , exeopts , arch )
1987
+ end
1987
1988
1988
1989
when 'elf'
1989
1990
if ( not plat or ( plat . index ( Msf ::Module ::Platform ::Linux ) ) )
0 commit comments