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.
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/rex/machparsey/machbase.rb', line 261 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.
259 260 261 |
# File 'lib/rex/machparsey/machbase.rb', line 259 def _bits @_bits end |
#_endian ⇒ Object
Returns the value of attribute _endian.
259 260 261 |
# File 'lib/rex/machparsey/machbase.rb', line 259 def _endian @_endian end |
Instance Method Details
#FileOff ⇒ Object
296 297 298 |
# File 'lib/rex/machparsey/machbase.rb', line 296 def FileOff v['fileoff'] end |
#FileSize ⇒ Object
300 301 302 |
# File 'lib/rex/machparsey/machbase.rb', line 300 def FileSize v['filesize'] end |
#Segname ⇒ Object
284 285 286 |
# File 'lib/rex/machparsey/machbase.rb', line 284 def Segname v['segname'] end |
#Vmaddr ⇒ Object
288 289 290 |
# File 'lib/rex/machparsey/machbase.rb', line 288 def Vmaddr v['vmaddr'] end |
#Vmsize ⇒ Object
292 293 294 |
# File 'lib/rex/machparsey/machbase.rb', line 292 def Vmsize v['vmsize'] end |