Module: MachO::MachOStructure::Fields

Defined in:
lib/macho/structure.rb

Overview

Constants used for parsing MachOStructure fields

Constant Summary collapse

BYTE_SIZE =

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.

association of field types to byte size

{
  # Binary slices
  :string => nil,
  :null_padded_string => nil,
  :int32 => 4,
  :uint32 => 4,
  :uint64 => 8,
  # Classes
  :view => 0,
  :lcstr => 4,
  :two_level_hints_table => 0,
  :tool_entries => 4,
}.freeze
FORMAT_CODE =

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.

association of field types with ruby format codes Binary format codes can be found here: https://docs.ruby-lang.org/en/2.6.0/String.html#method-i-unpack

The equals sign is used to manually change endianness using the Utils#specialize_format() method.

{
  # Binary slices
  :string => "a",
  :null_padded_string => "Z",
  :int32 => "l=",
  :uint32 => "L=",
  :uint64 => "Q=",
  # Classes
  :view => "",
  :lcstr => "L=",
  :two_level_hints_table => "",
  :tool_entries => "L=",
}.freeze
CLASSES_TO_INIT =

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.

A list of classes that must get initialized To add a new class append it here and add the init method to the def_class_reader method

%i[lcstr tool_entries two_level_hints_table].freeze
NO_ARG_REQUIRED =

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.

A list of fields that don't require arguments in the initializer Used to calculate MachOStructure#min_args

%i[two_level_hints_table].freeze