Path: blob/master/lib/msf/util/exe/osx/x64.rb
36043 views
module Msf::Util::EXE::OSX::X641include Msf::Util::EXE::Common2include Msf::Util::EXE::OSX::Common34def self.included(base)5base.extend(ClassMethods)6end78module ClassMethods9# Create an x86_64 OSX Mach-O containing the payload provided in +code+10# self.to_osx_x64_macho11#12# @param framework [Msf::Framework] The framework of you want to use13# @param code [String]14# @param opts [Hash]15# @option [String] :template16# @return [String]17def to_osx_x64_macho(framework, code, opts = {})18set_template_default(opts, "template_x64_darwin.bin")1920macho = self.get_file_contents(opts[:template])21bin = self.find_payload_tag(macho,22"Invalid Mac OS X x86_64 Mach-O template: missing \"PAYLOAD:\" tag")23macho[bin, code.length] = code24macho25end26end27class << self28include ClassMethods29end30end313233