Class: MachO::LoadCommands::RoutinesCommand

Inherits:
LoadCommand show all
Defined in:
lib/macho/load_commands.rb

Overview

A load command containing the address of the dynamic shared library initialization routine and an index into the module table for the module that defines the routine. Corresponds to LC_ROUTINES.

Direct Known Subclasses

RoutinesCommand64

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=10"
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.

40

Instance Attribute Summary collapse

Attributes inherited from LoadCommand

#cmd, #cmdsize, #view

Instance Method Summary collapse

Methods inherited from LoadCommand

create, new_from_bin, #offset, #serializable?, #serialize, #to_s, #type

Methods inherited from MachOStructure

bytesize, new_from_bin

Constructor Details

#initialize(view, cmd, cmdsize, init_address, init_module, reserved1, reserved2, reserved3, reserved4, reserved5, reserved6) ⇒ RoutinesCommand

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 RoutinesCommand.



734
735
736
737
738
739
740
741
742
743
744
745
# File 'lib/macho/load_commands.rb', line 734

def initialize(view, cmd, cmdsize, init_address, init_module, reserved1,
               reserved2, reserved3, reserved4, reserved5, reserved6)
  super(view, cmd, cmdsize)
  @init_address = init_address
  @init_module = init_module
  @reserved1 = reserved1
  @reserved2 = reserved2
  @reserved3 = reserved3
  @reserved4 = reserved4
  @reserved5 = reserved5
  @reserved6 = reserved6
end

Instance Attribute Details

#init_addressInteger (readonly)

Returns the address of the initialization routine.

Returns:

  • (Integer)

    the address of the initialization routine



701
702
703
# File 'lib/macho/load_commands.rb', line 701

def init_address
  @init_address
end

#init_moduleInteger (readonly)

Returns the index into the module table that the init routine is defined in.

Returns:

  • (Integer)

    the index into the module table that the init routine is defined in



705
706
707
# File 'lib/macho/load_commands.rb', line 705

def init_module
  @init_module
end

#reserved1void (readonly)

This method returns an undefined value.



708
709
710
# File 'lib/macho/load_commands.rb', line 708

def reserved1
  @reserved1
end

#reserved2void (readonly)

This method returns an undefined value.



711
712
713
# File 'lib/macho/load_commands.rb', line 711

def reserved2
  @reserved2
end

#reserved3void (readonly)

This method returns an undefined value.



714
715
716
# File 'lib/macho/load_commands.rb', line 714

def reserved3
  @reserved3
end

#reserved4void (readonly)

This method returns an undefined value.



717
718
719
# File 'lib/macho/load_commands.rb', line 717

def reserved4
  @reserved4
end

#reserved5void (readonly)

This method returns an undefined value.



720
721
722
# File 'lib/macho/load_commands.rb', line 720

def reserved5
  @reserved5
end

#reserved6void (readonly)

This method returns an undefined value.



723
724
725
# File 'lib/macho/load_commands.rb', line 723

def reserved6
  @reserved6
end

Instance Method Details

#to_hHash

Returns a hash representation of this MachO::LoadCommands::RoutinesCommand.

Returns:



748
749
750
751
752
753
754
755
756
757
758
759
# File 'lib/macho/load_commands.rb', line 748

def to_h
  {
    "init_address" => init_address,
    "init_module" => init_module,
    "reserved1" => reserved1,
    "reserved2" => reserved2,
    "reserved3" => reserved3,
    "reserved4" => reserved4,
    "reserved5" => reserved5,
    "reserved6" => reserved6,
  }.merge super
end