Class: MachO::VersionMinCommand
- Inherits:
-
LoadCommand
- Object
- MachOStructure
- LoadCommand
- MachO::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.
Instance Attribute Summary collapse
-
#sdk ⇒ Fixnum
readonly
The SDK version X.Y.Z packed as x16.y8.z8.
-
#version ⇒ Fixnum
readonly
The version X.Y.Z packed as x16.y8.z8.
Attributes inherited from LoadCommand
Instance Method Summary collapse
-
#initialize(offset, cmd, cmdsize, version, sdk) ⇒ VersionMinCommand
constructor
A new instance of VersionMinCommand.
-
#sdk_string ⇒ String
A string representation of the binary’s SDK version.
-
#version_string ⇒ String
A string representation of the binary’s minimum OS version.
Methods inherited from LoadCommand
Methods inherited from MachOStructure
Constructor Details
#initialize(offset, cmd, cmdsize, version, sdk) ⇒ VersionMinCommand
Returns a new instance of VersionMinCommand.
953 954 955 956 957 |
# File 'lib/macho/load_commands.rb', line 953 def initialize(offset, cmd, cmdsize, version, sdk) super(offset, cmd, cmdsize) @version = version @sdk = sdk end |
Instance Attribute Details
#sdk ⇒ Fixnum (readonly)
Returns the SDK version X.Y.Z packed as x16.y8.z8.
947 948 949 |
# File 'lib/macho/load_commands.rb', line 947 def sdk @sdk end |
#version ⇒ Fixnum (readonly)
Returns the version X.Y.Z packed as x16.y8.z8.
944 945 946 |
# File 'lib/macho/load_commands.rb', line 944 def version @version end |
Instance Method Details
#sdk_string ⇒ String
A string representation of the binary’s SDK version.
972 973 974 975 976 977 978 979 |
# File 'lib/macho/load_commands.rb', line 972 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 |
#version_string ⇒ String
A string representation of the binary’s minimum OS version.
961 962 963 964 965 966 967 968 |
# File 'lib/macho/load_commands.rb', line 961 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 |