lib/msf/core/payload_generator.rb
# This method takes a payload module and tries to reconcile a chosen
# arch with the arches supported by the module.
# @param mod [Msf::Payload] The module class to choose an arch for
# @return [String] String form of the Arch if a valid arch found
# @return [Nil] if no valid arch found
This method takes a payload module and tries to reconcile a chosen
arch with the arches supported by the module.
This method takes a payload module and tries to reconcile a chosen arch with the arches supported by the module .
def choose_arch(mod)
      if arch.blank?
        @arch = mod.arch.first
        cli_print "No Arch selected, selecting Arch: #{arch} from the payload"
        datastore['ARCH'] = arch if mod.kind_of?(Msf::Payload::Generic)
        return mod.arch.first
      elsif mod.arch.include? arch
        datastore['ARCH'] = arch if mod.kind_of?(Msf::Payload::Generic)
        return arch
      else
        return nil
      end
    end
def choose_arch ( mod ) if arch . blank? @arch = mod . arch . first cli_print "No Arch selected, selecting Arch: #{arch} from the payload" datastore [ 'ARCH' ] = arch if mod . kind_of? ( Msf :: Payload :: Generic ) return mod . arch . first elsif mod . arch . include? arch datastore [ 'ARCH' ] = arch if mod . kind_of? ( Msf :: Payload :: Generic ) return arch else return nil end end
This method takes a payload module and tries to reconcile a chosen
arch with the arches supported by the module.
This method takes a payload module and tries to reconcile a chosen arch with the arches supported by the module .
String form of the Arch if a valid arch found
String form of the Arch if a valid arch found
String
if no valid arch found
if no valid arch found
Nil
mod
The module class to choose an arch for
The module class to choose an arch for