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
57477 views
1
# -*- coding: binary -*-
2
module Msf::Util::EXE::OSX::Common
3
include Msf::Util::EXE::Common
4
def self.included(base)
5
base.extend(ClassMethods)
6
end
7
8
module ClassMethods
9
def to_executable_with_template(template_name, framework, code, opts = {})
10
# Allow the user to specify their own template
11
set_template_default(opts, template_name)
12
13
mo = self.get_file_contents(opts[:template])
14
bo = self.find_payload_tag(mo, "Invalid OSX ArmLE Mach-O template: missing \"PAYLOAD:\" tag")
15
mo[bo, code.length] = code
16
mo
17
end
18
end
19
class << self
20
include ClassMethods
21
end
22
end
23