]> git.saurik.com Git - apple/dyld.git/blob - src/dyld_process_info_internal.h
23f614bba87727d76c9593dfe89ab7cdea7b61b8
[apple/dyld.git] / src / dyld_process_info_internal.h
1 /* -*- mode: C++; c-basic-offset: 4; tab-width: 4 -*-
2 *
3 * Copyright (c) 2016 Apple Inc. All rights reserved.
4 *
5 * @APPLE_LICENSE_HEADER_START@
6 *
7 * This file contains Original Code and/or Modifications of Original Code
8 * as defined in and that are subject to the Apple Public Source License
9 * Version 2.0 (the 'License'). You may not use this file except in
10 * compliance with the License. Please obtain a copy of the License at
11 * http://www.opensource.apple.com/apsl/ and read it before using this
12 * file.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
19 * Please see the License for the specific language governing rights and
20 * limitations under the License.
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24
25 #ifndef _DYLD_PROCESS_INFO_INTERNAL_H_
26 #define _DYLD_PROCESS_INFO_INTERNAL_H_
27
28
29 #include <stdlib.h>
30 #include <string.h>
31 #include <limits.h>
32 #include <stdio.h>
33
34
35 struct dyld_all_image_infos_32 {
36 uint32_t version;
37 uint32_t infoArrayCount;
38 uint32_t infoArray;
39 uint32_t notification;
40 bool processDetachedFromSharedRegion;
41 bool libSystemInitialized;
42 uint32_t dyldImageLoadAddress;
43 uint32_t jitInfo;
44 uint32_t dyldVersion;
45 uint32_t errorMessage;
46 uint32_t terminationFlags;
47 uint32_t coreSymbolicationShmPage;
48 uint32_t systemOrderFlag;
49 uint32_t uuidArrayCount;
50 uint32_t uuidArray;
51 uint32_t dyldAllImageInfosAddress;
52 uint32_t initialImageCount;
53 uint32_t errorKind;
54 uint32_t errorClientOfDylibPath;
55 uint32_t errorTargetDylibPath;
56 uint32_t errorSymbol;
57 uint32_t sharedCacheSlide;
58 uint8_t sharedCacheUUID[16];
59 uint32_t sharedCacheBaseAddress;
60 uint64_t infoArrayChangeTimestamp;
61 uint32_t dyldPath;
62 uint32_t notifyMachPorts[2];
63 uint32_t reserved[11];
64 };
65
66 struct dyld_all_image_infos_64 {
67 uint32_t version;
68 uint32_t infoArrayCount;
69 uint64_t infoArray;
70 uint64_t notification;
71 bool processDetachedFromSharedRegion;
72 bool libSystemInitialized;
73 uint32_t paddingToMakeTheSizeCorrectOn32bitAndDoesntAffect64b; // NOT PART OF DYLD_ALL_IMAGE_INFOS!
74 uint64_t dyldImageLoadAddress;
75 uint64_t jitInfo;
76 uint64_t dyldVersion;
77 uint64_t errorMessage;
78 uint64_t terminationFlags;
79 uint64_t coreSymbolicationShmPage;
80 uint64_t systemOrderFlag;
81 uint64_t uuidArrayCount;
82 uint64_t uuidArray;
83 uint64_t dyldAllImageInfosAddress;
84 uint64_t initialImageCount;
85 uint64_t errorKind;
86 uint64_t errorClientOfDylibPath;
87 uint64_t errorTargetDylibPath;
88 uint64_t errorSymbol;
89 uint64_t sharedCacheSlide;
90 uint8_t sharedCacheUUID[16];
91 uint64_t sharedCacheBaseAddress;
92 uint64_t infoArrayChangeTimestamp;
93 uint64_t dyldPath;
94 uint32_t notifyMachPorts[2];
95 uint64_t reserved[12];
96 };
97
98 struct dyld_image_info_32 {
99 uint32_t imageLoadAddress;
100 uint32_t imageFilePath;
101 uint32_t imageFileModDate;
102 };
103 struct dyld_image_info_64 {
104 uint64_t imageLoadAddress;
105 uint64_t imageFilePath;
106 uint64_t imageFileModDate;
107 };
108
109 #define DYLD_PROCESS_INFO_NOTIFY_MAX_BUFFER_SIZE (32*1024)
110 #define DYLD_PROCESS_INFO_NOTIFY_LOAD_ID 0x1000
111 #define DYLD_PROCESS_INFO_NOTIFY_UNLOAD_ID 0x2000
112
113
114 struct dyld_process_info_image_entry {
115 uuid_t uuid;
116 uint64_t loadAddress;
117 uint32_t pathStringOffset;
118 uint32_t pathLength;
119 };
120
121 struct dyld_process_info_notify_header {
122 mach_msg_header_t header;
123 uint32_t version;
124 uint32_t imageCount;
125 uint32_t imagesOffset;
126 uint32_t stringsOffset;
127 uint64_t timestamp;
128 };
129
130
131
132
133 #endif // _DYLD_PROCESS_INFO_INTERNAL_H_
134
135