Class: MachO::LoadCommands::SymsegCommand

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

Overview

An obsolete load command containing the offset and size of the (GNU style) symbol table information. Corresponds to LC_SYMSEG.

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=4".freeze
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.

16

Instance Attribute Summary collapse

Attributes inherited from LoadCommand

#cmd, #cmdsize, #view

Instance Method Summary collapse

Methods inherited from LoadCommand

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

Methods inherited from MachOStructure

bytesize, new_from_bin

Constructor Details

#initialize(view, cmd, cmdsize, offset, size) ⇒ SymsegCommand

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



1656
1657
1658
1659
1660
# File 'lib/macho/load_commands.rb', line 1656

def initialize(view, cmd, cmdsize, offset, size)
  super(view, cmd, cmdsize)
  @offset = offset
  @size = size
end

Instance Attribute Details

#offsetInteger (readonly)

Returns the offset to the symbol segment.

Returns:

  • (Integer)

    the offset to the symbol segment



1642
1643
1644
# File 'lib/macho/load_commands.rb', line 1642

def offset
  @offset
end

#sizeInteger (readonly)

Returns the size of the symbol segment in bytes.

Returns:

  • (Integer)

    the size of the symbol segment in bytes



1645
1646
1647
# File 'lib/macho/load_commands.rb', line 1645

def size
  @size
end

Instance Method Details

#to_hHash

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

Returns:



1663
1664
1665
1666
1667
1668
# File 'lib/macho/load_commands.rb', line 1663

def to_h
  {
    "offset" => offset,
    "size" => size,
  }.merge super
end