@@ -676,12 +676,9 @@ def self.to_osx_arm_macho(framework, code, opts = {})
676
676
set_template_default ( opts , "template_armle_darwin.bin" )
677
677
678
678
mo = self . get_file_contents ( opts [ :template ] )
679
- puts "mo is #{ mo . class } :len #{ mo . length } "
680
679
bo = self . find_payload_tag ( mo , "Invalid OSX ArmLE Mach-O template: missing \" PAYLOAD:\" tag" )
681
- puts "bo is #{ bo . class } :#{ bo . to_s } "
682
680
mo [ bo , code . length ] = code
683
- puts "mo after is #{ mo . class } :#{ mo . to_s } :#{ mo . length } "
684
- return mo
681
+ mo
685
682
end
686
683
687
684
def self . to_osx_ppc_macho ( framework , code , opts = { } )
@@ -1864,7 +1861,7 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
1864
1861
end
1865
1862
end
1866
1863
when 'macho' , 'osx-app'
1867
- case arch
1864
+ macho = case arch
1868
1865
when ARCH_X86 , nil
1869
1866
to_osx_x86_macho ( framework , code , exeopts )
1870
1867
when ARCH_X86_64
@@ -1876,7 +1873,7 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
1876
1873
when ARCH_PPC
1877
1874
to_osx_ppc_macho ( framework , code , exeopts )
1878
1875
end
1879
- Msf ::Util ::EXE . to_osx_app ( output ) if fmt == 'osx-app'
1876
+ fmt == 'osx-app' ? Msf ::Util ::EXE . to_osx_app ( macho ) : macho
1880
1877
when 'vba'
1881
1878
Msf ::Util ::EXE . to_vba ( framework , code , exeopts )
1882
1879
when 'vba-exe'
@@ -1957,7 +1954,7 @@ def self.get_file_contents(file, perms = "rb")
1957
1954
def self . find_payload_tag ( mo , err_msg )
1958
1955
bo = mo . index ( 'PAYLOAD:' )
1959
1956
unless bo
1960
- raise RuntimeError , "Invalid OSX PPC Mach-O template: missing \" PAYLOAD: \" tag"
1957
+ raise RuntimeError , err_msg
1961
1958
end
1962
1959
bo
1963
1960
end
0 commit comments