Class: MachO::LoadCommands::BuildVersionCommand
- Inherits:
-
LoadCommand
- Object
- MachOStructure
- LoadCommand
- MachO::LoadCommands::BuildVersionCommand
- Defined in:
- lib/macho/load_commands.rb
Overview
A load command containing the minimum OS version on which the binary was built for its platform. Corresponds to LC_BUILD_VERSION.
Defined Under Namespace
Classes: ToolEntries
Instance Method Summary collapse
-
#minos ⇒ Integer
The minimum OS version X.Y.Z packed as x16.y8.z8.
-
#minos_string ⇒ String
A string representation of the binary's minimum OS version.
- #platform ⇒ Integer
-
#sdk ⇒ Integer
The SDK version X.Y.Z packed as x16.y8.z8.
-
#sdk_string ⇒ String
A string representation of the binary's SDK version.
-
#to_h ⇒ Hash
A hash representation of this BuildVersionCommand.
-
#tool_entries ⇒ ToolEntries
Tool entries.
Methods inherited from LoadCommand
#cmd, #cmdsize, create, new_from_bin, #offset, #serializable?, #serialize, #to_s, #type, #view
Methods inherited from MachOStructure
bytesize, format, #initialize, new_from_bin
Constructor Details
This class inherits a constructor from MachO::MachOStructure
Instance Method Details
#minos ⇒ Integer
Returns the minimum OS version X.Y.Z packed as x16.y8.z8.
1164 |
# File 'lib/macho/load_commands.rb', line 1164 field :minos, :uint32 |
#minos_string ⇒ String
A string representation of the binary's minimum OS version.
1174 1175 1176 1177 1178 1179 1180 1181 |
# 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 |
#platform ⇒ Integer
1161 |
# File 'lib/macho/load_commands.rb', line 1161 field :platform, :uint32 |
#sdk ⇒ Integer
Returns the SDK version X.Y.Z packed as x16.y8.z8.
1167 |
# File 'lib/macho/load_commands.rb', line 1167 field :sdk, :uint32 |
#sdk_string ⇒ String
A string representation of the binary's SDK version.
1185 1186 1187 1188 1189 1190 1191 1192 |
# 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 ⇒ Hash
Returns a hash representation of this MachO::LoadCommands::BuildVersionCommand.
1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 |
# 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 |
#tool_entries ⇒ ToolEntries
Returns tool entries.
1170 |
# File 'lib/macho/load_commands.rb', line 1170 field :tool_entries, :tool_entries |