00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <ar.h>
00025 #include <mach-o/fat.h>
00026 #include <mach-o/loader.h>
00027 #include <mach-o/nlist.h>
00028 #include <mach-o/reloc.h>
00029
00030
00031 enum byte_sex {
00032 UNKNOWN_BYTE_SEX,
00033 BIG_ENDIAN_BYTE_SEX,
00034 LITTLE_ENDIAN_BYTE_SEX
00035 };
00036
00037
00038 extern void print_mach_header(
00039 struct mach_header *mh,
00040 bool verbose);
00041
00042 extern void print_loadcmds(
00043 struct mach_header *mh,
00044 struct load_command *load_commands,
00045 enum byte_sex load_commands_byte_sex,
00046 unsigned long object_size,
00047 bool verbose,
00048 bool very_verbose);
00049
00050 extern void print_segment_command(
00051 struct segment_command *sg,
00052 unsigned long object_size,
00053 bool verbose);
00054
00055 extern void print_section(
00056 struct section *s,
00057 struct segment_command *sg,
00058 struct mach_header *mh,
00059 unsigned long object_size,
00060 bool verbose);
00061
00062 extern void print_thread_states(
00063 char *begin,
00064 char *end,
00065 struct mach_header *mh,
00066 enum byte_sex thread_states_byte_sex);
00067
00068 extern void print_cstring_section(
00069 char *sect,
00070 unsigned long sect_size,
00071 unsigned long sect_addr,
00072 bool print_addresses);
00073
00074 extern void print_literal4_section(
00075 char *sect,
00076 unsigned long sect_size,
00077 unsigned long sect_addr,
00078 enum byte_sex literal_byte_sex,
00079 bool print_addresses);
00080
00081 extern void print_literal8_section(
00082 char *sect,
00083 unsigned long sect_size,
00084 unsigned long sect_addr,
00085 enum byte_sex literal_byte_sex,
00086 bool print_addresses);
00087
00088 extern void print_literal_pointer_section(
00089 struct mach_header *mh,
00090 struct load_command *lc,
00091 enum byte_sex object_byte_sex,
00092 char *addr,
00093 unsigned long size,
00094 char *sect,
00095 unsigned long sect_size,
00096 unsigned long sect_addr,
00097 struct nlist *symbols,
00098 unsigned long nsymbols,
00099 char *strings,
00100 unsigned long strings_size,
00101 struct relocation_info *relocs,
00102 unsigned long nrelocs,
00103 bool print_addresses);
00104