2014-10-16 18:14:56 +00:00
|
|
|
module Msf::Module::Arch
|
2014-10-16 18:21:11 +00:00
|
|
|
#
|
|
|
|
# Attributes
|
|
|
|
#
|
|
|
|
|
|
|
|
# @!attribute arch
|
|
|
|
# The array of zero or more architectures.
|
|
|
|
attr_reader :arch
|
|
|
|
|
|
|
|
#
|
|
|
|
# Instance Methods
|
|
|
|
#
|
|
|
|
|
2014-10-16 18:14:56 +00:00
|
|
|
#
|
|
|
|
# Return whether or not the module supports the supplied architecture.
|
|
|
|
#
|
|
|
|
def arch?(what)
|
|
|
|
if (what == ARCH_ANY)
|
|
|
|
true
|
|
|
|
else
|
|
|
|
arch.index(what) != nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Return a comma separated list of supported architectures, if any.
|
|
|
|
#
|
|
|
|
def arch_to_s
|
|
|
|
arch.join(", ")
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Enumerate each architecture.
|
|
|
|
#
|
|
|
|
def each_arch(&block)
|
|
|
|
arch.each(&block)
|
|
|
|
end
|
2014-10-16 18:21:11 +00:00
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
#
|
|
|
|
# Attributes
|
|
|
|
#
|
|
|
|
|
|
|
|
attr_writer :arch
|
2014-10-16 18:14:56 +00:00
|
|
|
end
|