class MachO::LoadCommands::UUIDCommand

A load command containing a single 128-bit unique random number identifying an object produced by static link editor. Corresponds to LC_UUID.

Constants

FORMAT

@see MachOStructure::FORMAT @api private

SIZEOF

@see MachOStructure::SIZEOF @api private

Attributes

uuid[R]

@return [Array<Fixnum>] the UUID

Public Class Methods

new(view, cmd, cmdsize, uuid) click to toggle source

@api private

Calls superclass method MachO::LoadCommands::LoadCommand.new
# File lib/macho/load_commands.rb, line 348
def initialize(view, cmd, cmdsize, uuid)
  super(view, cmd, cmdsize)
  @uuid = uuid.unpack("C16") # re-unpack for the actual UUID array
end

Public Instance Methods

uuid_string() click to toggle source

@return [String] a string representation of the UUID

# File lib/macho/load_commands.rb, line 354
def uuid_string
  hexes = uuid.map { |e| "%02x" % e }
  segs = [
    hexes[0..3].join, hexes[4..5].join, hexes[6..7].join,
    hexes[8..9].join, hexes[10..15].join
  ]

  segs.join("-")
end