Path: blob/master/lib/msf/util/exe/osx/x64.rb
57477 views
# -*- coding: binary -*-1module Msf::Util::EXE::OSX::X642include Msf::Util::EXE::Common3include Msf::Util::EXE::OSX::Common45def self.included(base)6base.extend(ClassMethods)7end89module ClassMethods10# Create an x86_64 OSX Mach-O containing the payload provided in +code+11# self.to_osx_x64_macho12#13# @param framework [Msf::Framework] The framework of you want to use14# @param code [String]15# @param opts [Hash]16# @option [String] :template17# @return [String]18def to_osx_x64_macho(framework, code, opts = {})19set_template_default(opts, "template_x64_darwin.bin")2021macho = self.get_file_contents(opts[:template])22bin = self.find_payload_tag(macho,23"Invalid Mac OS X x86_64 Mach-O template: missing \"PAYLOAD:\" tag")24macho[bin, code.length] = code25macho26end27end28class << self29include ClassMethods30end31end323334