Skip to content

Commit 3b8067e

Browse files
committed
fixes refactor error in msf/util/exe
1 parent 34f29f2 commit 3b8067e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/msf/util/exe.rb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -676,12 +676,9 @@ def self.to_osx_arm_macho(framework, code, opts = {})
676676
set_template_default(opts, "template_armle_darwin.bin")
677677

678678
mo = self.get_file_contents(opts[:template])
679-
puts "mo is #{mo.class}:len #{mo.length}"
680679
bo = self.find_payload_tag(mo, "Invalid OSX ArmLE Mach-O template: missing \"PAYLOAD:\" tag")
681-
puts "bo is #{bo.class}:#{bo.to_s}"
682680
mo[bo, code.length] = code
683-
puts "mo after is #{mo.class}:#{mo.to_s}:#{mo.length}"
684-
return mo
681+
mo
685682
end
686683

687684
def self.to_osx_ppc_macho(framework, code, opts = {})
@@ -1864,7 +1861,7 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
18641861
end
18651862
end
18661863
when 'macho', 'osx-app'
1867-
case arch
1864+
macho = case arch
18681865
when ARCH_X86,nil
18691866
to_osx_x86_macho(framework, code, exeopts)
18701867
when ARCH_X86_64
@@ -1876,7 +1873,7 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
18761873
when ARCH_PPC
18771874
to_osx_ppc_macho(framework, code, exeopts)
18781875
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
18801877
when 'vba'
18811878
Msf::Util::EXE.to_vba(framework, code, exeopts)
18821879
when 'vba-exe'
@@ -1957,7 +1954,7 @@ def self.get_file_contents(file, perms = "rb")
19571954
def self.find_payload_tag(mo, err_msg)
19581955
bo = mo.index('PAYLOAD:')
19591956
unless bo
1960-
raise RuntimeError, "Invalid OSX PPC Mach-O template: missing \"PAYLOAD:\" tag"
1957+
raise RuntimeError, err_msg
19611958
end
19621959
bo
19631960
end

0 commit comments

Comments
 (0)