diff options
author | Pwn20wnd <pwn20wndstuff@gmail.com> | 2019-02-10 20:33:23 +0300 |
---|---|---|
committer | Sam Bingner <sam@bingner.com> | 2019-02-10 14:28:58 -1000 |
commit | fd173298abf775de4275db48a2870f0fea9b6bc5 (patch) | |
tree | 46db8fd0428f812f446296104d96207bce9906d6 /main.m | |
parent | 2fdb85eec2f01d40b13bf8de04ca27cd846f8564 (diff) |
Use task_info(TASK_DYLD_INFO) to get the kernel base
Diffstat (limited to 'main.m')
-rw-r--r-- | main.m | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -39,7 +39,13 @@ int main(int argc, char* argv[]) { if (tfp0 == MACH_PORT_NULL) return -2; set_tfp0(tfp0); - uint64_t kernel_base = get_kernel_base(tfp0); + uint64_t kernel_base = 0; + struct task_dyld_info dyld_info = { 0 }; + mach_msg_type_number_t count = TASK_DYLD_INFO_COUNT; + if (task_info(tfp0, TASK_DYLD_INFO, (task_info_t)&dyld_info, &count) != KERN_SUCCESS || + (kernel_base = dyld_info.all_image_info_addr) == 0) { + return -3; + } init_kernel(kernel_base, NULL); uint64_t trust_chain = find_trustcache(); term_kernel(); |