Class: Rex::MachParsey::FatBase::FatHeader
- Inherits:
-
GenericHeader
- Object
- GenericStruct
- GenericHeader
- Rex::MachParsey::FatBase::FatHeader
- Defined in:
- lib/rex/machparsey/machbase.rb
Instance Attribute Summary collapse
-
#endian ⇒ Object
Returns the value of attribute endian.
-
#exists ⇒ Object
Returns the value of attribute exists.
-
#nfat_arch ⇒ Object
Returns the value of attribute nfat_arch.
Attributes inherited from GenericStruct
Instance Method Summary collapse
-
#initialize(rawdata) ⇒ FatHeader
constructor
A new instance of FatHeader.
Methods inherited from GenericStruct
#[], #keys, #method_missing, #v
Constructor Details
#initialize(rawdata) ⇒ FatHeader
Returns a new instance of FatHeader.
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 |
# File 'lib/rex/machparsey/machbase.rb', line 350 def initialize(rawdata) fat_header = FAT_HEADER_LSB.make_struct if !fat_header.from_s(rawdata) #raise something end magic = fat_header.v['magic'] if magic == FAT_MAGIC endian = ENDIAN_LSB elsif magic == FAT_CIGAM endian = ENDIAN_MSB fat_header = FAT_HEADER_MSB.make_struct if !fat_header.from_s(rawdata) raise FatHeaderError, "Could not parse FAT header" end else self.exists = 0 return end self.nfat_arch = fat_header.v['nfat_arch'] self.struct = fat_header self.endian = endian end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Rex::MachParsey::GenericStruct
Instance Attribute Details
#endian ⇒ Object
Returns the value of attribute endian.
348 349 350 |
# File 'lib/rex/machparsey/machbase.rb', line 348 def endian @endian end |
#exists ⇒ Object
Returns the value of attribute exists.
348 349 350 |
# File 'lib/rex/machparsey/machbase.rb', line 348 def exists @exists end |
#nfat_arch ⇒ Object
Returns the value of attribute nfat_arch.
348 349 350 |
# File 'lib/rex/machparsey/machbase.rb', line 348 def nfat_arch @nfat_arch end |