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.
1209 |
# File 'lib/macho/load_commands.rb', line 1209 field :minos, :uint32 |
#minos_string ⇒ String
A string representation of the binary's minimum OS version.
1219 1220 1221 1222 1223 1224 1225 1226 |
# File 'lib/macho/load_commands.rb', line 1219 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
1206 |
# File 'lib/macho/load_commands.rb', line 1206 field :platform, :uint32 |
#sdk ⇒ Integer
Returns the SDK version X.Y.Z packed as x16.y8.z8.
1212 |
# File 'lib/macho/load_commands.rb', line 1212 field :sdk, :uint32 |
#sdk_string ⇒ String
A string representation of the binary's SDK version.
1230 1231 1232 1233 1234 1235 1236 1237 |
# File 'lib/macho/load_commands.rb', line 1230 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.
1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 |
# File 'lib/macho/load_commands.rb', line 1240 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.
1215 |
# File 'lib/macho/load_commands.rb', line 1215 field :tool_entries, :tool_entries |