Skip to content

Commit

Permalink
Add shared cache map paths for Big Sur (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
kode54 committed Jan 8, 2021
1 parent 2c1c67e commit d107554
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Lilu/Headers/kern_user.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,16 @@ class UserPatcher {
* DYLD shared cache path on older systems before Big Sur
*/
static constexpr const char *sharedCacheLegacy {"/private/var/db/dyld/dyld_shared_cache_x86_64"};

/**
* DYLD shared cache map path on Haswell+ on Big Sur
*/
static constexpr const char *bigSurSharedCacheMapHaswell {"/System/Library/dyld/dyld_shared_cache_x86_64h.map"};

/**
* DYLD shared cache map path on older systems on Big Sur
*/
static constexpr const char *bigSurSharedCacheMapLegacy {"/System/Library/dyld/dyld_shared_cache_x86_64.map"};

/**
* DYLD shared cache path on Haswell+ on Big Sur
Expand Down
6 changes: 5 additions & 1 deletion Lilu/Sources/kern_user.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,11 @@ bool UserPatcher::loadDyldSharedCacheMapping() {

uint8_t *buffer {nullptr};
size_t bufferSize {0};
if (CPUInfo::isHaswellEligible() && getKernelVersion() >= KernelVersion::Yosemite) {
bool isHaswell = CPUInfo::isHaswellEligible();
if (getKernelVersion() >= KernelVersion::BigSur) {
buffer = FileIO::readFileToBuffer(isHaswell ? bigSurSharedCacheMapHaswell : bigSurSharedCacheMapLegacy, bufferSize);
}
else if (isHaswell && getKernelVersion() >= KernelVersion::Yosemite) {
buffer = FileIO::readFileToBuffer(SharedCacheMapHaswell, bufferSize);
}

Expand Down

0 comments on commit d107554

Please sign in to comment.