Class: MachO::LoadCommands::BuildVersionCommand::ToolEntries

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

Overview

A representation of the tool versions exposed by a MachO::LoadCommands::BuildVersionCommand (LC_BUILD_VERSION).

Defined Under Namespace

Classes: Tool

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(view, ntools) ⇒ ToolEntries

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



1421
1422
1423
1424
1425
1426
1427
# File 'lib/macho/load_commands.rb', line 1421

def initialize(view, ntools)
  format = Utils.specialize_format("L=#{ntools * 2}", view.endianness)
  raw_table = view.raw_data[view.offset + 24, ntools * 8]
  blobs = raw_table.unpack(format).each_slice(2).to_a

  @tools = blobs.map { |b| Tool.new(*b) }
end

Instance Attribute Details

#toolsArray<Tool> (readonly)



1416
1417
1418
# File 'lib/macho/load_commands.rb', line 1416

def tools
  @tools
end