Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/msf/util/exe/osx/common.rb
36043 views
1
module Msf::Util::EXE::OSX::Common
2
include Msf::Util::EXE::Common
3
def self.included(base)
4
base.extend(ClassMethods)
5
end
6
7
module ClassMethods
8
def to_executable_with_template(template_name, framework, code, opts = {})
9
# Allow the user to specify their own template
10
set_template_default(opts, template_name)
11
12
mo = self.get_file_contents(opts[:template])
13
bo = self.find_payload_tag(mo, "Invalid OSX ArmLE Mach-O template: missing \"PAYLOAD:\" tag")
14
mo[bo, code.length] = code
15
mo
16
end
17
end
18
class << self
19
include ClassMethods
20
end
21
end
22