Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion WDBFontOverwrite/grant_full_disk_access.m
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,16 @@ static void grant_full_disk_access_impl(void (^completion)(NSString* extension_t
NSError* _Nullable error)) {
char* targetPath = "/System/Library/PrivateFrameworks/TCC.framework/Support/tccd";
int fd = open(targetPath, O_RDONLY | O_CLOEXEC);
if (fd == -1) {
targetPath = "/System/Library/PrivateFrameworks/TCC.framework/tccd";
fd = open(targetPath, O_RDONLY | O_CLOEXEC);
if (fd == -1) {
completion(nil, [NSError errorWithDomain:@"com.worthdoingbadly.fulldiskaccess"
code:5
userInfo:@{NSLocalizedDescriptionKey : @"Can't patchfind."}]);
return;
}
}
off_t targetLength = lseek(fd, 0, SEEK_END);
lseek(fd, 0, SEEK_SET);
void* targetMap = mmap(nil, targetLength, PROT_READ, MAP_SHARED, fd, 0);
Expand Down Expand Up @@ -397,4 +407,4 @@ void grant_full_disk_access(void (^completion)(NSError* _Nullable)) {
error:&error];
completion(nil);
});
}
}
2 changes: 1 addition & 1 deletion WDBFontOverwrite/vm_unaligned_copy_switch_race.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ switcheroo_thread(__unused void *arg)
T_QUIET; T_EXPECT_MACH_SUCCESS(kr, " vm_map() RW");
/* wait a little bit */
usleep(100);
/* switch bakc to original RO mapping */
/* switch back to original RO mapping */
kr = vm_map(mach_task_self(),
&ctx->e0,
ctx->obj_size,
Expand Down