1 | /* |
2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. |
3 | * |
4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ |
5 | * |
6 | * This file contains Original Code and/or Modifications of Original Code |
7 | * as defined in and that are subject to the Apple Public Source License |
8 | * Version 2.0 (the 'License'). You may not use this file except in |
9 | * compliance with the License. The rights granted to you under the License |
10 | * may not be used to create, or enable the creation or redistribution of, |
11 | * unlawful or unlicensed copies of an Apple operating system, or to |
12 | * circumvent, violate, or enable the circumvention or violation of, any |
13 | * terms of an Apple operating system software license agreement. |
14 | * |
15 | * Please obtain a copy of the License at |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. |
17 | * |
18 | * The Original Code and all software distributed under the License are |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
23 | * Please see the License for the specific language governing rights and |
24 | * limitations under the License. |
25 | * |
26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ |
27 | */ |
28 | |
29 | /* |
30 | * Data structure definitions copied from dyld so that we can read dyld's saved UUID information |
31 | * for each binary image not loaded from the shared cache during stackshots. |
32 | */ |
33 | |
34 | /* Some clients check the dyld version at runtime */ |
35 | #define DYLD_ALL_IMAGE_INFOS_ADDRESS_MINIMUM_VERSION 9 |
36 | #define DYLD_ALL_IMAGE_INFOS_TIMESTAMP_MINIMUM_VERSION 15 |
37 | |
38 | /* Re-use dyld format for kext load addresses */ |
39 | #if __LP64__ |
40 | typedef struct user64_dyld_uuid_info kernel_uuid_info; |
41 | #else |
42 | typedef struct user32_dyld_uuid_info kernel_uuid_info; |
43 | #endif |
44 | |
45 | struct user32_dyld_image_info { |
46 | user32_addr_t imageLoadAddress; /* base address image is mapped int */ |
47 | user32_addr_t imageFilePath; /* path dyld used to load the image */ |
48 | user32_ulong_t imageFileModDate; /* time_t of image file */ |
49 | }; |
50 | |
51 | struct user64_dyld_image_info { |
52 | user64_addr_t imageLoadAddress; /* base address image is mapped int */ |
53 | user64_addr_t imageFilePath; /* path dyld used to load the image */ |
54 | user64_ulong_t imageFileModDate; /* time_t of image file */ |
55 | }; |
56 | |
57 | // FIXME: dyld is in C++, and some of the fields in dyld_all_image_infos are C++ |
58 | // native booleans. There must be a better way... |
59 | typedef uint8_t dyld_bool; |
60 | |
61 | struct user32_dyld_all_image_infos { |
62 | uint32_t version; |
63 | uint32_t infoArrayCount; |
64 | user32_addr_t infoArray; |
65 | user32_addr_t notification; |
66 | dyld_bool processDetachedFromSharedRegion; |
67 | dyld_bool libSystemInitialized; |
68 | user32_addr_t dyldImageLoadAddress; |
69 | user32_addr_t jitInfo; |
70 | user32_addr_t dyldVersion; |
71 | user32_addr_t errorMessage; |
72 | user32_addr_t terminationFlags; |
73 | user32_addr_t coreSymbolicationShmPage; |
74 | user32_addr_t systemOrderFlag; |
75 | user32_size_t uuidArrayCount; // dyld defines this as a uintptr_t despite it being a count |
76 | user32_addr_t uuidArray; |
77 | user32_addr_t dyldAllImageInfosAddress; |
78 | |
79 | /* the following field is only in version 10 (Mac OS X 10.7, iOS 4.2) and later */ |
80 | user32_addr_t initialImageCount; |
81 | /* the following field is only in version 11 (Mac OS X 10.7, iOS 4.2) and later */ |
82 | user32_addr_t errorKind; |
83 | user32_addr_t errorClientOfDylibPath; |
84 | user32_addr_t errorTargetDylibPath; |
85 | user32_addr_t errorSymbol; |
86 | /* the following field is only in version 12 (Mac OS X 10.7, iOS 4.3) and later */ |
87 | user32_addr_t sharedCacheSlide; |
88 | /* the following field is only in version 13 (Mac OS X 10.9, iOS 7.0) and later */ |
89 | uint8_t sharedCacheUUID[16]; |
90 | /* the following field is only in version 15 (Mac OS X 10.12, iOS 10.0) and later */ |
91 | user32_addr_t sharedCacheBaseAddress; |
92 | uint64_t timestamp; |
93 | user32_addr_t reserved[14]; |
94 | /* the following fields are only in version 16 (macOS 10.13, iOS 12.0) and later */ |
95 | user32_addr_t compact_dyld_image_info_addr; |
96 | user32_size_t compact_dyld_image_info_size; |
97 | }; |
98 | |
99 | struct user64_dyld_all_image_infos { |
100 | uint32_t version; |
101 | uint32_t infoArrayCount; |
102 | user64_addr_t infoArray; |
103 | user64_addr_t notification; |
104 | dyld_bool processDetachedFromSharedRegion; |
105 | dyld_bool libSystemInitialized; |
106 | user64_addr_t dyldImageLoadAddress; |
107 | user64_addr_t jitInfo; |
108 | user64_addr_t dyldVersion; |
109 | user64_addr_t errorMessage; |
110 | user64_addr_t terminationFlags; |
111 | user64_addr_t coreSymbolicationShmPage; |
112 | user64_addr_t systemOrderFlag; |
113 | user64_size_t uuidArrayCount; // dyld defines this as a uintptr_t despite it being a count |
114 | user64_addr_t uuidArray; |
115 | user64_addr_t dyldAllImageInfosAddress; |
116 | |
117 | /* the following field is only in version 10 (Mac OS X 10.7, iOS 4.2) and later */ |
118 | user64_addr_t initialImageCount; |
119 | /* the following field is only in version 11 (Mac OS X 10.7, iOS 4.2) and later */ |
120 | user64_addr_t errorKind; |
121 | user64_addr_t errorClientOfDylibPath; |
122 | user64_addr_t errorTargetDylibPath; |
123 | user64_addr_t errorSymbol; |
124 | /* the following field is only in version 12 (Mac OS X 10.7, iOS 4.3) and later */ |
125 | user64_addr_t sharedCacheSlide; |
126 | /* the following field is only in version 13 (Mac OS X 10.9, iOS 7.0) and later */ |
127 | uint8_t sharedCacheUUID[16]; |
128 | /* the following field is only in version 15 (macOS 10.12, iOS 10.0) and later */ |
129 | user64_addr_t sharedCacheBaseAddress; |
130 | uint64_t timestamp; |
131 | user64_addr_t reserved[14]; |
132 | /* the following fields are only in version 16 (macOS 10.13, iOS 12.0) and later */ |
133 | user64_addr_t compact_dyld_image_info_addr; |
134 | user64_size_t compact_dyld_image_info_size; |
135 | }; |
136 | |
137 | |