Class: MachO::Headers::PrelinkedKernelHeader

Inherits:
MachOStructure show all
Defined in:
lib/macho/headers.rb

Overview

Prelinked kernel/"kernelcache" header structure

Instance Method Summary collapse

Methods inherited from MachOStructure

bytesize, format, #initialize, new_from_bin

Constructor Details

This class inherits a constructor from MachO::MachOStructure

Instance Method Details

#adler32Integer

Returns a checksum for the uncompressed data.

Returns:

  • (Integer)

    a checksum for the uncompressed data



754
# File 'lib/macho/headers.rb', line 754

field :adler32, :uint32, :endian => :big

#compress_typeInteger

Returns the type of compression used.

Returns:

  • (Integer)

    the type of compression used



751
# File 'lib/macho/headers.rb', line 751

field :compress_type, :uint32, :endian => :big

#compressed_sizeInteger

Returns the size of the compressed data, in bytes.

Returns:

  • (Integer)

    the size of the compressed data, in bytes



760
# File 'lib/macho/headers.rb', line 760

field :compressed_size, :uint32, :endian => :big

#kaslr?Boolean

Returns whether this prelinked kernel supports KASLR.

Returns:

  • (Boolean)

    whether this prelinked kernel supports KASLR



775
776
777
# File 'lib/macho/headers.rb', line 775

def kaslr?
  prelink_version >= 1
end

#lzss?Boolean

Returns whether this prelinked kernel is compressed with LZSS.

Returns:

  • (Boolean)

    whether this prelinked kernel is compressed with LZSS



780
781
782
# File 'lib/macho/headers.rb', line 780

def lzss?
  compress_type == COMP_TYPE_LZSS
end

#lzvn?Boolean

Returns whether this prelinked kernel is compressed with LZVN.

Returns:

  • (Boolean)

    whether this prelinked kernel is compressed with LZVN



785
786
787
# File 'lib/macho/headers.rb', line 785

def lzvn?
  compress_type == COMP_TYPE_FASTLIB
end

#platform_namevoid

This method returns an undefined value.



769
# File 'lib/macho/headers.rb', line 769

field :platform_name, :string, :size => 64

Returns the version of the prelink format.

Returns:

  • (Integer)

    the version of the prelink format



763
# File 'lib/macho/headers.rb', line 763

field :prelink_version, :uint32, :endian => :big

#reservedvoid

This method returns an undefined value.



766
# File 'lib/macho/headers.rb', line 766

field :reserved, :string, :size => 40, :unpack => "L>10"

#root_pathvoid

This method returns an undefined value.



772
# File 'lib/macho/headers.rb', line 772

field :root_path, :string, :size => 256

#signatureInteger

Returns the magic number for a compressed header (COMPRESSED_MAGIC).

Returns:



748
# File 'lib/macho/headers.rb', line 748

field :signature, :uint32, :endian => :big

#to_hHash

Returns a hash representation of this MachO::Headers::PrelinkedKernelHeader.

Returns:



790
791
792
793
794
795
796
797
798
799
800
801
802
# File 'lib/macho/headers.rb', line 790

def to_h
  {
    "signature" => signature,
    "compress_type" => compress_type,
    "adler32" => adler32,
    "uncompressed_size" => uncompressed_size,
    "compressed_size" => compressed_size,
    "prelink_version" => prelink_version,
    "reserved" => reserved,
    "platform_name" => platform_name,
    "root_path" => root_path,
  }.merge super
end

#uncompressed_sizeInteger

Returns the size of the uncompressed data, in bytes.

Returns:

  • (Integer)

    the size of the uncompressed data, in bytes



757
# File 'lib/macho/headers.rb', line 757

field :uncompressed_size, :uint32, :endian => :big