Module: Ronin::Payloads::Metadata::Arch::ClassMethods

Defined in:
lib/ronin/payloads/metadata/arch.rb

Overview

Class methods which will be added to the payload class which includes Ronin::Payloads::Metadata::Arch.

Instance Method Summary collapse

Instance Method Details

#arch(new_arch = nil) ⇒ :x86, ...

Gets or sets the payload's architecture.

Examples:

arch :x86_64

Parameters:

  • new_arch (:x86, :x86_64, :ia64, :amd64, :ppc, :ppc64, :mips, :mips_le, :mips_be, :mips64, :mips64_le, :mips64_be, :arm, :arm_le, :arm_be, :arm64, :arm64_le, :arm64_be, nil) (defaults to: nil)

    The optional new architecture to set.

Returns:

  • (:x86, :x86_64, :ia64, :amd64, :ppc, :ppc64, :mips, :mips_le, :mips_be, :mips64, :mips64_le, :mips64_be, :arm, :arm_le, :arm_be, :arm64, :arm64_le, :arm64_be, nil)

    The payload's architecture.



61
62
63
64
65
66
67
68
69
# File 'lib/ronin/payloads/metadata/arch.rb', line 61

def arch(new_arch=nil)
  if new_arch
    @arch = new_arch
  else
    @arch ||= if superclass.kind_of?(ClassMethods)
                superclass.arch
              end
  end
end