Class: MachO::LoadCommands::SymtabCommand

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

Overview

A load command containing the offsets and sizes of the link-edit 4.3BSD "stab" style symbol table information. Corresponds to LC_SYMTAB.

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

24

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, symoff, nsyms, stroff, strsize) ⇒ SymtabCommand

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



911
912
913
914
915
916
917
# File 'lib/macho/load_commands.rb', line 911

def initialize(view, cmd, cmdsize, symoff, nsyms, stroff, strsize)
  super(view, cmd, cmdsize)
  @symoff = symoff
  @nsyms = nsyms
  @stroff = stroff
  @strsize = strsize
end

Instance Attribute Details

#nsymsInteger (readonly)

Returns the number of symbol table entries.

Returns:

  • (Integer)

    the number of symbol table entries



894
895
896
# File 'lib/macho/load_commands.rb', line 894

def nsyms
  @nsyms
end

#stroffInteger (readonly)

Returns the string table's offset.

Returns:

  • (Integer)

    the string table's offset



897
898
899
# File 'lib/macho/load_commands.rb', line 897

def stroff
  @stroff
end

#strsizeInteger (readonly)

Returns the string table size in bytes.

Returns:

  • (Integer)

    the string table size in bytes



900
901
902
# File 'lib/macho/load_commands.rb', line 900

def strsize
  @strsize
end

#symoffInteger (readonly)

Returns the symbol table's offset.

Returns:

  • (Integer)

    the symbol table's offset



891
892
893
# File 'lib/macho/load_commands.rb', line 891

def symoff
  @symoff
end

Instance Method Details

#to_hHash

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

Returns:



920
921
922
923
924
925
926
927
# File 'lib/macho/load_commands.rb', line 920

def to_h
  {
    "symoff" => symoff,
    "nsyms" => nsyms,
    "stroff" => stroff,
    "strsize" => strsize,
  }.merge super
end