class MachO::LoadCommands::BuildVersionCommand

A load command containing the minimum OS version on which the binary was built for its platform. Corresponds to LC_BUILD_VERSION.

Public Instance Methods

minos_string() click to toggle source

A string representation of the binary’s minimum OS version. @return [String] a string representing the minimum OS version.

# File lib/macho/load_commands.rb, line 1174
def minos_string
  binary = "%032<minos>b" % { :minos => minos }
  segs = [
    binary[0..15], binary[16..23], binary[24..31]
  ].map { |s| s.to_i(2) }

  segs.join(".")
end
sdk_string() click to toggle source

A string representation of the binary’s SDK version. @return [String] a string representing the SDK version.

# File lib/macho/load_commands.rb, line 1185
def sdk_string
  binary = "%032<sdk>b" % { :sdk => sdk }
  segs = [
    binary[0..15], binary[16..23], binary[24..31]
  ].map { |s| s.to_i(2) }

  segs.join(".")
end
to_h() click to toggle source

@return [Hash] a hash representation of this {BuildVersionCommand}

Calls superclass method MachO::LoadCommands::LoadCommand#to_h
# File lib/macho/load_commands.rb, line 1195
def to_h
  {
    "platform" => platform,
    "minos" => minos,
    "minos_string" => minos_string,
    "sdk" => sdk,
    "sdk_string" => sdk_string,
    "tool_entries" => tool_entries.tools.map(&:to_h),
  }.merge super
end