Class: Rex::Exploitation::OpcodeDb::ImageModule::Segment

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/exploitation/opcodedb.rb

Overview

This class contains information about a module-associated segment.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Segment

Returns a new instance of Segment.



97
98
99
100
101
102
103
104
# File 'lib/rex/exploitation/opcodedb.rb', line 97

def initialize(hash)
  @type = hash['type']
  @base_address = hash['base_address'].to_i
  @size         = hash['segment_size'].to_i
  @writable     = hash['writable'] == "true" ? true : false
  @readable     = hash['readable'] == "true" ? true : false
  @executable   = hash['executable'] == "true" ? true : false
end

Instance Attribute Details

#base_addressObject (readonly)

The base address of the segment.



113
114
115
# File 'lib/rex/exploitation/opcodedb.rb', line 113

def base_address
  @base_address
end

#executableObject (readonly)

Boolean that indicates whether or not the segment is executable.



129
130
131
# File 'lib/rex/exploitation/opcodedb.rb', line 129

def executable
  @executable
end

#readableObject (readonly)

Boolean that indicates whether or not the segment is readable.



125
126
127
# File 'lib/rex/exploitation/opcodedb.rb', line 125

def readable
  @readable
end

#sizeObject (readonly)

The size of the segment in bytes.



117
118
119
# File 'lib/rex/exploitation/opcodedb.rb', line 117

def size
  @size
end

#typeObject (readonly)

The type of the segment, such as “.text”.



109
110
111
# File 'lib/rex/exploitation/opcodedb.rb', line 109

def type
  @type
end

#writableObject (readonly)

Boolean that indicates whether or not the segment is writable.



121
122
123
# File 'lib/rex/exploitation/opcodedb.rb', line 121

def writable
  @writable
end