Skip to content

Commit 1af6c08

Browse files
committed
Land rapid7#8409, mark osx-app macho as executable
2 parents 57dc86b + a68a185 commit 1af6c08

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/msf/util/exe.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,10 @@ def self.to_osx_app(exe, opts = {})
887887
zip = Rex::Zip::Archive.new
888888
zip.add_file("#{app_name}/", '')
889889
zip.add_file("#{app_name}/Contents/", '')
890-
zip.add_file("#{app_name}/Contents/MacOS/", '')
891890
zip.add_file("#{app_name}/Contents/Resources/", '')
892-
zip.add_file("#{app_name}/Contents/MacOS/#{exe_name}", exe)
891+
zip.add_file("#{app_name}/Contents/MacOS/", '')
892+
# Add the macho and mark it as executable
893+
zip.add_file("#{app_name}/Contents/MacOS/#{exe_name}", exe).last.attrs = 0x10
893894
zip.add_file("#{app_name}/Contents/Info.plist", info_plist)
894895
zip.add_file("#{app_name}/Contents/PkgInfo", 'APPLaplt')
895896
zip.pack

0 commit comments

Comments
 (0)