Class: MachO::Headers::PrelinkedKernelHeader
- Inherits:
-
MachOStructure
- Object
- MachOStructure
- MachO::Headers::PrelinkedKernelHeader
- Defined in:
- lib/macho/headers.rb
Overview
Prelinked kernel/"kernelcache" header structure
Constant Summary collapse
- FORMAT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"L>6a40a64a256"- SIZEOF =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
384
Instance Attribute Summary collapse
-
#adler32 ⇒ Integer
readonly
A checksum for the uncompressed data.
-
#compress_type ⇒ Integer
readonly
The type of compression used.
-
#compressed_size ⇒ Integer
readonly
The size of the compressed data, in bytes.
- #platform_name ⇒ void readonly
-
#prelink_version ⇒ Integer
readonly
The version of the prelink format.
- #reserved ⇒ void readonly
- #root_path ⇒ void readonly
-
#signature ⇒ Integer
readonly
The magic number for a compressed header (COMPRESSED_MAGIC).
-
#uncompressed_size ⇒ Integer
readonly
The size of the uncompressed data, in bytes.
Instance Method Summary collapse
-
#initialize(signature, compress_type, adler32, uncompressed_size, compressed_size, prelink_version, reserved, platform_name, root_path) ⇒ PrelinkedKernelHeader
constructor
private
A new instance of PrelinkedKernelHeader.
-
#kaslr? ⇒ Boolean
Whether this prelinked kernel supports KASLR.
-
#lzss? ⇒ Boolean
Whether this prelinked kernel is compressed with LZSS.
-
#lzvn? ⇒ Boolean
Whether this prelinked kernel is compressed with LZVN.
-
#to_h ⇒ Hash
A hash representation of this PrelinkedKernelHeader.
Methods inherited from MachOStructure
Constructor Details
#initialize(signature, compress_type, adler32, uncompressed_size, compressed_size, prelink_version, reserved, platform_name, root_path) ⇒ PrelinkedKernelHeader
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of PrelinkedKernelHeader.
853 854 855 856 857 858 859 860 861 862 863 864 865 |
# File 'lib/macho/headers.rb', line 853 def initialize(signature, compress_type, adler32, uncompressed_size, compressed_size, prelink_version, reserved, platform_name, root_path) super() @signature = signature @compress_type = compress_type @adler32 = adler32 @uncompressed_size = uncompressed_size @compressed_size = compressed_size @prelink_version = prelink_version @reserved = reserved.unpack("L>10") @platform_name = platform_name @root_path = root_path end |
Instance Attribute Details
#adler32 ⇒ Integer (readonly)
Returns a checksum for the uncompressed data.
824 825 826 |
# File 'lib/macho/headers.rb', line 824 def adler32 @adler32 end |
#compress_type ⇒ Integer (readonly)
Returns the type of compression used.
821 822 823 |
# File 'lib/macho/headers.rb', line 821 def compress_type @compress_type end |
#compressed_size ⇒ Integer (readonly)
Returns the size of the compressed data, in bytes.
830 831 832 |
# File 'lib/macho/headers.rb', line 830 def compressed_size @compressed_size end |
#platform_name ⇒ void (readonly)
This method returns an undefined value.
839 840 841 |
# File 'lib/macho/headers.rb', line 839 def platform_name @platform_name end |
#prelink_version ⇒ Integer (readonly)
Returns the version of the prelink format.
833 834 835 |
# File 'lib/macho/headers.rb', line 833 def prelink_version @prelink_version end |
#reserved ⇒ void (readonly)
This method returns an undefined value.
836 837 838 |
# File 'lib/macho/headers.rb', line 836 def reserved @reserved end |
#root_path ⇒ void (readonly)
This method returns an undefined value.
842 843 844 |
# File 'lib/macho/headers.rb', line 842 def root_path @root_path end |
#signature ⇒ Integer (readonly)
Returns the magic number for a compressed header (COMPRESSED_MAGIC).
818 819 820 |
# File 'lib/macho/headers.rb', line 818 def signature @signature end |
#uncompressed_size ⇒ Integer (readonly)
Returns the size of the uncompressed data, in bytes.
827 828 829 |
# File 'lib/macho/headers.rb', line 827 def uncompressed_size @uncompressed_size end |
Instance Method Details
#kaslr? ⇒ Boolean
Returns whether this prelinked kernel supports KASLR.
868 869 870 |
# File 'lib/macho/headers.rb', line 868 def kaslr? prelink_version >= 1 end |
#lzss? ⇒ Boolean
Returns whether this prelinked kernel is compressed with LZSS.
873 874 875 |
# File 'lib/macho/headers.rb', line 873 def lzss? compress_type == COMP_TYPE_LZSS end |
#lzvn? ⇒ Boolean
Returns whether this prelinked kernel is compressed with LZVN.
878 879 880 |
# File 'lib/macho/headers.rb', line 878 def lzvn? compress_type == COMP_TYPE_FASTLIB end |
#to_h ⇒ Hash
Returns a hash representation of this MachO::Headers::PrelinkedKernelHeader.
883 884 885 886 887 888 889 890 891 892 893 894 895 |
# File 'lib/macho/headers.rb', line 883 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 |