Skip to content

Commit

Permalink
Fix legacy Xcode compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed Oct 25, 2018
1 parent 605e4f1 commit 27f2c74
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Lilu/Sources/kern_user.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@
#include <mach/vm_map.h>
#include <mach-o/fat.h>
#include <kern/task.h>
#include <kern/cs_blobs.h>
#include <sys/vm.h>

static UserPatcher *that {nullptr};

// kern/cs_blobs.h is not available in older Xcode SDK, provide the declarations ourselves.
#ifndef CS_ENFORCEMENT
#define CS_KILL 0x00000200 /* kill process if it becomes invalid */
#define CS_ENFORCEMENT 0x00001000 /* require enforcement */
#define CS_KILLED 0x01000000 /* was killed by kernel for invalidity */
#endif

kern_return_t UserPatcher::vmProtect(vm_map_t map, vm_offset_t start, vm_size_t size, boolean_t set_maximum, vm_prot_t new_protection) {
// On 10.14 XNU attempted to fix broken W^X and introduced several changes:
// 1. vm_protect (vm_map_protect) got a call to cs_process_enforcement (formerly cs_enforcement), which aborts
Expand Down

0 comments on commit 27f2c74

Please sign in to comment.