diff options
author | comex | 2015-01-17 13:40:22 -0500 |
---|---|---|
committer | comex | 2015-01-17 13:40:31 -0500 |
commit | 0e0380305eb8ab045aa26882e48e0b61498977c8 (patch) | |
tree | a5b47855e73d3a03a45ba1dda2bf57572c460867 /lib/objc.h | |
parent | this is all wrong. (diff) | |
download | substitute-0e0380305eb8ab045aa26882e48e0b61498977c8.tar.gz |
imp forwarding works
Diffstat (limited to 'lib/objc.h')
-rw-r--r-- | lib/objc.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/objc.h b/lib/objc.h new file mode 100644 index 0000000..24427e1 --- /dev/null +++ b/lib/objc.h @@ -0,0 +1,23 @@ +#pragma once +/* PAGE_SIZE is not actually a constant on iOS */ +#if defined(__arm64__) +#define _PAGE_SHIFT 14 +#else +#define _PAGE_SHIFT 12 +#endif +#define _PAGE_SIZE (1 << _PAGE_SHIFT) +#if defined(__x86_64__) +#define TRAMPOLINE_SIZE 0x23 +#elif defined(__i386__) +#define TRAMPOLINE_SIZE 0x1c +#elif defined(__arm__) +#define TRAMPOLINE_SIZE 0x18 +#elif defined(__arm64__) +#define TRAMPOLINE_SIZE 0x40 +#endif +#ifdef __LP64__ +#define REMAP_PAGE_ENTRY_SIZE 24 +#else +#define REMAP_PAGE_ENTRY_SIZE 12 +#endif +#define TRAMPOLINES_PER_PAGE (_PAGE_SIZE / TRAMPOLINE_SIZE) |