Class: DsymUuidExtractor::MachOReader
- Inherits:
-
Object
- Object
- DsymUuidExtractor::MachOReader
- Defined in:
- lib/dsym_uuid_extractor/macho_reader.rb
Overview
Based on the details found in developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/MachORuntime/index.html
Direct Known Subclasses
Defined Under Namespace
Classes: ArchIsNil, EmptySymbolicationFile, MachOReaderError, UnkownCpuSubtype, UnkownCpuType
Constant Summary collapse
- CPU_ARCH_ABI64 =
Constants CPU Types
0x01000000
- CPU_TYPE_I386 =
7
- CPU_TYPE_X86_64 =
CPU_TYPE_I386 | CPU_ARCH_ABI64
- CPU_TYPE_ARM =
12
- CPU_TYPE_ARM64 =
CPU_TYPE_ARM | CPU_ARCH_ABI64
- CPU_SUBTYPE_ARM_V7 =
CPU Subtypes
9
- CPU_SUBTYPE_ARM_V7S =
11
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Readers.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ MachOReader
constructor
Methods.
- #read_struct(struct_class, opts = {}) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ MachOReader
Methods
22 23 24 25 26 |
# File 'lib/dsym_uuid_extractor/macho_reader.rb', line 22 def initialize(opts = {}) @file = File.open(opts[:file_path], mode: 'rb') @file.seek(opts[:seek_to_pos]) if opts[:seek_to_pos] end |
Instance Attribute Details
#file ⇒ Object (readonly)
Readers
19 20 21 |
# File 'lib/dsym_uuid_extractor/macho_reader.rb', line 19 def file @file end |
Instance Method Details
#read_struct(struct_class, opts = {}) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/dsym_uuid_extractor/macho_reader.rb', line 28 def read_struct(struct_class, opts = {}) struct_size = struct_class.size buffer = FFI::Buffer.new(:char, struct_size) buffer = buffer.order(opts[:byte_order]) if opts[:byte_order] buffer.put_bytes(0, @file.read(struct_size)) struct_class.new(buffer) end |