]> git.saurik.com Git - apple/system_cmds.git/blame - gcore.tproj/dyld_shared_cache.h
system_cmds-735.tar.gz
[apple/system_cmds.git] / gcore.tproj / dyld_shared_cache.h
CommitLineData
cf37c299
A
1/*
2 * Copyright (c) 2015 Apple Inc. All rights reserved.
3 */
4
5#include <inttypes.h>
6#include <stdbool.h>
7#include <uuid/uuid.h>
8#include <sys/types.h>
9
10#ifndef _DYLD_SHARED_CACHE_H
11#define _DYLD_SHARED_CACHE_H
12
13/*
14 * Guilty knowledge of dyld shared cache internals, used to verify shared cache
15 */
16struct copied_dyld_cache_header {
17 char magic[16]; // e.g. "dyld_v0 i386"
18 uint32_t mappingOffset; // file offset to first dyld_cache_mapping_info
19 uint32_t mappingCount; // number of dyld_cache_mapping_info entries
20 uint32_t imagesOffset; // file offset to first dyld_cache_image_info
21 uint32_t imagesCount; // number of dyld_cache_image_info entries
22 uint64_t dyldBaseAddress; // base address of dyld when cache was built
23 uint64_t codeSignatureOffset; // file offset of code signature blob
24 uint64_t codeSignatureSize; // size of code signature blob (zero means to end of file)
25 uint64_t slideInfoOffset; // file offset of kernel slid info
26 uint64_t slideInfoSize; // size of kernel slid info
27 uint64_t localSymbolsOffset; // file offset of where local symbols are stored
28 uint64_t localSymbolsSize; // size of local symbols information
29 uint8_t uuid[16]; // unique value for each shared cache file
30 uint64_t cacheType; // 1 for development, 0 for optimized
31};
32
33extern bool get_uuid_from_shared_cache_mapping(const void *, size_t, uuid_t);
34extern char *shared_cache_filename(const uuid_t);
35
36#endif /* _DYLD_SHARED_CACHE_H */