diff options
author | comex | 2015-03-03 14:11:31 -0500 |
---|---|---|
committer | comex | 2015-03-03 14:11:39 -0500 |
commit | 0c8985d090df2eeb1d703bd71ba48ee06daa2b18 (patch) | |
tree | 2729f8ec081fe73e6be0b861fd04ab012ce166d6 | |
parent | Merge pull request #2 from evilGoldfish/master (diff) | |
download | substitute-0c8985d090df2eeb1d703bd71ba48ee06daa2b18.tar.gz |
fixes for compiling on older OS X
-rw-r--r-- | darwin-bootstrap/bundle-loader.c | 2 | ||||
-rw-r--r-- | lib/darwin/inject.c | 6 | ||||
-rw-r--r-- | lib/substitute.h | 1 |
3 files changed, 7 insertions, 2 deletions
diff --git a/darwin-bootstrap/bundle-loader.c b/darwin-bootstrap/bundle-loader.c index af24135..d559da3 100644 --- a/darwin-bootstrap/bundle-loader.c +++ b/darwin-bootstrap/bundle-loader.c @@ -154,7 +154,7 @@ static void load_bundle_list(const void *buf, size_t size) { } return; invalid: - ib_log("invalid bundle list data"); + ib_log("invalid bundle list IPC data (substitute bug)"); } static kern_return_t substituted_hello(mach_port_t service, int proto_version, diff --git a/lib/darwin/inject.c b/lib/darwin/inject.c index 0f67ccb..14b204b 100644 --- a/lib/darwin/inject.c +++ b/lib/darwin/inject.c @@ -615,7 +615,11 @@ int substitute_dlopen_in_pid(int pid, const char *filename, int options, inject_start_arm[], inject_start_arm64[]; - int target_page_size = cputype == CPU_TYPE_ARM64 ? 0x4000 : 0x1000; + int target_page_size = +#if defined(__arm__) || defined(__arm64__) + cputype == CPU_TYPE_ARM64 ? 0x4000 : +#endif + 0x1000; kr = mach_vm_allocate(task, &target_stack, 2 * target_page_size, VM_FLAGS_ANYWHERE); if (kr) { asprintf(error, "couldn't allocate target stack"); diff --git a/lib/substitute.h b/lib/substitute.h index d752d47..f75aa82 100644 --- a/lib/substitute.h +++ b/lib/substitute.h @@ -8,6 +8,7 @@ #include <stdlib.h> #include <stdint.h> +#include <stdbool.h> #ifdef __cplusplus extern "C" { |