@@ -505,10 +505,10 @@ module Headers
505
505
# @see MachO::FatArch
506
506
class FatHeader < MachOStructure
507
507
# @return [Integer] the magic number of the header (and file)
508
- field :magic , :uint32_net
508
+ field :magic , :uint32 , :endian => :big
509
509
510
510
# @return [Integer] the number of fat architecture structures following the header
511
- field :nfat_arch , :uint32_net
511
+ field :nfat_arch , :uint32 , :endian => :big
512
512
513
513
# @return [String] the serialized fields of the fat header
514
514
def serialize
@@ -532,19 +532,19 @@ def to_h
532
532
# @see MachO::Headers::FatHeader
533
533
class FatArch < MachOStructure
534
534
# @return [Integer] the CPU type of the Mach-O
535
- field :cputype , :uint32_net
535
+ field :cputype , :uint32 , :endian => :big
536
536
537
537
# @return [Integer] the CPU subtype of the Mach-O
538
- field :cpusubtype , :uint32_net , :mask => CPU_SUBTYPE_MASK
538
+ field :cpusubtype , :uint32 , :endian => :big , :mask => CPU_SUBTYPE_MASK
539
539
540
540
# @return [Integer] the file offset to the beginning of the Mach-O data
541
- field :offset , :uint32_net
541
+ field :offset , :uint32 , :endian => :big
542
542
543
543
# @return [Integer] the size, in bytes, of the Mach-O data
544
- field :size , :uint32_net
544
+ field :size , :uint32 , :endian => :big
545
545
546
546
# @return [Integer] the alignment, as a power of 2
547
- field :align , :uint32_net
547
+ field :align , :uint32 , :endian => :big
548
548
549
549
# @return [String] the serialized fields of the fat arch
550
550
def serialize
@@ -572,13 +572,13 @@ def to_h
572
572
# @see MachO::Headers::FatHeader
573
573
class FatArch64 < FatArch
574
574
# @return [Integer] the file offset to the beginning of the Mach-O data
575
- field :offset , :uint64_net
575
+ field :offset , :uint64 , :endian => :big
576
576
577
577
# @return [Integer] the size, in bytes, of the Mach-O data
578
- field :size , :uint64_net
578
+ field :size , :uint64 , :endian => :big
579
579
580
580
# @return [void]
581
- field :reserved , :uint32_net , :default => 0
581
+ field :reserved , :uint32 , :endian => :big , :default => 0
582
582
583
583
# @return [String] the serialized fields of the fat arch
584
584
def serialize
@@ -733,31 +733,31 @@ def to_h
733
733
# Prelinked kernel/"kernelcache" header structure
734
734
class PrelinkedKernelHeader < MachOStructure
735
735
# @return [Integer] the magic number for a compressed header ({COMPRESSED_MAGIC})
736
- field :signature , :uint32_net
736
+ field :signature , :uint32 , :endian => :big
737
737
738
738
# @return [Integer] the type of compression used
739
- field :compress_type , :uint32_net
739
+ field :compress_type , :uint32 , :endian => :big
740
740
741
741
# @return [Integer] a checksum for the uncompressed data
742
- field :adler32 , :uint32_net
742
+ field :adler32 , :uint32 , :endian => :big
743
743
744
744
# @return [Integer] the size of the uncompressed data, in bytes
745
- field :uncompressed_size , :uint32_net
745
+ field :uncompressed_size , :uint32 , :endian => :big
746
746
747
747
# @return [Integer] the size of the compressed data, in bytes
748
- field :compressed_size , :uint32_net
748
+ field :compressed_size , :uint32 , :endian => :big
749
749
750
750
# @return [Integer] the version of the prelink format
751
- field :prelink_version , :uint32_net
751
+ field :prelink_version , :uint32 , :endian => :big
752
752
753
753
# @return [void]
754
- field :reserved , :bin_string , :size => 40 , :unpack => "L>10"
754
+ field :reserved , :binary , :size => 40 , :unpack => "L>10"
755
755
756
756
# @return [void]
757
- field :platform_name , :bin_string , :size => 64
757
+ field :platform_name , :binary , :size => 64
758
758
759
759
# @return [void]
760
- field :root_path , :bin_string , :size => 256
760
+ field :root_path , :binary , :size => 256
761
761
762
762
# @return [Boolean] whether this prelinked kernel supports KASLR
763
763
def kaslr?
0 commit comments