-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! This module roughly corresponds to `mach-o/dyld.h`. | ||
use loader::mach_header; | ||
|
||
extern "C" { | ||
pub fn _dyld_image_count() -> u32; | ||
pub fn _dyld_get_image_header(image_index: u32) -> *const mach_header; | ||
pub fn _dyld_get_image_vmaddr_slide(image_index: u32) -> ::libc::intptr_t; | ||
pub fn _dyld_get_image_name(image_index: u32) -> *const ::libc::c_char; | ||
pub fn _dyld_register_func_for_add_image( | ||
callback: unsafe extern "C" fn(mh: *const mach_header, vmaddr_slide: ::libc::intptr_t), | ||
); | ||
pub fn _dyld_register_func_for_remove_image( | ||
callback: unsafe extern "C" fn(mh: *const mach_header, vmaddr_slide: ::libc::intptr_t), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//! This module roughly corresponds to `mach-o/loader.h`. | ||
#[repr(C)] | ||
#[allow(dead_code, non_snake_case)] | ||
#[derive(Copy, Clone, Debug)] | ||
pub struct mach_header { | ||
pub magic: u32, | ||
pub cputype: ::libc::cpu_type_t, | ||
pub cpusubtype: ::libc::cpu_subtype_t, | ||
pub filetype: u32, | ||
pub ncmds: u32, | ||
pub sizeofcmds: u32, | ||
pub flags: u32, | ||
} |