Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/msf/util/exe/osx/x64.rb
36043 views
1
module Msf::Util::EXE::OSX::X64
2
include Msf::Util::EXE::Common
3
include Msf::Util::EXE::OSX::Common
4
5
def self.included(base)
6
base.extend(ClassMethods)
7
end
8
9
module ClassMethods
10
# Create an x86_64 OSX Mach-O containing the payload provided in +code+
11
# self.to_osx_x64_macho
12
#
13
# @param framework [Msf::Framework] The framework of you want to use
14
# @param code [String]
15
# @param opts [Hash]
16
# @option [String] :template
17
# @return [String]
18
def to_osx_x64_macho(framework, code, opts = {})
19
set_template_default(opts, "template_x64_darwin.bin")
20
21
macho = self.get_file_contents(opts[:template])
22
bin = self.find_payload_tag(macho,
23
"Invalid Mac OS X x86_64 Mach-O template: missing \"PAYLOAD:\" tag")
24
macho[bin, code.length] = code
25
macho
26
end
27
end
28
class << self
29
include ClassMethods
30
end
31
end
32
33