peachsim 0.1.1914 → 0.1.1916

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +1 -1
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +1 -1
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +1 -1
  13. package/dist-lib/bundle-channel.cjs +23 -12
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +1 -1
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +1 -1
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +1 -1
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +1 -1
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +1 -1
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/expo-swift-bundle.cjs +18 -7
  27. package/dist-lib/expo-swift-metadata.cjs +1 -1
  28. package/dist-lib/expo-swift-metadata.mjs +1 -1
  29. package/dist-lib/home-paths.cjs +1 -1
  30. package/dist-lib/host/bridge-host.cjs +23 -12
  31. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  32. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  33. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  34. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  35. package/dist-lib/host/websocket-proxy.cjs +1 -1
  36. package/dist-lib/index.cjs +2 -2
  37. package/dist-lib/jump-to-source-babel.cjs +1 -1
  38. package/dist-lib/jump-to-source-native.cjs +1 -1
  39. package/dist-lib/kotlin-host.cjs +1 -1
  40. package/dist-lib/menu.cjs +1 -1
  41. package/dist-lib/menu.mjs +1 -1
  42. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  44. package/dist-lib/metro-production-bundle.cjs +1 -1
  45. package/dist-lib/metro-production-bundle.mjs +1 -1
  46. package/dist-lib/metro.cjs +2 -2
  47. package/dist-lib/native-app-identity-project.cjs +2 -2
  48. package/dist-lib/native-app-identity-project.mjs +2 -2
  49. package/dist-lib/native-app-identity.cjs +1 -1
  50. package/dist-lib/native-app-identity.mjs +1 -1
  51. package/dist-lib/native-firebase-metadata.cjs +1 -1
  52. package/dist-lib/native-firebase-metadata.mjs +1 -1
  53. package/dist-lib/pdfium-raster.cjs +1 -1
  54. package/dist-lib/pdfium-raster.mjs +1 -1
  55. package/dist-lib/plist.cjs +1 -1
  56. package/dist-lib/plist.mjs +1 -1
  57. package/dist-lib/profiles.cjs +1 -1
  58. package/dist-lib/public-brand.cjs +1 -1
  59. package/dist-lib/public-origins-lib-esm.json +24 -24
  60. package/dist-lib/public-origins-lib.json +53 -53
  61. package/dist-lib/react-native-host-modules.cjs +1 -1
  62. package/dist-lib/react-native-host-modules.mjs +1 -1
  63. package/dist-lib/reap-browser.cjs +1 -1
  64. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  65. package/dist-lib/sdk.cjs +1 -1
  66. package/dist-lib/sdk.mjs +1 -1
  67. package/dist-lib/skills.cjs +23 -12
  68. package/dist-lib/swift-compile.cjs +16 -5
  69. package/dist-lib/swift-compile.mjs +16 -5
  70. package/dist-lib/swift-package.cjs +1 -1
  71. package/dist-lib/swift-package.mjs +1 -1
  72. package/dist-lib/swift-submit.cjs +1 -1
  73. package/dist-lib/swift-submit.mjs +1 -1
  74. package/dist-lib/swift-toolchain.cjs +1 -1
  75. package/dist-lib/swift.cjs +1 -1
  76. package/dist-lib/vite-swift.cjs +17 -6
  77. package/dist-lib/vite.cjs +1 -1
  78. package/dist-lib/worklet-executable.cjs +1 -1
  79. package/dist-lib/worklet-executable.mjs +1 -1
  80. package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +1 -0
  81. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -1
  82. package/package.json +1 -1
  83. package/sdk/ios/usr/include/MachO.modulemap +22 -0
  84. package/sdk/ios/usr/include/mach-o/arm/reloc.h +67 -0
  85. package/sdk/ios/usr/include/mach-o/arm64/reloc.h +254 -0
  86. package/sdk/ios/usr/include/mach-o/dyld.h +265 -11
  87. package/sdk/ios/usr/include/mach-o/fixup-chains.h +362 -0
  88. package/sdk/ios/usr/include/mach-o/ldsyms.h +133 -0
  89. package/sdk/ios/usr/include/mach-o/nlist.h +315 -29
  90. package/sdk/ios/usr/include/mach-o/ranlib.h +90 -0
  91. package/sdk/ios/usr/include/mach-o/reloc.h +203 -0
  92. package/sdk/ios/usr/include/mach-o/swap.h +284 -0
  93. package/sdk/ios/usr/include/mach-o/x86_64/reloc.h +191 -0
  94. package/sdk/ios/usr/include/module.modulemap +1 -0
  95. package/src/nitro-adapter.lock.json +277 -277
  96. package/src/nitro-superset.lock.json +4 -4
  97. package/src/swift-distribution.lock.json +11 -11
  98. package/src/swift-guest-image-ledger.ts +1 -1
  99. package/src/swift-shared-sdk.ts +12 -1
  100. package/src/turbo-runtime.lock.json +21 -21
