Class: MachO::LoadCommands::VersionMinCommand
- Inherits:
-
LoadCommand
- Object
- MachOStructure
- LoadCommand
- MachO::LoadCommands::VersionMinCommand
- Defined in:
- lib/macho/load_commands.rb
Overview
A load command containing the minimum OS version on which the binary was built to run. Corresponds to LC_VERSION_MIN_MACOSX and LC_VERSION_MIN_IPHONEOS.
Constant Summary collapse
- FORMAT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"L=4".freeze
- SIZEOF =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
16
Instance Attribute Summary collapse
-
#sdk ⇒ Integer
readonly
The SDK version X.Y.Z packed as x16.y8.z8.
-
#version ⇒ Integer
readonly
The version X.Y.Z packed as x16.y8.z8.
Attributes inherited from LoadCommand
Instance Method Summary collapse
-
#initialize(view, cmd, cmdsize, version, sdk) ⇒ VersionMinCommand
constructor
private
A new instance of VersionMinCommand.
-
#sdk_string ⇒ String
A string representation of the binary's SDK version.
-
#to_h ⇒ Hash
A hash representation of this VersionMinCommand.
-
#version_string ⇒ String
A string representation of the binary's minimum OS version.
Methods inherited from LoadCommand
create, new_from_bin, #offset, #serializable?, #serialize, #to_s, #type
Methods inherited from MachOStructure
Constructor Details
#initialize(view, cmd, cmdsize, version, sdk) ⇒ VersionMinCommand
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 VersionMinCommand.
1311 1312 1313 1314 1315 |
# File 'lib/macho/load_commands.rb', line 1311 def initialize(view, cmd, cmdsize, version, sdk) super(view, cmd, cmdsize) @version = version @sdk = sdk end |
Instance Attribute Details
#sdk ⇒ Integer (readonly)
Returns the SDK version X.Y.Z packed as x16.y8.z8.
1300 1301 1302 |
# File 'lib/macho/load_commands.rb', line 1300 def sdk @sdk end |
#version ⇒ Integer (readonly)
Returns the version X.Y.Z packed as x16.y8.z8.
1297 1298 1299 |
# File 'lib/macho/load_commands.rb', line 1297 def version @version end |
Instance Method Details
#sdk_string ⇒ String
A string representation of the binary's SDK version.
1330 1331 1332 1333 1334 1335 1336 1337 |
# File 'lib/macho/load_commands.rb', line 1330 def sdk_string binary = "%032b" % 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::VersionMinCommand.
1340 1341 1342 1343 1344 1345 1346 1347 |
# File 'lib/macho/load_commands.rb', line 1340 def to_h { "version" => version, "version_string" => version_string, "sdk" => sdk, "sdk_string" => sdk_string, }.merge super end |
#version_string ⇒ String
A string representation of the binary's minimum OS version.
1319 1320 1321 1322 1323 1324 1325 1326 |
# File 'lib/macho/load_commands.rb', line 1319 def version_string binary = "%032b" % version segs = [ binary[0..15], binary[16..23], binary[24..31] ].map { |s| s.to_i(2) } segs.join(".") end |