package owee
-
owee
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
val string_of_magic : magic -> string
type cpu_subtype = [
| `Intel
| `I386_ALL
| `I386
| `I486
| `I486SX
| `PENT
| `PENTPRO
| `PENTII_M3
| `PENTII_M5
| `CELERON
| `CELERON_MOBILE
| `PENTIUM_3
| `PENTIUM_3_M
| `PENTIUM_3_XEON
| `PENTIUM_M
| `PENTIUM_4
| `PENTIUM_4_M
| `ITANIUM
| `ITANIUM_2
| `XEON
| `XEON_MP
| `INTEL_FAMILY
| `INTEL_FAMILY_MAX
| `INTEL_MODEL
| `INTEL_MODEL_ALL
| `X86_ALL
| `X86_64_ALL
| `X86_ARCH1
| `POWERPC_ALL
| `POWERPC_601
| `POWERPC_602
| `POWERPC_603
| `POWERPC_603e
| `POWERPC_603ev
| `POWERPC_604
| `POWERPC_604e
| `POWERPC_620
| `POWERPC_750
| `POWERPC_7400
| `POWERPC_7450
| `POWERPC_970
| `ARM_ALL
| `ARM_V4T
| `ARM_V6
| unknown
]
type file_type = [
| `OBJECT
| `EXECUTE
| `CORE
| `PRELOAD
| `DYLIB
| `DYLINKER
| `BUNDLE
| `DYLIB_STUB
| `DSYM
| unknown
]
type header_flag = [
| `NOUNDEFS
| `INCRLINK
| `DYLDLINK
| `BINDATLOAD
| `PREBOUND
| `SPLIT_SEGS
| `TWOLEVEL
| `FORCE_FLAT
| `NOMULTIDEFS
| `NOFIXPREBINDING
| `PREBINDABLE
| `ALLMODSBOUND
| `SUBSECTIONS_VIA_SYMBOLS
| `CANONICAL
| `WEAK_DEFINES
| `BINDS_TO_WEAK
| `ALLOW_STACK_EXECUTION
| `ROOT_SAFE
| `SETUID_SAFE
| `NO_REEXPORTED_DYLIBS
| `PIE
]
type header = {
magic : magic;
cpu_type : cpu_type;
cpu_subtype : cpu_subtype;
file_type : file_type;
flags : header_flag list;
}
type reloc_type = [
| `GENERIC_RELOC_VANILLA
| `GENERIC_RELOC_PAIR
| `GENERIC_RELOC_SECTDIFF
| `GENERIC_RELOC_LOCAL_SECTDIFF
| `GENERIC_RELOC_PB_LA_PTR
| `X86_64_RELOC_BRANCH
| `X86_64_RELOC_GOT_LOAD
| `X86_64_RELOC_GOT
| `X86_64_RELOC_SIGNED
| `X86_64_RELOC_UNSIGNED
| `X86_64_RELOC_SUBTRACTOR
| `X86_64_RELOC_SIGNED_1
| `X86_64_RELOC_SIGNED_2
| `X86_64_RELOC_SIGNED_4
| `PPC_RELOC_VANILLA
| `PPC_RELOC_PAIR
| `PPC_RELOC_BR14
| `PPC_RELOC_BR24
| `PPC_RELOC_HI16
| `PPC_RELOC_LO16
| `PPC_RELOC_HA16
| `PPC_RELOC_LO14
| `PPC_RELOC_SECTDIFF
| `PPC_RELOC_LOCAL_SECTDIFF
| `PPC_RELOC_PB_LA_PTR
| `PPC_RELOC_HI16_SECTDIFF
| `PPC_RELOC_LO16_SECTDIFF
| `PPC_RELOC_HA16_SECTDIFF
| `PPC_RELOC_JBSR
| `PPC_RELOC_LO14_SECTDIFF
| unknown
]
type relocation_info = {
ri_address : int;
ri_symbolnum : Owee_buf.u32;
ri_pcrel : bool;
ri_length : Owee_buf.u32;
ri_extern : bool;
ri_type : reloc_type;
}
type scattered_relocation_info = {
rs_pcrel : bool;
rs_length : Owee_buf.u32;
rs_type : reloc_type;
rs_address : Owee_buf.u32;
rs_value : Owee_buf.s32;
}
type relocation = [
| `Relocation_info of relocation_info
| `Scattered_relocation_info of scattered_relocation_info
]
type sec_type = [
| `S_REGULAR
| `S_ZEROFILL
| `S_CSTRING_LITERALS
| `S_4BYTE_LITERALS
| `S_8BYTE_LITERALS
| `S_LITERAL_POINTERS
| `S_NON_LAZY_SYMBOL_POINTERS
| `S_LAZY_SYMBOL_POINTERS
| `S_SYMBOL_STUBS
| `S_MOD_INIT_FUNC_POINTERS
| `S_MOD_TERM_FUNC_POINTERS
| `S_COALESCED
| `S_GB_ZEROFILL
| `S_INTERPOSING
| `S_16BYTE_LITERALS
| `S_DTRACE_DOF
| `S_LAZY_DYLIB_SYMBOL_POINTERS
| unknown
]
type section = {
sec_sectname : string;
sec_segname : string;
sec_addr : Owee_buf.u64;
sec_size : Owee_buf.u64;
sec_align : int;
sec_relocs : relocation array;
sec_type : sec_type;
sec_user_attrs : sec_user_attr list;
sec_sys_attrs : sec_sys_attr list;
}
type segment = {
seg_segname : string;
seg_vmaddr : Owee_buf.u64;
seg_vmsize : Owee_buf.u64;
seg_fileoff : Owee_buf.u64;
seg_filesize : Owee_buf.u64;
seg_maxprot : vm_prot list;
seg_initprot : vm_prot list;
seg_flags : seg_flag list;
seg_sections : section array;
}
type sym_type = [
| `UNDF
| `ABS
| `SECT
| `PBUD
| `INDR
| `GSYM
| `FNAME
| `FUN
| `STSYM
| `LCSYM
| `BNSYM
| `OPT
| `RSYM
| `SLINE
| `ENSYM
| `SSYM
| `SO
| `OSO
| `LSYM
| `BINCL
| `SOL
| `PARAMS
| `VERSION
| `OLEVEL
| `PSYM
| `EINCL
| `ENTRY
| `LBRAC
| `EXCL
| `RBRAC
| `BCOMM
| `ECOMM
| `ECOML
| `LENG
| `PC
| unknown
]
type reference_flag = [
| `UNDEFINED_NON_LAZY
| `UNDEFINED_LAZY
| `DEFINED
| `PRIVATE_DEFINED
| `PRIVATE_UNDEFINED_NON_LAZY
| `PRIVATE_UNDEFINED_LAZY
| `REFERENCED_DYNAMICALLY
| `SYM_WEAK_REF
| `SYM_WEAK_DEF
| `LIBRARY_ORDINAL of Owee_buf.u16
| unknown
]
type symbol = {
sym_name : string;
sym_type : sym_type;
sym_pext : bool;
sym_ext : bool;
sym_sect : Owee_buf.u8;
sym_flags : [ `Uninterpreted of Owee_buf.u16 | `Flags of reference_flag list ];
sym_value : Owee_buf.u64;
}
type dylib_module = {
dylib_module_name_offset : Owee_buf.u32;
dylib_ext_def_sym : Owee_buf.u32 * Owee_buf.u32;
dylib_ref_sym : Owee_buf.u32 * Owee_buf.u32;
dylib_local_sym : Owee_buf.u32 * Owee_buf.u32;
dylib_ext_rel : Owee_buf.u32 * Owee_buf.u32;
dylib_init : Owee_buf.u32 * Owee_buf.u32;
dylib_term : Owee_buf.u32 * Owee_buf.u32;
dylib_objc_module_info_addr : Owee_buf.u32;
dylib_objc_module_info_size : Owee_buf.u64;
}
type dynamic_symbol_table = {
localSyms : Owee_buf.u32 * Owee_buf.u32;
extDefSyms : Owee_buf.u32 * Owee_buf.u32;
undefSyms : Owee_buf.u32 * Owee_buf.u32;
toc_entries : toc_entry array;
modules : dylib_module array;
extRefSyms : Owee_buf.u32 array;
indirectSyms : Owee_buf.u32 array;
extRels : relocation array;
locRels : relocation array;
}
type dylib = {
dylib_name : string;
dylib_timestamp : Owee_buf.u32;
dylib_current_version : Owee_buf.u32;
dylib_compatibility_version : Owee_buf.u32;
}
type command =
| LC_SEGMENT_32 of segment lazy_t
| LC_SYMTAB of (symbol array * Owee_buf.t) lazy_t
| LC_THREAD of (Owee_buf.u32 * Owee_buf.u32 array) list lazy_t
| LC_UNIXTHREAD of (Owee_buf.u32 * Owee_buf.u32 array) list lazy_t
| LC_DYSYMTAB of dynamic_symbol_table lazy_t
| LC_LOAD_DYLIB of dylib lazy_t
| LC_ID_DYLIB of dylib lazy_t
| LC_LOAD_DYLINKER of string
| LC_ID_DYLINKER of string
| LC_PREBOUND_DYLIB of (string * Owee_buf.u8 array) lazy_t
| LC_ROUTINES_32 of Owee_buf.u32 * Owee_buf.u32
| LC_SUB_FRAMEWORK of string
| LC_SUB_UMBRELLA of string
| LC_SUB_CLIENT of string
| LC_SUB_LIBRARY of string
| LC_TWOLEVEL_HINTS of (Owee_buf.u32 * Owee_buf.u32) array lazy_t
| LC_PREBIND_CKSUM of Owee_buf.u32
| LC_LOAD_WEAK_DYLIB of dylib lazy_t
| LC_SEGMENT_64 of segment lazy_t
| LC_ROUTINES_64 of Owee_buf.u64 * Owee_buf.u64
| LC_UUID of string
| LC_RPATH of string
| LC_CODE_SIGNATURE of Owee_buf.u32 * Owee_buf.u32
| LC_SEGMENT_SPLIT_INFO of Owee_buf.u32 * Owee_buf.u32
| LC_UNHANDLED of int * Owee_buf.t
val read : Owee_buf.t -> header * command list
val section_body : Owee_buf.t -> segment -> section -> Owee_buf.t