@@ -1,16 +1,270 @@
1
- #pragma once
1
+ /*
2
+ * Copyright (c) 1999-2008 Apple Inc. All rights reserved.
3
+ *
4
+ * @APPLE_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. Please obtain a copy of the License at
10
+ * http://www.opensource.apple.com/apsl/ and read it before using this
11
+ * file.
12
+ *
13
+ * The Original Code and all software distributed under the License are
14
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18
+ * Please see the License for the specific language governing rights and
19
+ * limitations under the License.
20
+ *
21
+ * @APPLE_LICENSE_HEADER_END@
22
+ */
23
+ #ifndef _MACH_O_DYLD_H_
24
+ #define _MACH_O_DYLD_H_
25
+
26
+ #include <stddef.h>
2
27
  #include <stdint.h>
28
+ #include <stdbool.h>
29
+
3
30
  #include <mach-o/loader.h>
4
- #ifdef __cplusplus
31
+ #include <Availability.h>
32
+ #include <TargetConditionals.h>
33
+
34
+ #if __cplusplus
5
35
  extern "C" {
6
36
  #endif
7
- uint32_t _dyld_image_count(void);
8
- const struct mach_header *_dyld_get_image_header(uint32_t image_index);
9
- intptr_t _dyld_get_image_vmaddr_slide(uint32_t image_index);
10
- const char *_dyld_get_image_name(uint32_t image_index);
11
- void _dyld_register_func_for_add_image(void (*func)(const struct mach_header *, intptr_t));
12
- void _dyld_register_func_for_remove_image(void (*func)(const struct mach_header *, intptr_t));
13
- int _NSGetExecutablePath(char *buf, uint32_t *bufsize);
14
- #ifdef __cplusplus
15
- }
37
+
38
+ #ifdef __DRIVERKIT_19_0
39
+ #define DYLD_DRIVERKIT_UNAVAILABLE __API_UNAVAILABLE(driverkit)
40
+ #else
41
+ #define DYLD_DRIVERKIT_UNAVAILABLE
16
42
  #endif
