Class: MachO::LoadCommands::NoteCommand

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

Overview

A load command containing an owner name and offset/size for an arbitrary data region. Corresponds to LC_NOTE.

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=2Z16Q=2"
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.

48

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, data_owner, offset, size) ⇒ NoteCommand

Returns a new instance of NoteCommand.



1781
1782
1783
1784
1785
1786
# File 'lib/macho/load_commands.rb', line 1781

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

Instance Attribute Details

#data_ownerString (readonly)

Returns the name of the owner for this note.

Returns:

  • (String)

    the name of the owner for this note



1765
1766
1767
# File 'lib/macho/load_commands.rb', line 1765

def data_owner
  @data_owner
end

#offsetInteger (readonly)

Returns the offset, within the file, of the note.

Returns:

  • (Integer)

    the offset, within the file, of the note



1768
1769
1770
# File 'lib/macho/load_commands.rb', line 1768

def offset
  @offset
end

#sizeInteger (readonly)

Returns the size, in bytes, of the note.

Returns:

  • (Integer)

    the size, in bytes, of the note



1771
1772
1773
# File 'lib/macho/load_commands.rb', line 1771

def size
  @size
end

Instance Method Details

#to_hHash

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

Returns:



1789
1790
1791
1792
1793
1794
1795
# File 'lib/macho/load_commands.rb', line 1789

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