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.



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

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.



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

def base_address
  @base_address
end

#executableObject (readonly)

Boolean that indicates whether or not the segment is executable.



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

def executable
  @executable
end

#readableObject (readonly)

Boolean that indicates whether or not the segment is readable.



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

def readable
  @readable
end

#sizeObject (readonly)

The size of the segment in bytes.



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

def size
  @size
end

#typeObject (readonly)

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



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

def type
  @type
end

#writableObject (readonly)

Boolean that indicates whether or not the segment is writable.



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

def writable
  @writable
end