43
+
44
+ #ifndef __OPEN_SOURCE__
45
+
46
+
47
+ #define DYLD_EXCLAVEKIT_UNAVAILABLE
48
+
49
+ #endif //__OPEN_SOURCE__
50
+
51
+ /*
52
+ * The following functions allow you to iterate through all loaded images.
53
+ * This is not a thread safe operation. Another thread can add or remove
54
+ * an image during the iteration.
55
+ *
56
+ * Many uses of these routines can be replace by a call to dladdr() which
57
+ * will return the mach_header and name of an image, given an address in
58
+ * the image. dladdr() is thread safe.
59
+ */
60
+ extern uint32_t _dyld_image_count(void) __API_AVAILABLE(macos(10.1), ios(2.0));
61
+ extern const struct mach_header* _dyld_get_image_header(uint32_t image_index) __API_AVAILABLE(macos(10.1), ios(2.0));
62
+ extern intptr_t _dyld_get_image_vmaddr_slide(uint32_t image_index) __API_AVAILABLE(macos(10.1), ios(2.0));
63
+ extern const char* _dyld_get_image_name(uint32_t image_index) __API_AVAILABLE(macos(10.1), ios(2.0));
64
+
65
+
66
+ /*
67
+ * The following functions allow you to install callbacks which will be called
68
+ * by dyld whenever an image is loaded or unloaded. During a call to _dyld_register_func_for_add_image()
69
+ * the callback func is called for every existing image. Later, it is called as each new image
70
+ * is loaded and bound (but initializers not yet run). The callback registered with
71
+ * _dyld_register_func_for_remove_image() is called after any terminators in an image are run
72
+ * and before the image is un-memory-mapped.
73
+ */
74
+ extern void _dyld_register_func_for_add_image(void (*func)(const struct mach_header* mh, intptr_t vmaddr_slide)) __API_AVAILABLE(macos(10.1), ios(2.0));
75
+ extern void _dyld_register_func_for_remove_image(void (*func)(const struct mach_header* mh, intptr_t vmaddr_slide)) __API_AVAILABLE(macos(10.1), ios(2.0));
76
+
77
+
78
+ /*
79
+ * NSVersionOfRunTimeLibrary() returns the current_version number of the currently dylib
80
+ * specifed by the libraryName. The libraryName parameter would be "bar" for /path/libbar.3.dylib and
81
+ * "Foo" for /path/Foo.framework/Versions/A/Foo. It returns -1 if no such library is loaded.
82
+ */
83
+ extern int32_t NSVersionOfRunTimeLibrary(const char* libraryName) __API_AVAILABLE(macos(10.1), ios(2.0));
84
+
85
+
86
+ /*
87
+ * NSVersionOfLinkTimeLibrary() returns the current_version number that the main executable was linked
88
+ * against at build time. The libraryName parameter would be "bar" for /path/libbar.3.dylib and
89
+ * "Foo" for /path/Foo.framework/Versions/A/Foo. It returns -1 if the main executable did not link
90
+ * against the specified library.
91
+ */
92
+ extern int32_t NSVersionOfLinkTimeLibrary(const char* libraryName) __API_AVAILABLE(macos(10.1), ios(2.0));
93
+
94
+
95
+ /*
96
+ * _NSGetExecutablePath() copies the path of the main executable into the buffer. The bufsize parameter
97
+ * should initially be the size of the buffer. The function returns 0 if the path was successfully copied,
98
+ * and *bufsize is left unchanged. It returns -1 if the buffer is not large enough, and *bufsize is set
99
+ * to the size required.
100
+ *
101
+ * Note that _NSGetExecutablePath will return "a path" to the executable not a "real path" to the executable.
102
+ * That is the path may be a symbolic link and not the real file. With deep directories the total bufsize
103
+ * needed could be more than MAXPATHLEN.
104
+ */
105
+ extern int _NSGetExecutablePath(char* buf, uint32_t* bufsize) __API_AVAILABLE(macos(10.2), ios(2.0));
106
+
107
+
108
+
109
+ /*
110
+ * Registers a function to be called when the current thread terminates.
111
+ * Called by c++ compiler to implement destructors on thread_local object variables.
112
+ */
113
+ extern void _tlv_atexit(void (*termFunc)(void* objAddr), void* objAddr) __API_AVAILABLE(macos(10.10), ios(8.0));
114
+
115
+
116
+ /*
117
+ * Never called. On-disk thread local variables contain a pointer to this. Once
118
+ * the thread local is prepared, the pointer changes to a real handler such as tlv_get_addr.
119
+ */
120
+ extern void _tlv_bootstrap(void) __API_AVAILABLE(macos(10.10), ios(8.0)) DYLD_DRIVERKIT_UNAVAILABLE ;
121
+
122
+
123
+ /*
124
+ * Dylibs that are incorporated into the dyld cache are removed from disk. That means code
125
+ * cannot stat() the file to see if it "exists". This function is like a stat() call that checks if a
126
+ * path is to a dylib that was removed from disk and is incorporated into the active dyld cache.
127
+ */
128
+ extern bool _dyld_shared_cache_contains_path(const char* path) __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) DYLD_DRIVERKIT_UNAVAILABLE;
129
+
130
+
131
+ /*
132
+ * Given a handle returned by dlopen(), this function returns the mach_header* of the
133
+ * loaded image to which the handle refers.
134
+ */
135
+ extern const struct mach_header* _dyld_get_dlopen_image_header(void* handle) __API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0)) DYLD_DRIVERKIT_UNAVAILABLE;
136
+
137
+
138
+ /*
139
+ * The following dyld API's are deprecated as of Mac OS X 10.5. They are either
140
+ * no longer necessary or are superceeded by dlopen and friends in <dlfcn.h>.
141
+ * dlopen/dlsym/dlclose have been available since Mac OS X 10.3 and work with
142
+ * dylibs and bundles.
143
+ *
144
+ * NSAddImage -> dlopen
145
+ * NSLookupSymbolInImage -> dlsym
146
+ * NSCreateObjectFileImageFromFile -> dlopen
147
+ * NSDestroyObjectFileImage -> dlclose
148
+ * NSLinkModule -> not needed when dlopen used
149
+ * NSUnLinkModule -> not needed when dlclose used
150
+ * NSLookupSymbolInModule -> dlsym
151
+ * _dyld_image_containing_address -> dladdr
152
+ * NSLinkEditError -> dlerror
153
+ *
154
+ */
155
+
156
+ #ifndef ENUM_DYLD_BOOL
157
+ #define ENUM_DYLD_BOOL
158
+ #undef FALSE
159
+ #undef TRUE
160
+ enum DYLD_BOOL { FALSE, TRUE };
161
+ #endif /* ENUM_DYLD_BOOL */
162
+
163
+
164
+ /* Object file image API */
165
+ typedef enum {
166
+ NSObjectFileImageFailure, /* for this a message is printed on stderr */
167
+ NSObjectFileImageSuccess,
168
+ NSObjectFileImageInappropriateFile,
169
+ NSObjectFileImageArch,
170
+ NSObjectFileImageFormat, /* for this a message is printed on stderr */
171
+ NSObjectFileImageAccess
172
+ } NSObjectFileImageReturnCode;
173
+
174
+ typedef struct __NSObjectFileImage* NSObjectFileImage;
175
+
176
+
177
+
178
+ /* NSObjectFileImage can only be used with MH_BUNDLE files */
179
+ extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromFile(const char* pathName, NSObjectFileImage *objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlopen()");
180
+ extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromMemory(const void *address, size_t size, NSObjectFileImage *objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
181
+ extern bool NSDestroyObjectFileImage(NSObjectFileImage objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlclose()");
182
+
183
+ extern bool NSIsSymbolDefinedInObjectFileImage(NSObjectFileImage objectFileImage, const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
184
+ extern void* NSGetSectionDataInObjectFileImage(NSObjectFileImage objectFileImage, const char* segmentName, const char* sectionName, size_t *size) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "getsectiondata()");
185
+
186
+ typedef struct __NSModule* NSModule;
187
+ extern const char* NSNameOfModule(NSModule m) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
188
+ extern const char* NSLibraryNameForModule(NSModule m) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
189
+
190
+ extern NSModule NSLinkModule(NSObjectFileImage objectFileImage, const char* moduleName, uint32_t options) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlopen()");
191
+ #define NSLINKMODULE_OPTION_NONE 0x0
192
+ #define NSLINKMODULE_OPTION_BINDNOW 0x1
193
+ #define NSLINKMODULE_OPTION_PRIVATE 0x2
194
+ #define NSLINKMODULE_OPTION_RETURN_ON_ERROR 0x4
195
+ #define NSLINKMODULE_OPTION_DONT_CALL_MOD_INIT_ROUTINES 0x8
196
+ #define NSLINKMODULE_OPTION_TRAILING_PHYS_NAME 0x10
197
+
198
+ extern bool NSUnLinkModule(NSModule module, uint32_t options) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
199
+ #define NSUNLINKMODULE_OPTION_NONE 0x0
200
+ #define NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED 0x1
201
+ #define NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES 0x2
202
+
203
+ /* symbol API */
204
+ typedef struct __NSSymbol* NSSymbol;
205
+ extern bool NSIsSymbolNameDefined(const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
206
+ extern bool NSIsSymbolNameDefinedWithHint(const char* symbolName, const char* libraryNameHint) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
207
+ extern bool NSIsSymbolNameDefinedInImage(const struct mach_header* image, const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
208
+ extern NSSymbol NSLookupAndBindSymbol(const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
209
+ extern NSSymbol NSLookupAndBindSymbolWithHint(const char* symbolName, const char* libraryNameHint) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
210
+ extern NSSymbol NSLookupSymbolInModule(NSModule module, const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlsym()");
211
+ extern NSSymbol NSLookupSymbolInImage(const struct mach_header* image, const char* symbolName, uint32_t options) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlsym()");
212
+ #define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0
213
+ #define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1
214
+ #define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2
215
+ #define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4
216
+ extern void * NSAddressOfSymbol(NSSymbol symbol) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlsym()");
217
+ extern NSModule NSModuleForSymbol(NSSymbol symbol) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dladdr()");
218
+
219
+ /* error handling API */
220
+ typedef enum {
221
+ NSLinkEditFileAccessError,
222
+ NSLinkEditFileFormatError,
223
+ NSLinkEditMachResourceError,
224
+ NSLinkEditUnixResourceError,
225
+ NSLinkEditOtherError,
226
+ NSLinkEditWarningError,
227
+ NSLinkEditMultiplyDefinedError,
228
+ NSLinkEditUndefinedError
229
+ } NSLinkEditErrors;
230
+
231
+ /*
232
+ * For the NSLinkEditErrors value NSLinkEditOtherError these are the values
233
+ * passed to the link edit error handler as the errorNumber (what would be an
234
+ * errno value for NSLinkEditUnixResourceError or a kern_return_t value for
235
+ * NSLinkEditMachResourceError).
236
+ */
237
+ typedef enum {
238
+ NSOtherErrorRelocation,
239
+ NSOtherErrorLazyBind,
240
+ NSOtherErrorIndrLoop,
241
+ NSOtherErrorLazyInit,
242
+ NSOtherErrorInvalidArgs
243
+ } NSOtherErrorNumbers;
244
+
245
+ extern void NSLinkEditError(NSLinkEditErrors *c, int *errorNumber, const char** fileName, const char** errorString) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlerror()");
246
+
247
+ extern bool NSAddLibrary(const char* pathName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlopen()");
248
+ extern bool NSAddLibraryWithSearching(const char* pathName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlopen()");
249
+ extern const struct mach_header* NSAddImage(const char* image_name, uint32_t options) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlopen()");
250
+ #define NSADDIMAGE_OPTION_NONE 0x0
251
+ #define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1
252
+ #define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2
253
+ #define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4
254
+ #define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8
255
+
256
+ extern bool _dyld_present(void) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "always true");
257
+ extern bool _dyld_bind_fully_image_containing_address(const void* address) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlopen(RTLD_NOW)");
258
+ extern bool _dyld_image_containing_address(const void* address) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.3, 10.5, "dladdr()");
259
+ extern void _dyld_lookup_and_bind(const char* symbol_name, void **address, NSModule* module) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
260
+ extern void _dyld_lookup_and_bind_with_hint(const char* symbol_name, const char* library_name_hint, void** address, NSModule* module) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
261
+ extern void _dyld_lookup_and_bind_fully(const char* symbol_name, void** address, NSModule* module) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlsym()");
262
+
263
+ extern const struct mach_header* _dyld_get_image_header_containing_address(const void* address) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.3, 10.5, "dladdr()");
264
+
265
+
266
+ #if __cplusplus
267
+ }
268
+ #endif
269
+
270
+ #endif /* _MACH_O_DYLD_H_ */
@@ -0,0 +1,362 @@
1
+ /* -*- mode: C++; c-basic-offset: 4; tab-width: 4 -*-
2
+ *
3
+ * Copyright (c) 2018 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 __MACH_O_FIXUP_CHAINS__
26
+ #define __MACH_O_FIXUP_CHAINS__ 7
27
+
28
+
29
+ #include <stdint.h>
30
+
31
+
32
+ //#define LC_DYLD_EXPORTS_TRIE 0x80000033 // used with linkedit_data_command
33
+ //#define LC_DYLD_CHAINED_FIXUPS 0x80000034 // used with linkedit_data_command, payload is dyld_chained_fixups_header
34
+
35
+
36
+ // header of the LC_DYLD_CHAINED_FIXUPS payload
37
+ struct dyld_chained_fixups_header
38
+ {
39
+ uint32_t fixups_version; // 0
40
+ uint32_t starts_offset; // offset of dyld_chained_starts_in_image in chain_data
41
+ uint32_t imports_offset; // offset of imports table in chain_data
42
+ uint32_t symbols_offset; // offset of symbol strings in chain_data
43
+ uint32_t imports_count; // number of imported symbol names
44
+ uint32_t imports_format; // DYLD_CHAINED_IMPORT*
45
+ uint32_t symbols_format; // 0 => uncompressed, 1 => zlib compressed
46
+ };
47
+
48
+ // This struct is embedded in LC_DYLD_CHAINED_FIXUPS payload
49
+ struct dyld_chained_starts_in_image
50
+ {
51
+ uint32_t seg_count;
52
+ uint32_t seg_info_offset[1]; // each entry is offset into this struct for that segment
53
+ // followed by pool of dyld_chain_starts_in_segment data
54
+ };
55
+
56
+ // This struct is embedded in dyld_chain_starts_in_image
57
+ // and passed down to the kernel for page-in linking
58
+ struct dyld_chained_starts_in_segment
59
+ {
60
+ uint32_t size; // size of this (amount kernel needs to copy)
61
+ uint16_t page_size; // 0x1000 or 0x4000
62
+ uint16_t pointer_format; // DYLD_CHAINED_PTR_*
63
+ uint64_t segment_offset; // offset in memory to start of segment
64
+ uint32_t max_valid_pointer; // for 32-bit OS, any value beyond this is not a pointer
65
+ uint16_t page_count; // how many pages are in array
66
+ uint16_t page_start[1]; // each entry is offset in each page of first element in chain
67
+ // or DYLD_CHAINED_PTR_START_NONE if no fixups on page
68
+ // uint16_t chain_starts[1]; // some 32-bit formats may require multiple starts per page.
69
+ // for those, if high bit is set in page_starts[], then it
70
+ // is index into chain_starts[] which is a list of starts
71
+ // the last of which has the high bit set
72
+ };
73
+
74
+ enum {
75
+ DYLD_CHAINED_PTR_START_NONE = 0xFFFF, // used in page_start[] to denote a page with no fixups
76
+ DYLD_CHAINED_PTR_START_MULTI = 0x8000, // used in page_start[] to denote a page which has multiple starts
77
+ DYLD_CHAINED_PTR_START_LAST = 0x8000, // used in chain_starts[] to denote last start in list for page
78
+ };
79
+
80
+ // these values are set in the reserved1 field of the __chain_starts section
81
+ enum {
82
+ DYLD_CHAINED_STARTS_USE_FILE_OFFSET = 0x1, // denotes chain starts linked with -fixup_chains_section
83
+ DYLD_CHAINED_STARTS_USE_VM_OFFSET = 0x2, // denotes chain starts linked with -fixup_chains_section_vm
84
+ };
85
+
86
+ // This struct is embedded in __TEXT,__chain_starts section in firmware
87
+ struct dyld_chained_starts_offsets
88
+ {
89
+ uint32_t pointer_format; // DYLD_CHAINED_PTR_32_FIRMWARE or DYLD_CHAINED_PTR_ARM64E_KERNEL
90
+ uint32_t starts_count; // number of starts in array
91
+ uint32_t chain_starts[1]; // array chain start offsets
92
+ };
93
+
94
+
95
+ // values for dyld_chained_starts_in_segment.pointer_format
96
+ enum {
97
+ DYLD_CHAINED_PTR_ARM64E = 1, // stride 8, unauth target is vmaddr
98
+ DYLD_CHAINED_PTR_64 = 2, // target is vmaddr
99
+ DYLD_CHAINED_PTR_32 = 3, // target is vmaddr
100
+ DYLD_CHAINED_PTR_32_CACHE = 4,
101
+ DYLD_CHAINED_PTR_32_FIRMWARE = 5,
102
+ DYLD_CHAINED_PTR_64_OFFSET = 6, // target is vm offset
103
+ DYLD_CHAINED_PTR_ARM64E_OFFSET = 7, // old name
104
+ DYLD_CHAINED_PTR_ARM64E_KERNEL = 7, // stride 4, unauth target is vm offset
105
+ DYLD_CHAINED_PTR_64_KERNEL_CACHE = 8,
106
+ DYLD_CHAINED_PTR_ARM64E_USERLAND = 9, // stride 8, unauth target is vm offset
107
+ DYLD_CHAINED_PTR_ARM64E_FIRMWARE = 10, // stride 4, unauth target is vmaddr
108
+ DYLD_CHAINED_PTR_X86_64_KERNEL_CACHE = 11, // stride 1, x86_64 kernel caches
109
+ DYLD_CHAINED_PTR_ARM64E_USERLAND24 = 12, // stride 8, unauth target is vm offset, 24-bit bind
110
+ DYLD_CHAINED_PTR_ARM64E_SHARED_CACHE = 13, // stride 8, regular/auth targets both vm offsets. Only A keys supported
111
+ DYLD_CHAINED_PTR_ARM64E_SEGMENTED = 14, // stride 4, rebase offsets use segIndex and segOffset
112
+ DYLD_CHAINED_PTR_ARM64E_SHARED_CACHE_V3 = 15, // stride 8, regular/auth targets both vm offsets. Only A keys supported
113
+ DYLD_CHAINED_PTR_SHARED_CACHE_V2 = 16, // stride 8, x86_64 shared cache slide v2, delta mask 0x00FFFF0000000000, target is vm offset
114
+ };
115
+
116
+
117
+ // DYLD_CHAINED_PTR_ARM64E
118
+ struct dyld_chained_ptr_arm64e_rebase
119
+ {
120
+ uint64_t target : 43,
121
+ high8 : 8,
122
+ next : 11, // 4 or 8-byte stide
123
+ bind : 1, // == 0
124
+ auth : 1; // == 0
125
+ };
126
+
127
+ // DYLD_CHAINED_PTR_ARM64E
128
+ struct dyld_chained_ptr_arm64e_bind
129
+ {
130
+ uint64_t ordinal : 16,
131
+ zero : 16,
132
+ addend : 19, // +/-256K
133
+ next : 11, // 4 or 8-byte stide
134
+ bind : 1, // == 1
135
+ auth : 1; // == 0
136
+ };
137
+
138
+ // DYLD_CHAINED_PTR_ARM64E
139
+ struct dyld_chained_ptr_arm64e_auth_rebase
140
+ {
141
+ uint64_t target : 32, // runtimeOffset
142
+ diversity : 16,
143
+ addrDiv : 1,
144
+ key : 2,
145
+ next : 11, // 4 or 8-byte stide
146
+ bind : 1, // == 0
147
+ auth : 1; // == 1
148
+ };
149
+
150
+ // DYLD_CHAINED_PTR_ARM64E
151
+ struct dyld_chained_ptr_arm64e_auth_bind
152
+ {
153
+ uint64_t ordinal : 16,
154
+ zero : 16,
155
+ diversity : 16,
156
+ addrDiv : 1,
157
+ key : 2,
158
+ next : 11, // 4 or 8-byte stide
159
+ bind : 1, // == 1
160
+ auth : 1; // == 1
161
+ };
162
+
163
+ // DYLD_CHAINED_PTR_64/DYLD_CHAINED_PTR_64_OFFSET
164
+ struct dyld_chained_ptr_64_rebase
165
+ {
166
+ uint64_t target : 36, // 64GB max image size (DYLD_CHAINED_PTR_64 => vmAddr, DYLD_CHAINED_PTR_64_OFFSET => runtimeOffset)
167
+ high8 : 8, // top 8 bits set to this (DYLD_CHAINED_PTR_64 => after slide added, DYLD_CHAINED_PTR_64_OFFSET => before slide added)
168
+ reserved : 7, // all zeros
169
+ next : 12, // 4-byte stride
170
+ bind : 1; // == 0
171
+ };
172
+
173
+
174
+ // DYLD_CHAINED_PTR_ARM64E_USERLAND24
175
+ struct dyld_chained_ptr_arm64e_bind24
176
+ {
177
+ uint64_t ordinal : 24,
178
+ zero : 8,
179
+ addend : 19, // +/-256K
180
+ next : 11, // 8-byte stide
181
+ bind : 1, // == 1
182
+ auth : 1; // == 0
183
+ };
184
+
185
+ // DYLD_CHAINED_PTR_ARM64E_USERLAND24
186
+ struct dyld_chained_ptr_arm64e_auth_bind24
187
+ {
188
+ uint64_t ordinal : 24,
189
+ zero : 8,
190
+ diversity : 16,
191
+ addrDiv : 1,
192
+ key : 2,
193
+ next : 11, // 8-byte stide
194
+ bind : 1, // == 1
195
+ auth : 1; // == 1
196
+ };
197
+
198
+ // DYLD_CHAINED_PTR_ARM64E_SEGMENTED
199
+ struct dyld_chained_ptr_arm64e_segmented_rebase
200
+ {
201
+ uint32_t targetSegOffset : 28, // offset in segment
202
+ targetSegIndex : 4; // index into segment address table
203
+ uint32_t padding : 19,
204
+ next : 12, // 4-byte stide
205
+ auth : 1; // == 0
206
+ };
207
+
208
+ // DYLD_CHAINED_PTR_ARM64E_SEGMENTED
209
+ struct dyld_chained_ptr_arm64e_auth_segmented_rebase
210
+ {
211
+ uint32_t targetSegOffset : 28, // offset in segment
212
+ targetSegIndex : 4; // index into segment address table
213
+ uint32_t diversity : 16,
214
+ addrDiv : 1,
215
+ key : 2,
216
+ next : 12, // 4-byte stide
217
+ auth : 1; // == 1
218
+ };
219
+
220
+ // DYLD_CHAINED_PTR_64
221
+ struct dyld_chained_ptr_64_bind
222
+ {
223
+ uint64_t ordinal : 24,
224
+ addend : 8, // 0 thru 255
225
+ reserved : 19, // all zeros
226
+ next : 12, // 4-byte stride
227
+ bind : 1; // == 1
228
+ };
229
+
230
+ // DYLD_CHAINED_PTR_64_KERNEL_CACHE, DYLD_CHAINED_PTR_X86_64_KERNEL_CACHE
231
+ struct dyld_chained_ptr_64_kernel_cache_rebase
232
+ {
233
+ uint64_t target : 30, // basePointers[cacheLevel] + target
234
+ cacheLevel : 2, // what level of cache to bind to (indexes a mach_header array)
235
+ diversity : 16,
236
+ addrDiv : 1,
237
+ key : 2,
238
+ next : 12, // 1 or 4-byte stide
239
+ isAuth : 1; // 0 -> not authenticated. 1 -> authenticated
240
+ };
241
+
242
+ // DYLD_CHAINED_PTR_32
243
+ // Note: for DYLD_CHAINED_PTR_32 some non-pointer values are co-opted into the chain
244
+ // as out of range rebases. If an entry in the chain is > max_valid_pointer, then it
245
+ // is not a pointer. To restore the value, subtract off the bias, which is
246
+ // (64MB+max_valid_pointer)/2.
247
+ struct dyld_chained_ptr_32_rebase
248
+ {
249
+ uint32_t target : 26, // vmaddr, 64MB max image size
250
+ next : 5, // 4-byte stride
251
+ bind : 1; // == 0
252
+ };
253
+
254
+ // DYLD_CHAINED_PTR_32
255
+ struct dyld_chained_ptr_32_bind
256
+ {
257
+ uint32_t ordinal : 20,
258
+ addend : 6, // 0 thru 63
259
+ next : 5, // 4-byte stride
260
+ bind : 1; // == 1
261
+ };
262
+
263
+ // DYLD_CHAINED_PTR_32_CACHE
264
+ struct dyld_chained_ptr_32_cache_rebase
265
+ {
266
+ uint32_t target : 30, // 1GB max dyld cache TEXT and DATA
267
+ next : 2; // 4-byte stride
268
+ };
269
+
270
+
271
+ // DYLD_CHAINED_PTR_32_FIRMWARE
272
+ struct dyld_chained_ptr_32_firmware_rebase
273
+ {
274
+ uint32_t target : 26, // 64MB max firmware TEXT and DATA
275
+ next : 6; // 4-byte stride
276
+ };
277
+
278
+ // DYLD_CHAINED_PTR_ARM64E_SHARED_CACHE
279
+ struct dyld_chained_ptr_arm64e_shared_cache_rebase
280
+ {
281
+ uint64_t runtimeOffset : 34, // offset from the start of the shared cache
282
+ high8 : 8,
283
+ unused : 10,
284
+ next : 11, // 8-byte stide
285
+ auth : 1; // == 0
286
+ };
287
+
288
+ // DYLD_CHAINED_PTR_ARM64E_SHARED_CACHE
289
+ struct dyld_chained_ptr_arm64e_shared_cache_auth_rebase
290
+ {
291
+ uint64_t runtimeOffset : 34, // offset from the start of the shared cache
292
+ diversity : 16,
293
+ addrDiv : 1,
294
+ keyIsData : 1, // implicitly always the 'A' key. 0 -> IA. 1 -> DA
295
+ next : 11, // 8-byte stide
296
+ auth : 1; // == 1
297
+ };
298
+
299
+ // DYLD_CHAINED_PTR_ARM64E_SHARED_CACHE_V3
300
+ struct dyld_chained_ptr_arm64e_shared_cache_v3_rebase
301
+ {
302
+ uint64_t pointerValue : 51,
303
+ next : 11,
304
+ unused : 2; // = 0
305
+ };
306
+
307
+ // DYLD_CHAINED_PTR_ARM64E_SHARED_CACHE_V3
308
+ struct dyld_chained_ptr_arm64e_shared_cache_v3_auth_rebase
309
+ {
310
+ uint64_t offsetFromSharedCacheBase : 32,
311
+ diversity : 16,
312
+ addrDiv : 1,
313
+ key : 2,
314
+ next : 11,
315
+ unused : 1, // = 0
316
+ auth : 1; // = 1;
317
+ };
318
+
319
+ // DYLD_CHAINED_PTR_SHARED_CACHE_V2
320
+ struct dyld_chained_ptr_shared_cache_v2_rebase
321
+ {
322
+ uint64_t runtimeOffset : 40, // offset from the start of the shared cache
323
+ next : 16, // 4-byte stride
324
+ high8 : 8; // top byte of target address
325
+ };
326
+
327
+ // values for dyld_chained_fixups_header.imports_format
328
+ enum {
329
+ DYLD_CHAINED_IMPORT = 1,
330
+ DYLD_CHAINED_IMPORT_ADDEND = 2,
331
+ DYLD_CHAINED_IMPORT_ADDEND64 = 3,
332
+ };
333
+
334
+ // DYLD_CHAINED_IMPORT
335
+ struct dyld_chained_import
336
+ {
337
+ uint32_t lib_ordinal : 8, // -15 .. 240 (0xF1 .. 0xF0)
338
+ weak_import : 1,
339
+ name_offset : 23;
340
+ };
341
+
342
+ // DYLD_CHAINED_IMPORT_ADDEND
343
+ struct dyld_chained_import_addend
344
+ {
345
+ uint32_t lib_ordinal : 8, // -15 .. 240 (0xF1 .. 0xF0)
346
+ weak_import : 1,
347
+ name_offset : 23;
348
+ int32_t addend;
349
+ };
350
+
351
+ // DYLD_CHAINED_IMPORT_ADDEND64
352
+ struct dyld_chained_import_addend64
353
+ {
354
+ uint64_t lib_ordinal : 16, // -15 .. 65520 (0xFFF1 .. 0xFFF0)
355
+ weak_import : 1,
356
+ reserved : 15,
357
+ name_offset : 32;
358
+ uint64_t addend;
359
+ };
360
+
361
+ #endif // __MACH_O_FIXUP_CHAINS__
362
+