Class: Rex::MachParsey::MachBase::Segment
- Inherits:
-
GenericHeader
- Object
- GenericStruct
- GenericHeader
- Rex::MachParsey::MachBase::Segment
- Defined in:
- lib/rex/machparsey/machbase.rb
Instance Attribute Summary collapse
-
#_bits ⇒ Object
Returns the value of attribute _bits.
-
#_endian ⇒ Object
Returns the value of attribute _endian.
Attributes inherited from GenericStruct
Instance Method Summary collapse
- #FileOff ⇒ Object
- #FileSize ⇒ Object
-
#initialize(rawdata, bits, endian) ⇒ Segment
constructor
A new instance of Segment.
- #Segname ⇒ Object
- #Vmaddr ⇒ Object
- #Vmsize ⇒ Object
Methods inherited from GenericStruct
#[], #keys, #method_missing, #v
Constructor Details
#initialize(rawdata, bits, endian) ⇒ Segment
Returns a new instance of Segment.
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/rex/machparsey/machbase.rb', line 262 def initialize(rawdata, bits, endian) self._bits = bits if bits == BITS_64 if endian == ENDIAN_MSB segment_command = SEGMENT_COMMAND_64_MSB.make_struct else segment_command = SEGMENT_COMMAND_64_LSB.make_struct end else if endian == ENDIAN_MSB segment_command = SEGMENT_COMMAND_MSB.make_struct else segment_command = SEGMENT_COMMAND_LSB.make_struct end end if !segment_command.from_s(rawdata) raise MachParseError, "Couldn't parse segment command" end self.struct = segment_command end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Rex::MachParsey::GenericStruct
Instance Attribute Details
#_bits ⇒ Object
Returns the value of attribute _bits.
260 261 262 |
# File 'lib/rex/machparsey/machbase.rb', line 260 def _bits @_bits end |
#_endian ⇒ Object
Returns the value of attribute _endian.
260 261 262 |
# File 'lib/rex/machparsey/machbase.rb', line 260 def _endian @_endian end |
Instance Method Details
#FileOff ⇒ Object
297 298 299 |
# File 'lib/rex/machparsey/machbase.rb', line 297 def FileOff v['fileoff'] end |
#FileSize ⇒ Object
301 302 303 |
# File 'lib/rex/machparsey/machbase.rb', line 301 def FileSize v['filesize'] end |
#Segname ⇒ Object
285 286 287 |
# File 'lib/rex/machparsey/machbase.rb', line 285 def Segname v['segname'] end |
#Vmaddr ⇒ Object
289 290 291 |
# File 'lib/rex/machparsey/machbase.rb', line 289 def Vmaddr v['vmaddr'] end |
#Vmsize ⇒ Object
293 294 295 |
# File 'lib/rex/machparsey/machbase.rb', line 293 def Vmsize v['vmsize'] end |