Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/msf/util/exe/osx/ppc.rb
36043 views
1
module Msf::Util::EXE::OSX::Ppc
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 a PPC OSX Mach-O containing the payload provided in +code+
11
# to_osx_ppc_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_ppc_macho(framework, code, opts = {})
19
20
# Allow the user to specify their own template
21
set_template_default(opts, "template_ppc_darwin.bin")
22
23
mo = get_file_contents(opts[:template])
24
bo = find_payload_tag(mo, "Invalid OSX PPC Mach-O template: missing \"PAYLOAD:\" tag")
25
mo[bo, code.length] = code
26
mo
27
end
28
end
29
30
class << self
31
include ClassMethods
32
end
33
end
34
35