### init(start:numberOfCommands:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/machoimage/loadcommands-swift.struct/iterator Initializes an iterator with a start pointer and the number of load commands to iterate over. ```APIDOC ## init(start:numberOfCommands:) ### Description Initializes an iterator with a start pointer and the number of load commands to iterate over. ### Declaration ```swift init(start: UnsafeRawPointer, numberOfCommands: Int) ``` ### Parameters - **start** (UnsafeRawPointer) - The starting memory address of the load commands. - **numberOfCommands** (Int) - The total number of load commands to iterate. ``` -------------------------------- ### var functionStarts: FunctionStarts? { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/machofile/functionstarts-swift.property Returns the sequence of function starts as an optional FunctionStarts object. This property is read-only. ```APIDOC ## Property: functionStarts ### Description Returns the sequence of function starts for the Mach-O file. ### Declaration ```swift var functionStarts: FunctionStarts? { get } ``` ### Parameters None. ### Return Value An optional `FunctionStarts` object representing the sequence of function starts, or `nil` if not available. ### Discussion This property provides access to the function starts data associated with the Mach-O file. It is read-only. ``` -------------------------------- ### startPtr(vmaddrSlide:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/section/startptr%28vmaddrslide%3A%29 Get the pointer where this section starts. ```APIDOC ## startPtr(vmaddrSlide:) ### Description Get the pointer where this section starts. ### Method startPtr(vmaddrSlide:) ### Parameters - **vmaddrSlide** (Int) - Required - Slide ### Return Value Pointer where this section starts. ``` -------------------------------- ### prebuiltLoaderSet(for:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyldcache/prebuiltloaderset%28for%3A%29 Get the prebuiltLoaderSet indicated by programOffset. ```APIDOC ## prebuiltLoaderSet(for:) ### Description Get the prebuiltLoaderSet indicated by programOffset. ### Method prebuiltLoaderSet(for:) ### Parameters - **programOffset** (ProgramOffset) - Required - Program name and offset pair ### Return Value prebuiltLoaderSet ``` -------------------------------- ### var numberOfPageStarts: Int { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyldcacheslideinfo2/numberofpagestarts Returns the number of page starts for the DyldCacheSlideInfo2 instance. ```APIDOC ## Instance Property: numberOfPageStarts ### Description Returns the number of page starts for the DyldCacheSlideInfo2 instance. ### Declaration ```swift var numberOfPageStarts: Int { get } ``` ### Parameters None. ### Return Value An integer representing the number of page starts. ### Discussion This property provides the count of page starts associated with the DyldCacheSlideInfo2 object. ``` -------------------------------- ### var startIndex: Index { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/machoimage/symbols64-swift.struct/startindex Returns the starting index of the collection. This property is inherited from the Collection protocol and is used to iterate over the symbols. ```APIDOC ## var startIndex: Index { get } ### Description Returns the starting index of the collection. This property is inherited from the Collection protocol and is used to iterate over the symbols. ### Declaration ```swift var startIndex: Index { get } ``` ### Discussion This property is part of the Collection protocol conformance and provides the first valid index for the collection. It is used in iteration and subscripting operations. ``` -------------------------------- ### var startAddress: UInt64 Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyld_cache_range_entry The start address of the range entry. ```APIDOC ## var startAddress: UInt64 ### Description The start address of the range entry. ### Declaration ```swift var startAddress: UInt64 ``` ``` -------------------------------- ### section(at:cmdsStart:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/segmentcommand64/section%28at%3Acmdsstart%3A%29 Returns the section located at the specified offset from the start of the segment. The cmdsStart parameter provides a pointer to the start of load commands for context. ```APIDOC ## section(at:cmdsStart:) ### Description Returns the section located at the specified offset from the start of the segment. The cmdsStart parameter provides a pointer to the start of load commands for context. ### Method func section(at:cmdsStart:) ### Parameters - **offset** (UInt) - Offset from start of segment - **cmdsStart** (UnsafeRawPointer) - Pointer at load commands start ### Return Value Located section (Section64?) ``` -------------------------------- ### var start: UnsafeRawPointer Source: https://p-x9.github.io/MachOKit/documentation/machokit/machoimage/loadcommands-swift.struct/iterator The starting memory address of the load commands. ```APIDOC ## var start: UnsafeRawPointer ### Description The starting memory address of the load commands. ### Declaration ```swift let start: UnsafeRawPointer ``` ``` -------------------------------- ### mainStartPointer(machOStart:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/entrypointcommand/mainstartpointer%28machostart%3A%29 Instance method that returns the main start pointer as an UnsafeRawPointer, given a pointer to the Mach-O start. ```APIDOC ## mainStartPointer(machOStart:) ### Description Instance method that returns the main start pointer as an UnsafeRawPointer, given a pointer to the Mach-O start. ### Method mainStartPointer(machOStart:) ### Parameters - **machOStart** (UnsafeRawPointer) - Required - A pointer to the Mach-O start. ### Return Value - **UnsafeRawPointer** - The main start pointer. ``` -------------------------------- ### static var current: CPUSubType? { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/cpusubtype/current Returns the CPU subtype of the host PC. ```APIDOC ## static var current: CPUSubType? { get } ### Description Returns the CPU subtype of the host PC. ### Declaration ```swift static var current: CPUSubType? { get } ``` ### Return Value An optional `CPUSubType` value representing the CPU subtype of the host PC, or `nil` if unavailable. ``` -------------------------------- ### init(version:flags:selopt_offset:headeropt_ro_offset:clsopt_offset:protocolopt_offset:headeropt_rw_offset:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/objc_opt_t_15 Initializes a new instance of objc_opt_t_15 with the specified values for version, flags, and various offsets. ```APIDOC ## init(version:flags:selopt_offset:headeropt_ro_offset:clsopt_offset:protocolopt_offset:headeropt_rw_offset:) ### Description Initializes a new instance of objc_opt_t_15 with the specified values for version, flags, and various offsets. ### Method init(version: UInt32, flags: UInt32, selopt_offset: Int32, headeropt_ro_offset: Int32, clsopt_offset: Int32, protocolopt_offset: Int32, headeropt_rw_offset: Int32) ### Parameters - **version** (UInt32) - Required - The version value. - **flags** (UInt32) - Required - The flags value. - **selopt_offset** (Int32) - Required - The selector optimization offset. - **headeropt_ro_offset** (Int32) - Required - The header optimization read-only offset. - **clsopt_offset** (Int32) - Required - The class optimization offset. - **protocolopt_offset** (Int32) - Required - The protocol optimization offset. - **headeropt_rw_offset** (Int32) - Required - The header optimization read-write offset. ### Return Value A new objc_opt_t_15 instance. ``` -------------------------------- ### var version: Version { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/buildtoolversion/version An instance property that returns the version of the build tool as a Version object. ```APIDOC ## var version: Version { get } ### Description Returns the version of the build tool as a `Version` object. ### Declaration ```swift var version: Version { get } ``` ### Parameters None. ### Return Value A `Version` object representing the build tool version. ``` -------------------------------- ### startPtr(in:vmaddrSlide:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/section/startptr%28in%3Avmaddrslide%3A%29 Get the pointer where this section starts. This method takes a segment and a vmaddrSlide and returns an optional raw pointer to the section's start. ```APIDOC ## startPtr(in:vmaddrSlide:) ### Description Get the pointer where this section starts. ### Method Instance Method ### Signature ```swift func startPtr( in segment: any SegmentCommandProtocol, vmaddrSlide: Int ) -> UnsafeRawPointer? ``` ### Parameters - **segment** (any SegmentCommandProtocol) - Required - Segment to which this section belongs - **vmaddrSlide** (Int) - Required - Slide ### Return Value Pointer where this section starts (UnsafeRawPointer?) ``` -------------------------------- ### init() Source: https://p-x9.github.io/MachOKit/documentation/machokit/objc_opt_t_15 Initializes a new instance of objc_opt_t_15 with default values. ```APIDOC ## init() ### Description Initializes a new instance of objc_opt_t_15 with default values. ### Method init() ### Parameters None ### Return Value A new objc_opt_t_15 instance. ``` -------------------------------- ### init(url: URL) throws Source: https://p-x9.github.io/MachOKit/documentation/machokit/fulldyldcache Initializes a FullDyldCache instance with the URL of the main cache file. ```APIDOC ## init(url: URL) throws ### Description Initializes a `FullDyldCache` with the path to the main cache file. Automatically detects and opens all related subcache files. ### Method Initializer ### Parameters - **url** (URL) - Required - The URL of the main dyld shared cache file. ### Throws An error if the cache cannot be loaded. ``` -------------------------------- ### func startPtr(vmaddrSlide:) -> UnsafeRawPointer? Source: https://p-x9.github.io/MachOKit/documentation/machokit/section64/sectionprotocol-implementations Gets the pointer where this section starts, given a vmaddr slide. ```APIDOC ## Method: startPtr(vmaddrSlide:) ### Description Get the pointer where this section starts. ### Declaration `func startPtr(vmaddrSlide: Int) -> UnsafeRawPointer?` ### Parameters - **vmaddrSlide** (Int) - The virtual memory address slide. ### Return Value - **UnsafeRawPointer?** - The start pointer, or nil if not available. ``` -------------------------------- ### init(cacheVMOffset: UInt64, numPages: UInt64) Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyld_prewarming_entry Initializes a dyld_prewarming_entry with the given cache VM offset and number of pages. ```APIDOC ## init(cacheVMOffset: UInt64, numPages: UInt64) ### Description Initializes a dyld_prewarming_entry with the given cache VM offset and number of pages. ### Declaration ```swift init(cacheVMOffset: UInt64, numPages: UInt64) ``` ### Parameters - **cacheVMOffset** (UInt64) - The cache VM offset. - **numPages** (UInt64) - The number of pages. ### Return Value A new dyld_prewarming_entry instance. ### Example ```swift let entry = dyld_prewarming_entry(cacheVMOffset: 0, numPages: 0) ``` ``` -------------------------------- ### init() Source: https://p-x9.github.io/MachOKit/documentation/machokit/swift_optimization Initializes a new swift_optimization instance with default values. ```APIDOC ## init() ### Description Initializes a new swift_optimization instance with default values. ### Declaration `init()` ``` -------------------------------- ### startPtr(vmaddrSlide:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/sectionprotocol/startptr%28vmaddrslide%3A%29 Get the pointer where this section starts. This method is required by the SectionProtocol protocol and has a default implementation. ```APIDOC ## startPtr(vmaddrSlide:) ### Description Get the pointer where this section starts. ### Method `func startPtr(vmaddrSlide: Int) -> UnsafeRawPointer?` ### Parameters - **vmaddrSlide** (Int) - Slide ### Return Value Pointer where this section starts ### Default Implementation Provided by SectionProtocol protocol extension. ``` -------------------------------- ### static var layoutSize: Int { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/layoutwrapper/layoutsize-swift.type.property Returns the layout size of the Mach-O binary as an integer. ```APIDOC ## static var layoutSize: Int { get } ### Description Returns the layout size of the Mach-O binary. ### Declaration ```swift static var layoutSize: Int { get } ``` ### Parameters None ### Return Value - **Int** - The layout size of the Mach-O binary. ``` -------------------------------- ### var numberOfPageStarts: Int { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyldcacheslideinfo3/numberofpagestarts Returns the number of page starts for the dyld cache slide info. ```APIDOC ## var numberOfPageStarts: Int { get } ### Description Returns the number of page starts for the dyld cache slide info. ### Declaration ``` var numberOfPageStarts: Int { get } ``` ### Parameters None ### Return Value An Int representing the number of page starts. ### Discussion This property is read-only and provides the count of page starts in the dyld cache slide info. ``` -------------------------------- ### init() Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyld_prewarming_entry Initializes a new dyld_prewarming_entry instance with default values. ```APIDOC ## init() ### Description Initializes a new dyld_prewarming_entry instance with default values. ### Declaration ```swift init() ``` ### Parameters None. ### Return Value A new dyld_prewarming_entry instance. ### Example ```swift let entry = dyld_prewarming_entry() ``` ``` -------------------------------- ### init(startAddress:size:imageIndex:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyld_cache_range_entry Initializes a new dyld_cache_range_entry instance with the given start address, size, and image index. ```APIDOC ## init(startAddress:size:imageIndex:) ### Description Initializes a new dyld_cache_range_entry instance with the given start address, size, and image index. ### Declaration ```swift init(startAddress: UInt64, size: UInt32, imageIndex: UInt32) ``` ### Parameters - **startAddress** (UInt64) - The start address of the range. - **size** (UInt32) - The size of the range. - **imageIndex** (UInt32) - The image index associated with the range. ``` -------------------------------- ### var fileSuffix: String { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyldsubcacheentryv1/filesuffix Returns the file name suffix of the subCache file. For example, '.1' or '.2'. ```APIDOC ## var fileSuffix: String { get } ### Description Returns the file name suffix of the subCache file. For example, '.1' or '.2'. ### Declaration ```swift var fileSuffix: String { get } ``` ### Discussion E.G. ".1", ".2" ``` -------------------------------- ### sections(cmdsStart:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/segmentcommand64/sections%28cmdsstart%3A%29 Documentation for the sections(cmdsStart:) instance method, which returns a sequence of Section64 objects. ```APIDOC ## sections(cmdsStart:) ### Description Returns a sequence of `Section64` objects representing the sections of the segment, starting from the given command start pointer. ### Method `func sections(cmdsStart: UnsafeRawPointer) -> MemorySequence` ### Parameters - **cmdsStart** (`UnsafeRawPointer`) - Required - A pointer to the start of the command data from which to parse the sections. ### Return Value - `MemorySequence` - A sequence of `Section64` objects representing the sections. ### Discussion This method is inherited from `SegmentCommandProtocol`. It is used to access the sections of a segment command in a Mach-O binary. ``` -------------------------------- ### init() Source: https://p-x9.github.io/MachOKit/documentation/machokit/i386_thread_state Initializes an empty i386_thread_state instance. ```APIDOC ## init() ### Description Initializes an empty i386_thread_state instance. ### Declaration `init()` ### Parameters None. ### Return Value An i386_thread_state instance with all fields set to their default values. ``` -------------------------------- ### func startPtr(in:vmaddrSlide:) -> UnsafeRawPointer? Source: https://p-x9.github.io/MachOKit/documentation/machokit/section64/sectionprotocol-implementations Gets the pointer where this section starts, given a segment command and vmaddr slide. Deprecated. ```APIDOC ## Method: startPtr(in:vmaddrSlide:) ### Description Get the pointer where this section starts. Deprecated. ### Declaration `func startPtr(in: any SegmentCommandProtocol, vmaddrSlide: Int) -> UnsafeRawPointer?` ### Parameters - **in** (any SegmentCommandProtocol) - The segment command containing this section. - **vmaddrSlide** (Int) - The virtual memory address slide. ### Return Value - **UnsafeRawPointer?** - The start pointer, or nil if not available. ``` -------------------------------- ### init() Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyld_cache_image_info_extra Initializes an empty dyld_cache_image_info_extra instance. ```APIDOC ## init() ### Description Creates a default instance of dyld_cache_image_info_extra with all fields set to their default values (0). ### Declaration ```swift init() ``` ### Parameters None. ### Return Value A new dyld_cache_image_info_extra structure. ### Example ```swift let info = dyld_cache_image_info_extra() ``` ``` -------------------------------- ### var offset: Int { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/objcheaderinforoprotocol/offset A required read-only instance property that returns the offset from the start address of the main cache. ```APIDOC ## var offset: Int { get } ### Description Returns the offset from the start address of the main cache. ### Declaration ```swift var offset: Int { get } ``` ### Parameters None ### Return Value - **offset** (Int) - The offset from the start address of the main cache. ### Discussion This property is required and read-only. It provides the offset value used to locate the header information relative to the main cache's start address. ``` -------------------------------- ### var dylibsPrebuiltLoaderSet: PrebuiltLoaderSet? { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/fulldyldcache/dylibsprebuiltloaderset An instance property that returns the PrebuiltLoaderSet of all cached dylibs. It is read-only and optional. ```APIDOC ## var dylibsPrebuiltLoaderSet: PrebuiltLoaderSet? { get } ### Description An instance property that provides the PrebuiltLoaderSet of all cached dylibs. ### Declaration ```swift var dylibsPrebuiltLoaderSet: PrebuiltLoaderSet? { get } ``` ### Parameters None ### Return Value - **dylibsPrebuiltLoaderSet** (PrebuiltLoaderSet?) - The PrebuiltLoaderSet of all cached dylibs, or nil if not available. ### Discussion This property is read-only and returns an optional PrebuiltLoaderSet. ``` -------------------------------- ### init(subcacheUrl:mainCache:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyldcache/init%28subcacheurl%3Amaincache%3A%29 Documentation for the initializer init(subcacheUrl:mainCache:) that loads a sub dyld cache. ```APIDOC ## init(subcacheUrl:mainCache:) ### Description Loads a sub dyld cache from the given URL, using the provided main dyld cache. ### Method convenience init ### Parameters - **subcacheUrl** (URL) - Required - URL for the dyld cache subcache. - **mainCache** (DyldCache) - Required - The main dyld cache. ### Throws Throws an error if the subcache cannot be loaded. ``` -------------------------------- ### init() Source: https://p-x9.github.io/MachOKit/documentation/machokit/x86_thread_state64 Initializes an empty x86_thread_state64 structure. ```APIDOC ## init() ### Description Initializes an empty x86_thread_state64 structure. ### Declaration ```swift init() ``` ``` -------------------------------- ### var dylibOffset: Int { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyldcachelocalsymbolsentryprotocol/dyliboffset The dylibOffset property returns the offset in the cache buffer of the start of the dylib. It is a required property of the DyldCacheLocalSymbolsEntryProtocol. ```APIDOC ## var dylibOffset: Int { get } ### Description Offset in cache buffer of start of dylib. ### Declaration ```swift var dylibOffset: Int { get } ``` ### Protocol DyldCacheLocalSymbolsEntryProtocol ### Requirements Required ### Return Value - **dylibOffset** (Int) - The offset in the cache buffer where the dylib starts. ``` -------------------------------- ### var startIndex: DataSequence.Index { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/datasequence/startindex The startIndex property returns the starting index of the DataSequence collection. It is inherited from Collection and is read-only. ```APIDOC ## Property: startIndex ### Description Returns the starting index of the collection. ### Declaration ```swift var startIndex: DataSequence.Index { get } ``` ### Parameters None. ### Return Value The index of the first element in the collection. ### Discussion This property is inherited from `Collection` and provides the position of the first element in the `DataSequence`. ``` -------------------------------- ### var indirectSymbolIndex: Int? { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/section64/indirectsymbolindex Returns the start index of the indirect symbol table for this section, or nil if the section type is not one of the supported symbol pointer or stub types. ```APIDOC ## Property: indirectSymbolIndex ### Description Returns the start index of the indirect symbol table for this section. Returns nil unless the section type is either .lazy_symbol_pointers, .non_lazy_symbol_pointers, .lazy_dylib_symbol_pointers, or .symbol_stubs. ### Declaration ```swift var indirectSymbolIndex: Int? { get } ``` ### Return Value - **Int?** - The start index of the indirect symbol table, or nil if the section type is not one of the supported types. ``` -------------------------------- ### init() Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyld_cache_range_entry Initializes a new dyld_cache_range_entry instance. ```APIDOC ## init() ### Description Initializes a new dyld_cache_range_entry instance. ### Declaration ```swift init() ``` ``` -------------------------------- ### init() Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyld_cache_slide_info5 Initializes a new instance of the dyld_cache_slide_info5 structure. ```APIDOC ## init() ### Description Initializes a new instance of the dyld_cache_slide_info5 structure. ### Declaration ```swift init() ``` ### Parameters None. ### Return Value A new dyld_cache_slide_info5 instance. ``` -------------------------------- ### state(cmdsStart:cpuType:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/threadcommand/state%28cmdsstart%3Acputype%3A%29 Documentation for the instance method state(cmdsStart:cpuType:) in the ThreadCommand class. ```APIDOC ## state(cmdsStart:cpuType:) ### Description Returns the thread state for the given command start pointer and CPU type. ### Method `state(cmdsStart:cpuType:)` ### Parameters - **cmdsStart** (`UnsafeRawPointer`) - Required - The start pointer to the command data. - **cpuType** (`CPUType`) - Required - The CPU type to interpret the thread state. ### Return Value - **ThreadState?** - The thread state, or `nil` if unavailable. ``` -------------------------------- ### init(address:modTime:inode:pathFileOffset:pad:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyld_cache_image_info/init%28address%3Amodtime%3Ainode%3Apathfileoffset%3Apad%3A%29 Initializer for the dyld_cache_image_info type. Creates a new instance with the specified values for address, modification time, inode, path file offset, and padding. ```APIDOC ## init(address:modTime:inode:pathFileOffset:pad:) ### Description Initializer for the dyld_cache_image_info type. It creates a new instance using the provided address, modification time, inode, path file offset, and padding values. ### Parameters - **address** (UInt64) - Required - The address value for the cache image. - **modTime** (UInt64) - Required - The modification time value. - **inode** (UInt64) - Required - The inode value. - **pathFileOffset** (UInt32) - Required - The path file offset. - **pad** (UInt32) - Required - The padding value. ### Declaration ``` init( address: UInt64, modTime: UInt64, inode: UInt64, pathFileOffset: UInt32, pad: UInt32 ) ``` ``` -------------------------------- ### var codeSign: CodeSign? { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/machofile/codesign-swift.property Gets the code signing information of the Mach-O file, or nil if not present. ```APIDOC ## Property: `var codeSign: CodeSign? { get }` ### Description Returns the code signing information of the Mach-O file, or nil if not available. ### Declaration var codeSign: CodeSign? { get } ### Parameters None. ### Return Value An optional `CodeSign` object containing the code sign info, or `nil` if no code signing information is present. ### Example Usage ```swift let file = MachOFile(...) if let sign = file.codeSign { // Access code signing details } ``` ``` -------------------------------- ### init() Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyld_cache_slide_info3 Initializes a new instance of the dyld_cache_slide_info3 structure. ```APIDOC ## init() ### Description Initializes a new instance of the dyld_cache_slide_info3 structure. ### Method init() ### Parameters None ### Return Value A new dyld_cache_slide_info3 instance. ``` -------------------------------- ### Example dylibIndices output with alias Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyldcacheloaded/dylibindices Shows example output of dylibIndices where an alias results in two elements with the same index (0). ```text 0 /usr/lib/libobjc.A.dylib 0 /usr/lib/libobjc.dylib ``` -------------------------------- ### init(raw:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyld_cache_slide_pointer5/init%28raw%3A%29 Initializes a dyld_cache_slide_pointer5 instance with a raw UInt64 value. ```APIDOC ## init(raw:) ### Description Initializes a dyld_cache_slide_pointer5 instance with a raw UInt64 value. ### Method init ### Signature `init(raw: UInt64)` ### Parameters - **raw** (UInt64) - The raw value to initialize the instance with. ``` -------------------------------- ### var exportTrie: ExportTrie? { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/machoimage/exporttrie-swift.property Gets the export trie sequence from the Mach-O image. If LC_DYLD_INFO or LC_DYLD_INFO_ONLY does not exist, it looks for LC_DYLD_EXPORTS_TRIE. ```APIDOC ## var exportTrie: ExportTrie? { get } ### Description Gets the export trie sequence from the Mach-O image. ### Declaration `var exportTrie: ExportTrie? { get }` ### Return Value An optional `ExportTrie` object representing the sequence of export tries. ### Discussion If LC_DYLD_INFO or LC_DYLD_INFO_ONLY does not exist, it looks for LC_DYLD_EXPORTS_TRIE. ``` -------------------------------- ### init(auth:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyld_cache_slide_pointer3/init%28auth%3A%29 Initializes a dyld_cache_slide_pointer3 instance with the given authentication structure. ```APIDOC ## init(auth:) ### Description Initializes a dyld_cache_slide_pointer3 instance with the given authentication structure. ### Method Initializer ### Signature `init(auth: dyld_cache_slide_pointer3.__Unnamed_struct_auth)` ### Parameters - **auth** (dyld_cache_slide_pointer3.__Unnamed_struct_auth) - The authentication structure used for initialization. ``` -------------------------------- ### init(from: any Decoder) throws Source: https://p-x9.github.io/MachOKit/documentation/machokit/stringtableentry Creates a StringTableEntry by decoding from the given decoder. ```APIDOC ## init(from: any Decoder) throws ### Description Initializes a new StringTableEntry by decoding from the provided decoder. ### Declaration `init(from decoder: any Decoder) throws` ### Parameters - **decoder** (any Decoder) - The decoder to read data from. ### Throws An error if decoding fails. ``` -------------------------------- ### var segments: [any SegmentCommandProtocol] { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/machofile/segments Gets the list of segments in the Mach-O file. This property is read-only and returns an array of SegmentCommandProtocol instances. ```APIDOC ## Property: segments ### Description List of segments in the Mach-O file. ### Declaration ```swift var segments: [any SegmentCommandProtocol] { get } ``` ### Parameters None ### Return Value An array of `SegmentCommandProtocol` instances representing the segments. ``` -------------------------------- ### init(url:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyldcache/init%28url%3A%29 Loads a dyld cache from the given URL. This initializer throws an error if the cache cannot be loaded. ```APIDOC ## init(url:) ### Description Loads a dyld cache from the specified URL. ### Declaration ```swift init(url: URL) throws ``` ### Parameters - **url** (URL) - The URL for the dyld cache. ### Discussion Use `init(subcacheUrl:mainCacheHeader:)` to load a sub cache. ``` -------------------------------- ### N_SO Stab Example Source: https://p-x9.github.io/MachOKit/documentation/machokit/stab/so Example of the N_SO symbol type in Mach-O stab entries, used to represent a source file name. ```plaintext case so ``` -------------------------------- ### init() Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyld_cache_function_variant_entry Initializes a new dyld_cache_function_variant_entry instance with default values. ```APIDOC ## init() ### Description Initializes a new dyld_cache_function_variant_entry instance with default values. ### Declaration ```swift init() ``` ### Parameters None. ### Return Value A new dyld_cache_function_variant_entry instance. ``` -------------------------------- ### init(exportsTrieAddr:weakBindingsAddr:exportsTrieSize:weakBindingsSize:dependentsStartArrayIndex:reExportsStartArrayIndex:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyld_cache_image_info_extra/init%28exportstrieaddr%3Aweakbindingsaddr%3Aexportstriesize%3Aweakbindingssize%3Adependentsstartarrayindex%3Areexportsstartarrayindex%3A%29 Initializes a new dyld_cache_image_info_extra instance with the given addresses, sizes, and array indices. ```APIDOC ## Initializer: init(exportsTrieAddr:weakBindingsAddr:exportsTrieSize:weakBindingsSize:dependentsStartArrayIndex:reExportsStartArrayIndex:) ### Description Initializes a dyld_cache_image_info_extra instance using the provided parameters to set the exports trie address, weak bindings address, exports trie size, weak bindings size, dependents start array index, and re-exports start array index. ### Signature `init(exportsTrieAddr: UInt64, weakBindingsAddr: UInt64, exportsTrieSize: UInt32, weakBindingsSize: UInt32, dependentsStartArrayIndex: UInt32, reExportsStartArrayIndex: UInt32)` ### Parameters - **exportsTrieAddr** (UInt64) - Required - The address of the exports trie. - **weakBindingsAddr** (UInt64) - Required - The address of the weak bindings. - **exportsTrieSize** (UInt32) - Required - The size of the exports trie. - **weakBindingsSize** (UInt32) - Required - The size of the weak bindings. - **dependentsStartArrayIndex** (UInt32) - Required - The starting index in the dependents array. - **reExportsStartArrayIndex** (UInt32) - Required - The starting index in the re-exports array. ``` -------------------------------- ### starts(with:by:) method signature Source: https://p-x9.github.io/MachOKit/documentation/machokit/machofile/functionstarts-swift.struct/starts%28with%3Aby%3A%29 The method signature for starts(with:by:), inherited from Sequence. It checks whether the initial elements of the sequence are equivalent to those of another sequence, using the provided predicate. ```swift func starts( with possiblePrefix: PossiblePrefix, by areEquivalent: (Self.Element, PossiblePrefix.Element) throws -> Bool ) rethrows -> Bool where PossiblePrefix : Sequence ``` -------------------------------- ### var bindOperations: BindOperations? { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/machofile/bindoperations-swift.property The `bindOperations` property returns an optional sequence of bind operations for the Mach-O file. It is a read-only computed property, as indicated by the `{ get }` accessor. ```APIDOC ## Property: `var bindOperations: BindOperations? { get }` ### Description Returns an optional sequence of bind operations for the Mach-O file. If bind operations are not available, this property returns `nil`. ### Declaration ```swift var bindOperations: BindOperations? { get } ``` ### Parameters None. ### Return Value An optional `BindOperations` instance that represents the sequence of bind operations. ``` -------------------------------- ### init(version:padding:typeConformanceHashTableCacheOffset:metadataConformanceHashTableCacheOffset:foreignTypeConformanceHashTableCacheOffset:prespecializationDataCacheOffset:prespecializedMetadataHashTableCacheOffsets:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/swift_optimization Initializes a swift_optimization instance with the specified properties. ```APIDOC ## init(version:padding:typeConformanceHashTableCacheOffset:metadataConformanceHashTableCacheOffset:foreignTypeConformanceHashTableCacheOffset:prespecializationDataCacheOffset:prespecializedMetadataHashTableCacheOffsets:) ### Description Initializes a swift_optimization instance with the specified properties. ### Declaration `init(version: UInt32, padding: UInt32, typeConformanceHashTableCacheOffset: UInt64, metadataConformanceHashTableCacheOffset: UInt64, foreignTypeConformanceHashTableCacheOffset: UInt64, prespecializationDataCacheOffset: UInt64, prespecializedMetadataHashTableCacheOffsets: (UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64))` ### Parameters - **version** (UInt32) - The version of the optimization. - **padding** (UInt32) - Padding value. - **typeConformanceHashTableCacheOffset** (UInt64) - Offset to the type conformance hash table cache. - **metadataConformanceHashTableCacheOffset** (UInt64) - Offset to the metadata conformance hash table cache. - **foreignTypeConformanceHashTableCacheOffset** (UInt64) - Offset to the foreign type conformance hash table cache. - **prespecializationDataCacheOffset** (UInt64) - Offset to the prespecialization data cache. - **prespecializedMetadataHashTableCacheOffsets** ((UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64)) - Tuple of offsets to prespecialized metadata hash table caches. ``` -------------------------------- ### Example output of programOffsets Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyldcache/programoffsets Shows the format of the programOffsets output, listing offsets followed by program paths or cdhash identifiers. ```text 0 /System/Applications/App Store.app/Contents/MacOS/App Store 0 /cdhash/32caa391186c08b3b3cb7866995db1cb65b0376a 131776 /System/Applications/Automator.app/Contents/MacOS/Automator 131776 /cdhash/fed26a75645fed2a674b5c4d01001bfa69b9dbea ``` -------------------------------- ### var layout: Self.Layout { get set } Source: https://p-x9.github.io/MachOKit/documentation/machokit/layoutwrapper/layout-swift.property A required instance property that gets or sets the layout of the conforming type. This property is part of the LayoutWrapper API and must be implemented by conforming types. ```APIDOC ## Property `layout` ### Description A required property of the LayoutWrapper protocol that provides access to the layout value. It can be read and written. ### Signature ```swift var layout: Self.Layout { get set } ``` ### Parameters - **self** (Self) - The instance conforming to LayoutWrapper. ### Return Value - `Self.Layout` - The layout value associated with the conforming type. ### Usage Access or modify the layout property of a conforming type. ### Example ```swift var wrapper: MyWrapper let currentLayout = wrapper.layout wrapper.layout = anotherLayout ``` ``` -------------------------------- ### init(version:imageExtrasCount:imagesExtrasOffset:bottomUpListOffset:dylibTrieOffset:dylibTrieSize:initializersOffset:initializersCount:dofSectionsOffset:dofSectionsCount:reExportListOffset:reExportCount:depListOffset:depListCount:rangeTableOffset:rangeTableCount:dyldSectionAddr:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyld_cache_accelerator_info/init%28version%3Aimageextrascount%3Aimagesextrasoffset%3Abottomuplistoffset%3Adylibtrieoffset%3Adylibtriesize%3Ainitializersoffset%3Ainitializerscount%3Adofsectionsoffset%3Adofsectionscount%3Areexportlistoffset%3Areexportcount%3Adeplistoffset%3Adeplistcount%3Arangetable-2ccyo Initializes a dyld_cache_accelerator_info with the given parameters. This initializer is used to create an instance that represents the accelerator information of a dyld shared cache. ```APIDOC ## init(version:imageExtrasCount:imagesExtrasOffset:bottomUpListOffset:dylibTrieOffset:dylibTrieSize:initializersOffset:initializersCount:dofSectionsOffset:dofSectionsCount:reExportListOffset:reExportCount:depListOffset:depListCount:rangeTableOffset:rangeTableCount:dyldSectionAddr:) ### Description Initializes a `dyld_cache_accelerator_info` instance with the provided parameters. This initializer sets up the accelerator information for a dyld shared cache. ### Method Initializer ### Signature ```swift init( version: UInt32, imageExtrasCount: UInt32, imagesExtrasOffset: UInt32, bottomUpListOffset: UInt32, dylibTrieOffset: UInt32, dylibTrieSize: UInt32, initializersOffset: UInt32, initializersCount: UInt32, dofSectionsOffset: UInt32, dofSectionsCount: UInt32, reExportListOffset: UInt32, reExportCount: UInt32, depListOffset: UInt32, depListCount: UInt32, rangeTableOffset: UInt32, rangeTableCount: UInt32, dyldSectionAddr: UInt64 ) ``` ### Parameters - **version** (UInt32) - The version of the accelerator info structure. - **imageExtrasCount** (UInt32) - The number of image extras. - **imagesExtrasOffset** (UInt32) - The offset to the image extras. - **bottomUpListOffset** (UInt32) - The offset to the bottom-up list. - **dylibTrieOffset** (UInt32) - The offset to the dylib trie. - **dylibTrieSize** (UInt32) - The size of the dylib trie. - **initializersOffset** (UInt32) - The offset to the initializers. - **initializersCount** (UInt32) - The number of initializers. - **dofSectionsOffset** (UInt32) - The offset to the DOF sections. - **dofSectionsCount** (UInt32) - The number of DOF sections. - **reExportListOffset** (UInt32) - The offset to the re-export list. - **reExportCount** (UInt32) - The number of re-exports. - **depListOffset** (UInt32) - The offset to the dependency list. - **depListCount** (UInt32) - The number of dependencies. - **rangeTableOffset** (UInt32) - The offset to the range table. - **rangeTableCount** (UInt32) - The number of range table entries. - **dyldSectionAddr** (UInt64) - The address of the dyld section. ### Return Value An initialized `dyld_cache_accelerator_info` instance. ### Discussion This initializer is used to create a `dyld_cache_accelerator_info` object with all the necessary fields for describing the accelerator information in a dyld shared cache. The parameters correspond to the fields of the underlying structure. ``` -------------------------------- ### var rawValue: RawValue { get } Source: https://p-x9.github.io/MachOKit/documentation/machokit/dataincodeentry/kind-swift.enum/rawvalue-swift.property The rawValue property, inherited from the RawRepresentable protocol, returns the underlying raw value of a DataInCodeEntry.Kind instance. This property is read-only and is typically used to get the original value used to create the enum case. ```APIDOC ## var rawValue: RawValue { get } ### Description Returns the raw value of the `DataInCodeEntry.Kind` enumeration case, as inherited from the `RawRepresentable` protocol. ### Declared In `RawRepresentable` protocol ### Property Signature ```swift var rawValue: RawValue { get } ``` ### Parameters - None ### Return Value - `rawValue` (type: `RawValue`) - The raw value associated with the enumeration case. ### Discussion This property is read-only and returns the original value used to create the enumeration instance. The exact type of `RawValue` is determined by the enumeration's raw value type. ``` -------------------------------- ### MachOFile Initializers and Methods Source: https://p-x9.github.io/MachOKit/documentation/machokit/machofile Initializers and instance methods for the MachOFile class. ```APIDOC ## init(url: URL, headerStartOffset: Int) throws ### Description Initializes a MachOFile instance from a file URL and the header start offset. ### Method Initializer ### Parameters - **url** (URL) - Required - The URL of the file to load. - **headerStartOffset** (Int) - Required - The file offset where the Mach-O header starts. ### Throws An error if the file cannot be read or parsed. ``` ```APIDOC ## init(url: URL, imagePath: String?, headerStartOffsetInCache: Int) throws ### Description Initializes a MachOFile instance from a file URL, an optional image path, and the header start offset in the dyld cache. This initializer is deprecated. ### Method Initializer ### Parameters - **url** (URL) - Required - The URL of the file to load. - **imagePath** (String?) - Optional - The path representing the Mach-O file. - **headerStartOffsetInCache** (Int) - Required - The file offset of the header start in the dyld cache file. ### Throws An error if the file cannot be read or parsed. ``` ```APIDOC ## init(url: URL, imagePath: String?, headerStartOffsetInCache: Int, cache: DyldCache) throws ### Description Initializes a MachOFile instance from a file URL, an optional image path, the header start offset in the dyld cache, and the associated DyldCache object. ### Method Initializer ### Parameters - **url** (URL) - Required - The URL of the file to load. - **imagePath** (String?) - Optional - The path representing the Mach-O file. - **headerStartOffsetInCache** (Int) - Required - The file offset of the header start in the dyld cache file. - **cache** (DyldCache) - Required - The DyldCache object associated with this Mach-O file. ### Throws An error if the file cannot be read or parsed. ``` ```APIDOC ## func fileOffset(of: UInt64) -> UInt64? ### Description Converts a raw virtual memory address (VM address) into a file offset within the Mach-O file. ### Method Instance Method ### Parameters - **of** (UInt64) - Required - The virtual memory address to convert. ### Return Value An optional UInt64 representing the file offset, or nil if the conversion fails. ``` ```APIDOC ## func resolveBind(at: UInt64) -> (DyldChainedImport, addend: UInt64)? ### Description Resolves a bind operation at the given virtual memory address. ### Method Instance Method ### Parameters - **at** (UInt64) - Required - The virtual memory address to resolve. ### Return Value An optional tuple containing the resolved DyldChainedImport and the addend, or nil if resolution fails. ``` ```APIDOC ## func resolveOptionalRebase(at: UInt64) -> UInt64? ### Description Resolves an optional rebase operation at the given virtual memory address. ### Method Instance Method ### Parameters - **at** (UInt64) - Required - The virtual memory address to resolve. ### Return Value An optional UInt64 representing the resolved value, or nil if resolution fails. ``` ```APIDOC ## func resolveRebase(at: UInt64) -> UInt64? ### Description Resolves a rebase operation at the given virtual memory address. ### Method Instance Method ### Parameters - **at** (UInt64) - Required - The virtual memory address to resolve. ### Return Value An optional UInt64 representing the resolved value, or nil if resolution fails. ``` -------------------------------- ### init(version:flags:selopt_offset:headeropt_ro_offset:unused_clsopt_offset:unused_protocolopt_offset:headeropt_rw_offset:unused_protocolopt2_offset:largeSharedCachesClassOffset:largeSharedCachesProtocolOffset:relativeMethodSelectorBaseAddressOffset:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/objc_opt_t_16/init%28version%3Aflags%3Aselopt_offset%3Aheaderopt_ro_offset%3Aunused_clsopt_offset%3Aunused_protocolopt_offset%3Aheaderopt_rw_offset%3Aunused_protocolopt2_offset%3Alargesharedcachesclassoffset%3Alargesharedcachesprotocoloffset%3Arelativemethodselectorbaseaddres-33c21 Initializes an objc_opt_t_16 structure with the provided version, flags, and various offsets. This initializer is used to create an instance of the structure with the given parameters. ```APIDOC ## Initializer ### Description Initializes an `objc_opt_t_16` structure with the provided version, flags, and various offsets. This initializer is used to create an instance of the structure with the given parameters. ### Signature ```swift init( version: UInt32, flags: UInt32, selopt_offset: Int32, headeropt_ro_offset: Int32, unused_clsopt_offset: Int32, unused_protocolopt_offset: Int32, headeropt_rw_offset: Int32, unused_protocolopt2_offset: Int32, largeSharedCachesClassOffset: Int32, largeSharedCachesProtocolOffset: Int32, relativeMethodSelectorBaseAddressOffset: Int64 ) ``` ### Parameters - **version** (UInt32) - The version of the structure. - **flags** (UInt32) - Flags associated with the structure. - **selopt_offset** (Int32) - Offset for selector optimization. - **headeropt_ro_offset** (Int32) - Offset for read-only header optimization. - **unused_clsopt_offset** (Int32) - Unused offset for class optimization. - **unused_protocolopt_offset** (Int32) - Unused offset for protocol optimization. - **headeropt_rw_offset** (Int32) - Offset for read-write header optimization. - **unused_protocolopt2_offset** (Int32) - Unused offset for second protocol optimization. - **largeSharedCachesClassOffset** (Int32) - Offset for large shared caches class. - **largeSharedCachesProtocolOffset** (Int32) - Offset for large shared caches protocol. - **relativeMethodSelectorBaseAddressOffset** (Int64) - Offset for relative method selector base address. ### Return Value An initialized `objc_opt_t_16` instance. ``` -------------------------------- ### functionStartsOffset Source: https://p-x9.github.io/MachOKit/documentation/machokit/machofile/functionstarts-swift.struct/functionstartsoffset Returns the offset of the function starts data in the Mach-O file. ```APIDOC ## functionStartsOffset ### Description Returns the offset of the function starts data within the Mach-O file. ### Declaration ```swift let functionStartsOffset: Int ``` ### Parameters None. ### Return Value An integer representing the byte offset of the function starts data. ### Discussion This property is part of the MachOFile.FunctionStarts structure and provides the offset used to locate the function starts information in the binary. ``` -------------------------------- ### init?(rawValue: RawValue) Source: https://p-x9.github.io/MachOKit/documentation/machokit/symbolflags/bit/rawrepresentable-implementations Creates a new instance with the specified raw value. ```APIDOC ## init?(rawValue: RawValue) ### Description Creates a new instance with the specified raw value. ### Method init ### Parameters - **rawValue** (RawValue) - The raw value to use for the new instance. ### Return Value An optional instance of SymbolFlags.Bit, or nil if the raw value is not valid. ``` -------------------------------- ### var numberOfPageStarts: Int Source: https://p-x9.github.io/MachOKit/documentation/machokit/dyldcacheslideinfo2 The number of page starts in the slide info. ```APIDOC ## var numberOfPageStarts: Int ### Description Returns the number of page starts in the slide info. ### Declaration ```swift var numberOfPageStarts: Int { get } ``` ### Parameters None. ### Return Value - **numberOfPageStarts** (Int) - The number of page starts. ``` -------------------------------- ### LoadCommand.functionStarts(_:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/loadcommand/functionstarts%28_%3A%29 The LoadCommand.functionStarts(_:) case represents the LC_FUNCTION_STARTS load command in a Mach-O binary. It carries an associated value of type LoadCommandInfo. ```APIDOC ## LoadCommand.functionStarts(_:) ### Description Represents the LC_FUNCTION_STARTS load command. ### Declaration ```swift case functionStarts(LoadCommandInfo) ``` ### Associated Value - **LoadCommandInfo** - The load command info for the LC_FUNCTION_STARTS command. ``` -------------------------------- ### mappingAndSlideInfo(for:) Source: https://p-x9.github.io/MachOKit/documentation/machokit/fulldyldcache/mappingandslideinfo%28for%3A%29 Get mapping and slide info containing the specified vmaddr. ```APIDOC ## mappingAndSlideInfo(for:) ### Description Get mapping and slide info containing the specified vmaddr. ### Method mappingAndSlideInfo(for:) ### Signature swift func mappingAndSlideInfo(for address: UInt64) -> DyldCacheMappingAndSlideInfo? ### Parameters - **address** (UInt64) - The vmaddr to look up. ### Return Value - **DyldCacheMappingAndSlideInfo?** - Mapping and slide info, or nil if not found. ``` -------------------------------- ### ptr Source: https://p-x9.github.io/MachOKit/documentation/machokit/machoimage/ptr The `ptr` property returns the address of the Mach-O header start as an `UnsafeRawPointer`. ```APIDOC ## ptr ### Description Address of MachO header start. ### Declaration ```swift let ptr: UnsafeRawPointer ``` ### Parameters None ### Return Value An `UnsafeRawPointer` representing the address of the Mach-O header start. ```