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.
1065 |
# File 'lib/macho/load_commands.rb', line 1065 field :minos, :uint32 |
#minos_string ⇒ String
A string representation of the binary's minimum OS version.
1075 1076 1077 1078 1079 1080 1081 1082 |
# File 'lib/macho/load_commands.rb', line 1075 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
1062 |
# File 'lib/macho/load_commands.rb', line 1062 field :platform, :uint32 |
#sdk ⇒ Integer
Returns the SDK version X.Y.Z packed as x16.y8.z8.
1068 |
# File 'lib/macho/load_commands.rb', line 1068 field :sdk, :uint32 |
#sdk_string ⇒ String
A string representation of the binary's SDK version.
1086 1087 1088 1089 1090 1091 1092 1093 |
# File 'lib/macho/load_commands.rb', line 1086 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.
1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 |
# File 'lib/macho/load_commands.rb', line 1096 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.
1071 |
# File 'lib/macho/load_commands.rb', line 1071 field :tool_entries, :tool_entries |