Class: DsymUuidExtractor::MachOFileReader
- Inherits:
-
MachOReader
- Object
- MachOReader
- DsymUuidExtractor::MachOFileReader
- Defined in:
- lib/dsym_uuid_extractor/macho_reader.rb
Defined Under Namespace
Classes: LoadCommand, MachHeader, MachHeader64, UuidCommand
Constant Summary collapse
- LC_UUID =
Constants Load Commands
0x1b
- MH_MAGIC =
Magic Numbers
0xfeedface
- MH_CIGAM =
0xcefaedfe
- MH_MAGIC_64 =
0xfeedfacf
- MH_CIGAM_64 =
0xcffaedfe
- BYTE_ORDER =
Byte Order
FFI::MemoryPointer.new(:char).order
- BYTE_ORDER_INVERSE =
BYTE_ORDER == :little ? :big : :little
Constants inherited from MachOReader
DsymUuidExtractor::MachOReader::CPU_ARCH_ABI64, DsymUuidExtractor::MachOReader::CPU_SUBTYPE_ARM_V7, DsymUuidExtractor::MachOReader::CPU_SUBTYPE_ARM_V7S, DsymUuidExtractor::MachOReader::CPU_TYPE_ARM, DsymUuidExtractor::MachOReader::CPU_TYPE_ARM64, DsymUuidExtractor::MachOReader::CPU_TYPE_I386, DsymUuidExtractor::MachOReader::CPU_TYPE_X86_64
Instance Attribute Summary collapse
-
#arch ⇒ Object
readonly
Readers.
-
#is_64_arch ⇒ Object
readonly
Readers.
-
#uuid ⇒ Object
readonly
Readers.
Attributes inherited from MachOReader
Class Method Summary collapse
-
.is_macho_file?(file_path) ⇒ Boolean
Methods.
Instance Method Summary collapse
- #each_file {|_self| ... } ⇒ Object
- #extract_info ⇒ Object
-
#initialize(opts = {}) ⇒ MachOFileReader
constructor
A new instance of MachOFileReader.
- #magic_number ⇒ Object
Methods inherited from MachOReader
Constructor Details
#initialize(opts = {}) ⇒ MachOFileReader
Returns a new instance of MachOFileReader.
168 169 170 171 172 |
# File 'lib/dsym_uuid_extractor/macho_reader.rb', line 168 def initialize(opts = {}) super(opts) @file_beginning_pos = file.pos end |
Instance Attribute Details
#arch ⇒ Object (readonly)
Readers
159 160 161 |
# File 'lib/dsym_uuid_extractor/macho_reader.rb', line 159 def arch @arch end |
#is_64_arch ⇒ Object (readonly)
Readers
159 160 161 |
# File 'lib/dsym_uuid_extractor/macho_reader.rb', line 159 def is_64_arch @is_64_arch end |
#uuid ⇒ Object (readonly)
Readers
159 160 161 |
# File 'lib/dsym_uuid_extractor/macho_reader.rb', line 159 def uuid @uuid end |
Class Method Details
.is_macho_file?(file_path) ⇒ Boolean
Methods
162 163 164 165 166 |
# File 'lib/dsym_uuid_extractor/macho_reader.rb', line 162 def self.is_macho_file?(file_path) magic_number = new(file_path: file_path).magic_number [MH_MAGIC, MH_MAGIC_64, MH_CIGAM, MH_CIGAM_64].include?(magic_number) end |
Instance Method Details
#each_file {|_self| ... } ⇒ Object
183 184 185 |
# File 'lib/dsym_uuid_extractor/macho_reader.rb', line 183 def each_file yield self end |
#extract_info ⇒ Object
178 179 180 181 |
# File 'lib/dsym_uuid_extractor/macho_reader.rb', line 178 def extract_info extract_arch extract_uuid end |
#magic_number ⇒ Object
174 175 176 |
# File 'lib/dsym_uuid_extractor/macho_reader.rb', line 174 def magic_number mach_header[:magic] end |