Class: Ronin::DB::Arch

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Model, Model::HasUniqueName
Defined in:
lib/ronin/db/arch.rb

Overview

Represents a Computer Architecture and predefines many other common architectures (Arch.x86, Arch.x86_64, Arch.ppc, Arch.ppc64, Arch.mips, Arch.mips_le, Arch.mips_be, Arch.arm, Arch.arm_le, and Arch.arm_be).

Instance Attribute Summary collapse

Attributes included from Model::HasUniqueName

#name

Class Method Summary collapse

Methods included from Model::HasUniqueName

included

Methods included from Model

included

Instance Attribute Details

#endian"little", "big"

Endianness of the architecture.

Returns:

  • ("little", "big")


48
# File 'lib/ronin/db/arch.rb', line 48

enum :endian, {little: 'little', big: 'big'}

#idInteger

The primary key of the arch.

Returns:

  • (Integer)


42
# File 'lib/ronin/db/arch.rb', line 42

attribute :id, :integer

#word_sizeInteger

Address length of the architecture.

Returns:

  • (Integer)


55
# File 'lib/ronin/db/arch.rb', line 55

attribute :word_size, :integer

Class Method Details

.armArch

The ARM Architecture

Returns:



136
137
138
# File 'lib/ronin/db/arch.rb', line 136

def self.arm
  find_or_create_by(name: 'ARM')
end

.arm_beArch

The ARM (big endian) Architecture

Returns:



154
155
156
# File 'lib/ronin/db/arch.rb', line 154

def self.arm_be
  find_or_create_by(name: 'ARM (Big-Endian)')
end

.arm_leArch

The ARM (little endian) Architecture

Returns:



145
146
147
# File 'lib/ronin/db/arch.rb', line 145

def self.arm_le
  find_or_create_by(name: 'ARM (Little-Endian)')
end

.i686Arch

The i686 Architecture

Returns:



73
74
75
# File 'lib/ronin/db/arch.rb', line 73

def self.i686
  find_or_create_by(name: 'i686')
end

.mipsArch

The MIPS Architecture

Returns:



109
110
111
# File 'lib/ronin/db/arch.rb', line 109

def self.mips
  find_or_create_by(name: 'MIPS')
end

.mips_beArch

The MIPS (big endian) Architecture

Returns:



127
128
129
# File 'lib/ronin/db/arch.rb', line 127

def self.mips_be
  find_or_create_by(name: 'MIPS (Big-Endian)')
end

.mips_leArch

The MIPS (little endian) Architecture

Returns:



118
119
120
# File 'lib/ronin/db/arch.rb', line 118

def self.mips_le
  find_or_create_by(name: 'MIPS (Little-Endian)')
end

.ppcArch

The 32-bit PowerPC Architecture

Returns:



91
92
93
# File 'lib/ronin/db/arch.rb', line 91

def self.ppc
  find_or_create_by(name: 'PPC')
end

.ppc64Arch

The 64-bit PowerPC Architecture

Returns:



100
101
102
# File 'lib/ronin/db/arch.rb', line 100

def self.ppc64
  find_or_create_by(name: 'PPC64')
end

.x86Arch

The x86 Architecture

Returns:



64
65
66
# File 'lib/ronin/db/arch.rb', line 64

def self.x86
  find_or_create_by(name: 'x86')
end

.x86_64Arch

The x86_64 Architecture

Returns:



82
83
84
# File 'lib/ronin/db/arch.rb', line 82

def self.x86_64
  find_or_create_by(name: 'x86-64')
end