Ticket #34232: print_objc.pp.c

File print_objc.pp.c, 196.5 KB (added by jmstephensjr@…, 12 years ago)

using gcc-4.2

Line 
1# 1 "print_objc.c"
2# 1 "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cctools/cctools/work/cctools-822/otool//"
3# 1 "<built-in>"
4# 1 "<command-line>"
5# 1 "print_objc.c"
6# 31 "print_objc.c"
7# 1 "/usr/include/stdio.h" 1 3 4
8# 64 "/usr/include/stdio.h" 3 4
9# 1 "/usr/include/_types.h" 1 3 4
10# 27 "/usr/include/_types.h" 3 4
11# 1 "/usr/include/sys/_types.h" 1 3 4
12# 32 "/usr/include/sys/_types.h" 3 4
13# 1 "/usr/include/sys/cdefs.h" 1 3 4
14# 33 "/usr/include/sys/_types.h" 2 3 4
15# 1 "/usr/include/machine/_types.h" 1 3 4
16# 34 "/usr/include/machine/_types.h" 3 4
17# 1 "/usr/include/i386/_types.h" 1 3 4
18# 37 "/usr/include/i386/_types.h" 3 4
19typedef signed char __int8_t;
20
21
22
23typedef unsigned char __uint8_t;
24typedef short __int16_t;
25typedef unsigned short __uint16_t;
26typedef int __int32_t;
27typedef unsigned int __uint32_t;
28typedef long long __int64_t;
29typedef unsigned long long __uint64_t;
30
31typedef long __darwin_intptr_t;
32typedef unsigned int __darwin_natural_t;
33# 70 "/usr/include/i386/_types.h" 3 4
34typedef int __darwin_ct_rune_t;
35
36
37
38
39
40typedef union {
41 char __mbstate8[128];
42 long long _mbstateL;
43} __mbstate_t;
44
45typedef __mbstate_t __darwin_mbstate_t;
46
47
48typedef long int __darwin_ptrdiff_t;
49
50
51
52
53
54typedef long unsigned int __darwin_size_t;
55
56
57
58
59
60typedef __builtin_va_list __darwin_va_list;
61
62
63
64
65
66typedef int __darwin_wchar_t;
67
68
69
70
71typedef __darwin_wchar_t __darwin_rune_t;
72
73
74typedef int __darwin_wint_t;
75
76
77
78
79typedef unsigned long __darwin_clock_t;
80typedef __uint32_t __darwin_socklen_t;
81typedef long __darwin_ssize_t;
82typedef long __darwin_time_t;
83# 35 "/usr/include/machine/_types.h" 2 3 4
84# 34 "/usr/include/sys/_types.h" 2 3 4
85# 58 "/usr/include/sys/_types.h" 3 4
86struct __darwin_pthread_handler_rec
87{
88 void (*__routine)(void *);
89 void *__arg;
90 struct __darwin_pthread_handler_rec *__next;
91};
92struct _opaque_pthread_attr_t { long __sig; char __opaque[56]; };
93struct _opaque_pthread_cond_t { long __sig; char __opaque[40]; };
94struct _opaque_pthread_condattr_t { long __sig; char __opaque[8]; };
95struct _opaque_pthread_mutex_t { long __sig; char __opaque[56]; };
96struct _opaque_pthread_mutexattr_t { long __sig; char __opaque[8]; };
97struct _opaque_pthread_once_t { long __sig; char __opaque[8]; };
98struct _opaque_pthread_rwlock_t { long __sig; char __opaque[192]; };
99struct _opaque_pthread_rwlockattr_t { long __sig; char __opaque[16]; };
100struct _opaque_pthread_t { long __sig; struct __darwin_pthread_handler_rec *__cleanup_stack; char __opaque[1168]; };
101# 94 "/usr/include/sys/_types.h" 3 4
102typedef __int64_t __darwin_blkcnt_t;
103typedef __int32_t __darwin_blksize_t;
104typedef __int32_t __darwin_dev_t;
105typedef unsigned int __darwin_fsblkcnt_t;
106typedef unsigned int __darwin_fsfilcnt_t;
107typedef __uint32_t __darwin_gid_t;
108typedef __uint32_t __darwin_id_t;
109typedef __uint64_t __darwin_ino64_t;
110
111typedef __darwin_ino64_t __darwin_ino_t;
112
113
114
115typedef __darwin_natural_t __darwin_mach_port_name_t;
116typedef __darwin_mach_port_name_t __darwin_mach_port_t;
117typedef __uint16_t __darwin_mode_t;
118typedef __int64_t __darwin_off_t;
119typedef __int32_t __darwin_pid_t;
120typedef struct _opaque_pthread_attr_t
121   __darwin_pthread_attr_t;
122typedef struct _opaque_pthread_cond_t
123   __darwin_pthread_cond_t;
124typedef struct _opaque_pthread_condattr_t
125   __darwin_pthread_condattr_t;
126typedef unsigned long __darwin_pthread_key_t;
127typedef struct _opaque_pthread_mutex_t
128   __darwin_pthread_mutex_t;
129typedef struct _opaque_pthread_mutexattr_t
130   __darwin_pthread_mutexattr_t;
131typedef struct _opaque_pthread_once_t
132   __darwin_pthread_once_t;
133typedef struct _opaque_pthread_rwlock_t
134   __darwin_pthread_rwlock_t;
135typedef struct _opaque_pthread_rwlockattr_t
136   __darwin_pthread_rwlockattr_t;
137typedef struct _opaque_pthread_t
138   *__darwin_pthread_t;
139typedef __uint32_t __darwin_sigset_t;
140typedef __int32_t __darwin_suseconds_t;
141typedef __uint32_t __darwin_uid_t;
142typedef __uint32_t __darwin_useconds_t;
143typedef unsigned char __darwin_uuid_t[16];
144typedef char __darwin_uuid_string_t[37];
145# 28 "/usr/include/_types.h" 2 3 4
146# 39 "/usr/include/_types.h" 3 4
147typedef int __darwin_nl_item;
148typedef int __darwin_wctrans_t;
149
150typedef __uint32_t __darwin_wctype_t;
151# 65 "/usr/include/stdio.h" 2 3 4
152
153
154
155
156
157typedef __darwin_va_list va_list;
158
159
160
161
162typedef __darwin_off_t off_t;
163
164
165
166
167typedef __darwin_size_t size_t;
168
169
170
171
172
173
174typedef __darwin_off_t fpos_t;
175# 98 "/usr/include/stdio.h" 3 4
176struct __sbuf {
177 unsigned char *_base;
178 int _size;
179};
180
181
182struct __sFILEX;
183# 132 "/usr/include/stdio.h" 3 4
184typedef struct __sFILE {
185 unsigned char *_p;
186 int _r;
187 int _w;
188 short _flags;
189 short _file;
190 struct __sbuf _bf;
191 int _lbfsize;
192
193
194 void *_cookie;
195 int (*_close)(void *);
196 int (*_read) (void *, char *, int);
197 fpos_t (*_seek) (void *, fpos_t, int);
198 int (*_write)(void *, const char *, int);
199
200
201 struct __sbuf _ub;
202 struct __sFILEX *_extra;
203 int _ur;
204
205
206 unsigned char _ubuf[3];
207 unsigned char _nbuf[1];
208
209
210 struct __sbuf _lb;
211
212
213 int _blksize;
214 fpos_t _offset;
215} FILE;
216
217
218
219extern FILE *__stdinp;
220extern FILE *__stdoutp;
221extern FILE *__stderrp;
222
223
224
225
226# 248 "/usr/include/stdio.h" 3 4
227
228void clearerr(FILE *);
229int fclose(FILE *);
230int feof(FILE *);
231int ferror(FILE *);
232int fflush(FILE *);
233int fgetc(FILE *);
234int fgetpos(FILE * , fpos_t *);
235char *fgets(char * , int, FILE *);
236
237
238
239FILE *fopen(const char * , const char * ) __asm("_" "fopen" );
240
241int fprintf(FILE * , const char * , ...) ;
242int fputc(int, FILE *);
243int fputs(const char * , FILE * ) __asm("_" "fputs" );
244size_t fread(void * , size_t, size_t, FILE * );
245FILE *freopen(const char * , const char * ,
246     FILE * ) __asm("_" "freopen" );
247int fscanf(FILE * , const char * , ...) ;
248int fseek(FILE *, long, int);
249int fsetpos(FILE *, const fpos_t *);
250long ftell(FILE *);
251size_t fwrite(const void * , size_t, size_t, FILE * ) __asm("_" "fwrite" );
252int getc(FILE *);
253int getchar(void);
254char *gets(char *);
255
256extern const int sys_nerr;
257extern const char *const sys_errlist[];
258
259void perror(const char *);
260int printf(const char * , ...) ;
261int putc(int, FILE *);
262int putchar(int);
263int puts(const char *);
264int remove(const char *);
265int rename (const char *, const char *);
266void rewind(FILE *);
267int scanf(const char * , ...) ;
268void setbuf(FILE * , char * );
269int setvbuf(FILE * , char * , int, size_t);
270int sprintf(char * , const char * , ...) ;
271int sscanf(const char * , const char * , ...) ;
272FILE *tmpfile(void);
273char *tmpnam(char *);
274int ungetc(int, FILE *);
275int vfprintf(FILE * , const char * , va_list) ;
276int vprintf(const char * , va_list) ;
277int vsprintf(char * , const char * , va_list) ;
278
279int asprintf(char **, const char *, ...) ;
280int vasprintf(char **, const char *, va_list) ;
281
282
283
284
285
286
287
288
289
290
291char *ctermid(char *);
292
293char *ctermid_r(char *);
294
295
296
297
298FILE *fdopen(int, const char *) __asm("_" "fdopen" );
299
300
301char *fgetln(FILE *, size_t *);
302
303int fileno(FILE *);
304void flockfile(FILE *);
305
306const char
307 *fmtcheck(const char *, const char *);
308int fpurge(FILE *);
309
310int fseeko(FILE *, off_t, int);
311off_t ftello(FILE *);
312int ftrylockfile(FILE *);
313void funlockfile(FILE *);
314int getc_unlocked(FILE *);
315int getchar_unlocked(void);
316
317int getw(FILE *);
318
319int pclose(FILE *);
320
321
322
323FILE *popen(const char *, const char *) __asm("_" "popen" );
324
325int putc_unlocked(int, FILE *);
326int putchar_unlocked(int);
327
328int putw(int, FILE *);
329void setbuffer(FILE *, char *, int);
330int setlinebuf(FILE *);
331
332int snprintf(char * , size_t, const char * , ...) ;
333char *tempnam(const char *, const char *) __asm("_" "tempnam" );
334int vfscanf(FILE * , const char * , va_list) ;
335int vscanf(const char * , va_list) ;
336int vsnprintf(char * , size_t, const char * , va_list) ;
337int vsscanf(const char * , const char * , va_list) ;
338
339FILE *zopen(const char *, const char *, int);
340
341
342
343
344
345
346
347
348FILE *funopen(const void *,
349  int (*)(void *, char *, int),
350  int (*)(void *, const char *, int),
351  fpos_t (*)(void *, fpos_t, int),
352  int (*)(void *));
353
354# 383 "/usr/include/stdio.h" 3 4
355
356int __srget(FILE *);
357int __svfscanf(FILE *, const char *, va_list) ;
358int __swbuf(int, FILE *);
359
360
361
362
363
364
365
366
367static __inline int __sputc(int _c, FILE *_p) {
368 if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
369  return (*_p->_p++ = _c);
370 else
371  return (__swbuf(_c, _p));
372}
373# 443 "/usr/include/stdio.h" 3 4
374# 1 "/usr/include/secure/_stdio.h" 1 3 4
375# 31 "/usr/include/secure/_stdio.h" 3 4
376# 1 "/usr/include/secure/_common.h" 1 3 4
377# 32 "/usr/include/secure/_stdio.h" 2 3 4
378# 42 "/usr/include/secure/_stdio.h" 3 4
379extern int __sprintf_chk (char * , int, size_t,
380     const char * , ...)
381  ;
382
383
384
385
386extern int __snprintf_chk (char * , size_t, int, size_t,
387      const char * , ...)
388  ;
389
390
391
392
393extern int __vsprintf_chk (char * , int, size_t,
394      const char * , va_list)
395  ;
396
397
398
399
400extern int __vsnprintf_chk (char * , size_t, int, size_t,
401       const char * , va_list)
402  ;
403# 444 "/usr/include/stdio.h" 2 3 4
404# 32 "print_objc.c" 2
405# 1 "/usr/include/string.h" 1 3 4
406# 70 "/usr/include/string.h" 3 4
407typedef __darwin_ssize_t ssize_t;
408# 80 "/usr/include/string.h" 3 4
409
410void *memchr(const void *, int, size_t);
411int memcmp(const void *, const void *, size_t);
412void *memcpy(void *, const void *, size_t);
413void *memmove(void *, const void *, size_t);
414void *memset(void *, int, size_t);
415
416char *stpcpy(char *, const char *);
417char *strcasestr(const char *, const char *);
418
419char *strcat(char *, const char *);
420char *strchr(const char *, int);
421int strcmp(const char *, const char *);
422int strcoll(const char *, const char *);
423char *strcpy(char *, const char *);
424size_t strcspn(const char *, const char *);
425char *strerror(int) __asm("_" "strerror" );
426int strerror_r(int, char *, size_t);
427size_t strlen(const char *);
428char *strncat(char *, const char *, size_t);
429int strncmp(const char *, const char *, size_t);
430char *strncpy(char *, const char *, size_t);
431
432char *strnstr(const char *, const char *, size_t);
433
434char *strpbrk(const char *, const char *);
435char *strrchr(const char *, int);
436size_t strspn(const char *, const char *);
437char *strstr(const char *, const char *);
438char *strtok(char *, const char *);
439size_t strxfrm(char *, const char *, size_t);
440
441
442
443void *memccpy(void *, const void *, int, size_t);
444char *strtok_r(char *, const char *, char **);
445char *strdup(const char *);
446
447int bcmp(const void *, const void *, size_t);
448void bcopy(const void *, void *, size_t);
449void bzero(void *, size_t);
450int ffs(int);
451int ffsl(long);
452int fls(int);
453int flsl(long);
454char *index(const char *, int);
455void memset_pattern4(void *, const void *, size_t);
456void memset_pattern8(void *, const void *, size_t);
457void memset_pattern16(void *, const void *, size_t);
458char *rindex(const char *, int);
459int strcasecmp(const char *, const char *);
460size_t strlcat(char *, const char *, size_t);
461size_t strlcpy(char *, const char *, size_t);
462void strmode(int, char *);
463int strncasecmp(const char *, const char *, size_t);
464char *strsep(char **, const char *);
465char *strsignal(int sig);
466void swab(const void * , void * , ssize_t);
467
468
469
470
471
472
473
474
475
476
477# 1 "/usr/include/secure/_string.h" 1 3 4
478# 55 "/usr/include/secure/_string.h" 3 4
479static __inline void *
480__inline_memcpy_chk (void *__dest, const void *__src, size_t __len)
481{
482  return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
483}
484
485
486
487
488
489
490static __inline void *
491__inline_memmove_chk (void *__dest, const void *__src, size_t __len)
492{
493  return __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
494}
495
496
497
498
499
500
501static __inline void *
502__inline_memset_chk (void *__dest, int __val, size_t __len)
503{
504  return __builtin___memset_chk (__dest, __val, __len, __builtin_object_size (__dest, 0));
505}
506
507
508
509
510
511
512static __inline char *
513__inline_strcpy_chk (char * __dest, const char * __src)
514{
515  return __builtin___strcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
516}
517
518
519
520
521
522
523
524static __inline char *
525__inline_stpcpy_chk (char *__dest, const char *__src)
526{
527  return __builtin___stpcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
528}
529
530
531
532
533
534
535
536static __inline char *
537__inline_strncpy_chk (char * __dest, const char * __src,
538        size_t __len)
539{
540  return __builtin___strncpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1));
541}
542
543
544
545
546
547
548static __inline char *
549__inline_strcat_chk (char * __dest, const char * __src)
550{
551  return __builtin___strcat_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
552}
553
554
555
556
557
558
559static __inline char *
560__inline_strncat_chk (char * __dest, const char * __src,
561        size_t __len)
562{
563  return __builtin___strncat_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1));
564}
565# 149 "/usr/include/string.h" 2 3 4
566# 33 "print_objc.c" 2
567# 1 "./../include/mach-o/loader.h" 1
568# 29 "./../include/mach-o/loader.h"
569# 1 "/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/stdint.h" 1 3 4
570# 20 "/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/stdint.h" 3 4
571typedef signed char int8_t;
572
573
574
575
576typedef short int16_t;
577
578
579
580
581typedef int int32_t;
582
583
584
585
586typedef long long int64_t;
587
588
589
590
591typedef unsigned char uint8_t;
592
593
594
595
596typedef unsigned short uint16_t;
597
598
599
600
601typedef unsigned int uint32_t;
602
603
604
605
606typedef unsigned long long uint64_t;
607
608
609
610typedef int8_t int_least8_t;
611typedef int16_t int_least16_t;
612typedef int32_t int_least32_t;
613typedef int64_t int_least64_t;
614typedef uint8_t uint_least8_t;
615typedef uint16_t uint_least16_t;
616typedef uint32_t uint_least32_t;
617typedef uint64_t uint_least64_t;
618
619
620
621typedef int8_t int_fast8_t;
622typedef int16_t int_fast16_t;
623typedef int32_t int_fast32_t;
624typedef int64_t int_fast64_t;
625typedef uint8_t uint_fast8_t;
626typedef uint16_t uint_fast16_t;
627typedef uint32_t uint_fast32_t;
628typedef uint64_t uint_fast64_t;
629
630
631
632
633
634
635typedef long intptr_t;
636
637
638
639
640typedef unsigned long uintptr_t;
641
642
643
644
645
646
647
648typedef long int intmax_t;
649# 106 "/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/stdint.h" 3 4
650typedef long unsigned int uintmax_t;
651# 30 "./../include/mach-o/loader.h" 2
652
653
654
655
656
657# 1 "./../include/mach/machine.h" 1
658# 83 "./../include/mach/machine.h"
659# 1 "/usr/include/mach/machine/vm_types.h" 1 3 4
660# 35 "/usr/include/mach/machine/vm_types.h" 3 4
661# 1 "/usr/include/mach/i386/vm_types.h" 1 3 4
662# 72 "/usr/include/mach/i386/vm_types.h" 3 4
663# 1 "/usr/include/i386/_types.h" 1 3 4
664# 73 "/usr/include/mach/i386/vm_types.h" 2 3 4
665# 1 "/usr/include/mach/i386/vm_param.h" 1 3 4
666# 74 "/usr/include/mach/i386/vm_types.h" 2 3 4
667# 93 "/usr/include/mach/i386/vm_types.h" 3 4
668typedef __darwin_natural_t natural_t;
669typedef int integer_t;
670
671
672
673
674
675
676typedef uintptr_t vm_offset_t;
677# 112 "/usr/include/mach/i386/vm_types.h" 3 4
678typedef uintptr_t vm_size_t;
679# 124 "/usr/include/mach/i386/vm_types.h" 3 4
680typedef uint64_t mach_vm_address_t;
681typedef uint64_t mach_vm_offset_t;
682typedef uint64_t mach_vm_size_t;
683
684typedef uint64_t vm_map_offset_t;
685typedef uint64_t vm_map_address_t;
686typedef uint64_t vm_map_size_t;
687# 36 "/usr/include/mach/machine/vm_types.h" 2 3 4
688# 84 "./../include/mach/machine.h" 2
689# 1 "/usr/include/mach/boolean.h" 1 3 4
690# 73 "/usr/include/mach/boolean.h" 3 4
691# 1 "/usr/include/mach/machine/boolean.h" 1 3 4
692# 35 "/usr/include/mach/machine/boolean.h" 3 4
693# 1 "/usr/include/mach/i386/boolean.h" 1 3 4
694# 69 "/usr/include/mach/i386/boolean.h" 3 4
695typedef unsigned int boolean_t;
696# 36 "/usr/include/mach/machine/boolean.h" 2 3 4
697# 74 "/usr/include/mach/boolean.h" 2 3 4
698# 85 "./../include/mach/machine.h" 2
699# 95 "./../include/mach/machine.h"
700struct machine_info {
701 int major_version;
702 int minor_version;
703 int max_cpus;
704 int avail_cpus;
705 vm_size_t memory_size;
706};
707
708typedef struct machine_info *machine_info_t;
709typedef struct machine_info machine_info_data_t;
710
711typedef int cpu_type_t;
712typedef int cpu_subtype_t;
713typedef integer_t cpu_threadtype_t;
714
715
716
717
718
719
720
721struct machine_slot {
722 boolean_t is_cpu;
723 cpu_type_t cpu_type;
724 cpu_subtype_t cpu_subtype;
725 volatile boolean_t running;
726 long cpu_ticks[3];
727 int clock_freq;
728};
729
730typedef struct machine_slot *machine_slot_t;
731typedef struct machine_slot machine_slot_data_t;
732# 36 "./../include/mach-o/loader.h" 2
733
734
735
736
737
738# 1 "/usr/include/mach/vm_prot.h" 1 3 4
739# 75 "/usr/include/mach/vm_prot.h" 3 4
740typedef int vm_prot_t;
741# 42 "./../include/mach-o/loader.h" 2
742
743
744
745
746
747# 1 "/usr/include/mach/machine/thread_status.h" 1 3 4
748# 35 "/usr/include/mach/machine/thread_status.h" 3 4
749# 1 "/usr/include/mach/i386/thread_status.h" 1 3 4
750# 70 "/usr/include/mach/i386/thread_status.h" 3 4
751# 1 "/usr/include/mach/i386/_structs.h" 1 3 4
752# 43 "/usr/include/mach/i386/_structs.h" 3 4
753struct __darwin_i386_thread_state
754{
755    unsigned int __eax;
756    unsigned int __ebx;
757    unsigned int __ecx;
758    unsigned int __edx;
759    unsigned int __edi;
760    unsigned int __esi;
761    unsigned int __ebp;
762    unsigned int __esp;
763    unsigned int __ss;
764    unsigned int __eflags;
765    unsigned int __eip;
766    unsigned int __cs;
767    unsigned int __ds;
768    unsigned int __es;
769    unsigned int __fs;
770    unsigned int __gs;
771};
772# 89 "/usr/include/mach/i386/_structs.h" 3 4
773struct __darwin_fp_control
774{
775    unsigned short __invalid :1,
776        __denorm :1,
777    __zdiv :1,
778    __ovrfl :1,
779    __undfl :1,
780    __precis :1,
781      :2,
782    __pc :2,
783
784
785
786
787
788    __rc :2,
789
790
791
792
793
794
795             :1,
796      :3;
797};
798typedef struct __darwin_fp_control __darwin_fp_control_t;
799# 147 "/usr/include/mach/i386/_structs.h" 3 4
800struct __darwin_fp_status
801{
802    unsigned short __invalid :1,
803        __denorm :1,
804    __zdiv :1,
805    __ovrfl :1,
806    __undfl :1,
807    __precis :1,
808    __stkflt :1,
809    __errsumm :1,
810    __c0 :1,
811    __c1 :1,
812    __c2 :1,
813    __tos :3,
814    __c3 :1,
815    __busy :1;
816};
817typedef struct __darwin_fp_status __darwin_fp_status_t;
818# 191 "/usr/include/mach/i386/_structs.h" 3 4
819struct __darwin_mmst_reg
820{
821 char __mmst_reg[10];
822 char __mmst_rsrv[6];
823};
824# 210 "/usr/include/mach/i386/_structs.h" 3 4
825struct __darwin_xmm_reg
826{
827 char __xmm_reg[16];
828};
829# 232 "/usr/include/mach/i386/_structs.h" 3 4
830struct __darwin_i386_float_state
831{
832 int __fpu_reserved[2];
833 struct __darwin_fp_control __fpu_fcw;
834 struct __darwin_fp_status __fpu_fsw;
835 __uint8_t __fpu_ftw;
836 __uint8_t __fpu_rsrv1;
837 __uint16_t __fpu_fop;
838 __uint32_t __fpu_ip;
839 __uint16_t __fpu_cs;
840 __uint16_t __fpu_rsrv2;
841 __uint32_t __fpu_dp;
842 __uint16_t __fpu_ds;
843 __uint16_t __fpu_rsrv3;
844 __uint32_t __fpu_mxcsr;
845 __uint32_t __fpu_mxcsrmask;
846 struct __darwin_mmst_reg __fpu_stmm0;
847 struct __darwin_mmst_reg __fpu_stmm1;
848 struct __darwin_mmst_reg __fpu_stmm2;
849 struct __darwin_mmst_reg __fpu_stmm3;
850 struct __darwin_mmst_reg __fpu_stmm4;
851 struct __darwin_mmst_reg __fpu_stmm5;
852 struct __darwin_mmst_reg __fpu_stmm6;
853 struct __darwin_mmst_reg __fpu_stmm7;
854 struct __darwin_xmm_reg __fpu_xmm0;
855 struct __darwin_xmm_reg __fpu_xmm1;
856 struct __darwin_xmm_reg __fpu_xmm2;
857 struct __darwin_xmm_reg __fpu_xmm3;
858 struct __darwin_xmm_reg __fpu_xmm4;
859 struct __darwin_xmm_reg __fpu_xmm5;
860 struct __darwin_xmm_reg __fpu_xmm6;
861 struct __darwin_xmm_reg __fpu_xmm7;
862 char __fpu_rsrv4[14*16];
863 int __fpu_reserved1;
864};
865# 308 "/usr/include/mach/i386/_structs.h" 3 4
866struct __darwin_i386_exception_state
867{
868    unsigned int __trapno;
869    unsigned int __err;
870    unsigned int __faultvaddr;
871};
872# 326 "/usr/include/mach/i386/_structs.h" 3 4
873struct __darwin_x86_debug_state32
874{
875 unsigned int __dr0;
876 unsigned int __dr1;
877 unsigned int __dr2;
878 unsigned int __dr3;
879 unsigned int __dr4;
880 unsigned int __dr5;
881 unsigned int __dr6;
882 unsigned int __dr7;
883};
884# 358 "/usr/include/mach/i386/_structs.h" 3 4
885struct __darwin_x86_thread_state64
886{
887 __uint64_t __rax;
888 __uint64_t __rbx;
889 __uint64_t __rcx;
890 __uint64_t __rdx;
891 __uint64_t __rdi;
892 __uint64_t __rsi;
893 __uint64_t __rbp;
894 __uint64_t __rsp;
895 __uint64_t __r8;
896 __uint64_t __r9;
897 __uint64_t __r10;
898 __uint64_t __r11;
899 __uint64_t __r12;
900 __uint64_t __r13;
901 __uint64_t __r14;
902 __uint64_t __r15;
903 __uint64_t __rip;
904 __uint64_t __rflags;
905 __uint64_t __cs;
906 __uint64_t __fs;
907 __uint64_t __gs;
908};
909# 413 "/usr/include/mach/i386/_structs.h" 3 4
910struct __darwin_x86_float_state64
911{
912 int __fpu_reserved[2];
913 struct __darwin_fp_control __fpu_fcw;
914 struct __darwin_fp_status __fpu_fsw;
915 __uint8_t __fpu_ftw;
916 __uint8_t __fpu_rsrv1;
917 __uint16_t __fpu_fop;
918
919
920 __uint32_t __fpu_ip;
921 __uint16_t __fpu_cs;
922
923 __uint16_t __fpu_rsrv2;
924
925
926 __uint32_t __fpu_dp;
927 __uint16_t __fpu_ds;
928
929 __uint16_t __fpu_rsrv3;
930 __uint32_t __fpu_mxcsr;
931 __uint32_t __fpu_mxcsrmask;
932 struct __darwin_mmst_reg __fpu_stmm0;
933 struct __darwin_mmst_reg __fpu_stmm1;
934 struct __darwin_mmst_reg __fpu_stmm2;
935 struct __darwin_mmst_reg __fpu_stmm3;
936 struct __darwin_mmst_reg __fpu_stmm4;
937 struct __darwin_mmst_reg __fpu_stmm5;
938 struct __darwin_mmst_reg __fpu_stmm6;
939 struct __darwin_mmst_reg __fpu_stmm7;
940 struct __darwin_xmm_reg __fpu_xmm0;
941 struct __darwin_xmm_reg __fpu_xmm1;
942 struct __darwin_xmm_reg __fpu_xmm2;
943 struct __darwin_xmm_reg __fpu_xmm3;
944 struct __darwin_xmm_reg __fpu_xmm4;
945 struct __darwin_xmm_reg __fpu_xmm5;
946 struct __darwin_xmm_reg __fpu_xmm6;
947 struct __darwin_xmm_reg __fpu_xmm7;
948 struct __darwin_xmm_reg __fpu_xmm8;
949 struct __darwin_xmm_reg __fpu_xmm9;
950 struct __darwin_xmm_reg __fpu_xmm10;
951 struct __darwin_xmm_reg __fpu_xmm11;
952 struct __darwin_xmm_reg __fpu_xmm12;
953 struct __darwin_xmm_reg __fpu_xmm13;
954 struct __darwin_xmm_reg __fpu_xmm14;
955 struct __darwin_xmm_reg __fpu_xmm15;
956 char __fpu_rsrv4[6*16];
957 int __fpu_reserved1;
958};
959# 517 "/usr/include/mach/i386/_structs.h" 3 4
960struct __darwin_x86_exception_state64
961{
962    unsigned int __trapno;
963    unsigned int __err;
964    __uint64_t __faultvaddr;
965};
966# 535 "/usr/include/mach/i386/_structs.h" 3 4
967struct __darwin_x86_debug_state64
968{
969 __uint64_t __dr0;
970 __uint64_t __dr1;
971 __uint64_t __dr2;
972 __uint64_t __dr3;
973 __uint64_t __dr4;
974 __uint64_t __dr5;
975 __uint64_t __dr6;
976 __uint64_t __dr7;
977};
978# 71 "/usr/include/mach/i386/thread_status.h" 2 3 4
979# 1 "/usr/include/mach/message.h" 1 3 4
980# 75 "/usr/include/mach/message.h" 3 4
981# 1 "/usr/include/mach/port.h" 1 3 4
982# 106 "/usr/include/mach/port.h" 3 4
983typedef natural_t mach_port_name_t;
984typedef mach_port_name_t *mach_port_name_array_t;
985# 128 "/usr/include/mach/port.h" 3 4
986typedef mach_port_name_t mach_port_t;
987
988
989
990typedef mach_port_t *mach_port_array_t;
991# 190 "/usr/include/mach/port.h" 3 4
992typedef natural_t mach_port_right_t;
993# 200 "/usr/include/mach/port.h" 3 4
994typedef natural_t mach_port_type_t;
995typedef mach_port_type_t *mach_port_type_array_t;
996# 233 "/usr/include/mach/port.h" 3 4
997typedef natural_t mach_port_urefs_t;
998typedef integer_t mach_port_delta_t;
999
1000
1001
1002typedef natural_t mach_port_seqno_t;
1003typedef natural_t mach_port_mscount_t;
1004typedef natural_t mach_port_msgcount_t;
1005typedef natural_t mach_port_rights_t;
1006
1007
1008
1009
1010
1011
1012typedef unsigned int mach_port_srights_t;
1013
1014typedef struct mach_port_status {
1015 mach_port_rights_t mps_pset;
1016 mach_port_seqno_t mps_seqno;
1017 mach_port_mscount_t mps_mscount;
1018 mach_port_msgcount_t mps_qlimit;
1019 mach_port_msgcount_t mps_msgcount;
1020 mach_port_rights_t mps_sorights;
1021 boolean_t mps_srights;
1022 boolean_t mps_pdrequest;
1023 boolean_t mps_nsrequest;
1024 natural_t mps_flags;
1025} mach_port_status_t;
1026# 273 "/usr/include/mach/port.h" 3 4
1027typedef struct mach_port_limits {
1028 mach_port_msgcount_t mpl_qlimit;
1029} mach_port_limits_t;
1030
1031typedef integer_t *mach_port_info_t;
1032
1033
1034typedef int mach_port_flavor_t;
1035# 295 "/usr/include/mach/port.h" 3 4
1036typedef struct mach_port_qos {
1037 unsigned int name:1;
1038 unsigned int prealloc:1;
1039 boolean_t pad1:30;
1040 natural_t len;
1041} mach_port_qos_t;
1042# 76 "/usr/include/mach/message.h" 2 3 4
1043
1044# 1 "/usr/include/mach/kern_return.h" 1 3 4
1045# 70 "/usr/include/mach/kern_return.h" 3 4
1046# 1 "/usr/include/mach/machine/kern_return.h" 1 3 4
1047# 35 "/usr/include/mach/machine/kern_return.h" 3 4
1048# 1 "/usr/include/mach/i386/kern_return.h" 1 3 4
1049# 71 "/usr/include/mach/i386/kern_return.h" 3 4
1050typedef int kern_return_t;
1051# 36 "/usr/include/mach/machine/kern_return.h" 2 3 4
1052# 71 "/usr/include/mach/kern_return.h" 2 3 4
1053# 78 "/usr/include/mach/message.h" 2 3 4
1054# 89 "/usr/include/mach/message.h" 3 4
1055typedef natural_t mach_msg_timeout_t;
1056# 172 "/usr/include/mach/message.h" 3 4
1057typedef unsigned int mach_msg_bits_t;
1058typedef natural_t mach_msg_size_t;
1059typedef integer_t mach_msg_id_t;
1060
1061
1062
1063
1064typedef unsigned int mach_msg_type_name_t;
1065# 189 "/usr/include/mach/message.h" 3 4
1066typedef unsigned int mach_msg_copy_options_t;
1067# 211 "/usr/include/mach/message.h" 3 4
1068typedef unsigned int mach_msg_descriptor_type_t;
1069
1070
1071
1072
1073
1074
1075#pragma pack(4)
1076
1077typedef struct
1078{
1079  natural_t pad1;
1080  mach_msg_size_t pad2;
1081  unsigned int pad3 : 24;
1082  mach_msg_descriptor_type_t type : 8;
1083} mach_msg_type_descriptor_t;
1084
1085typedef struct
1086{
1087  mach_port_t name;
1088
1089
1090  mach_msg_size_t pad1;
1091
1092  unsigned int pad2 : 16;
1093  mach_msg_type_name_t disposition : 8;
1094  mach_msg_descriptor_type_t type : 8;
1095} mach_msg_port_descriptor_t;
1096
1097typedef struct
1098{
1099  uint32_t address;
1100  mach_msg_size_t size;
1101  boolean_t deallocate: 8;
1102  mach_msg_copy_options_t copy: 8;
1103  unsigned int pad1: 8;
1104  mach_msg_descriptor_type_t type: 8;
1105} mach_msg_ool_descriptor32_t;
1106
1107typedef struct
1108{
1109  uint64_t address;
1110  boolean_t deallocate: 8;
1111  mach_msg_copy_options_t copy: 8;
1112  unsigned int pad1: 8;
1113  mach_msg_descriptor_type_t type: 8;
1114  mach_msg_size_t size;
1115} mach_msg_ool_descriptor64_t;
1116
1117typedef struct
1118{
1119  void* address;
1120
1121
1122
1123  boolean_t deallocate: 8;
1124  mach_msg_copy_options_t copy: 8;
1125  unsigned int pad1: 8;
1126  mach_msg_descriptor_type_t type: 8;
1127
1128  mach_msg_size_t size;
1129
1130
1131
1132
1133} mach_msg_ool_descriptor_t;
1134
1135typedef struct
1136{
1137  uint32_t address;
1138  mach_msg_size_t count;
1139  boolean_t deallocate: 8;
1140  mach_msg_copy_options_t copy: 8;
1141  mach_msg_type_name_t disposition : 8;
1142  mach_msg_descriptor_type_t type : 8;
1143} mach_msg_ool_ports_descriptor32_t;
1144
1145typedef struct
1146{
1147  uint64_t address;
1148  boolean_t deallocate: 8;
1149  mach_msg_copy_options_t copy: 8;
1150  mach_msg_type_name_t disposition : 8;
1151  mach_msg_descriptor_type_t type : 8;
1152  mach_msg_size_t count;
1153} mach_msg_ool_ports_descriptor64_t;
1154
1155typedef struct
1156{
1157  void* address;
1158
1159
1160
1161  boolean_t deallocate: 8;
1162  mach_msg_copy_options_t copy: 8;
1163  mach_msg_type_name_t disposition : 8;
1164  mach_msg_descriptor_type_t type : 8;
1165
1166  mach_msg_size_t count;
1167
1168
1169
1170
1171} mach_msg_ool_ports_descriptor_t;
1172# 330 "/usr/include/mach/message.h" 3 4
1173typedef union
1174{
1175  mach_msg_port_descriptor_t port;
1176  mach_msg_ool_descriptor_t out_of_line;
1177  mach_msg_ool_ports_descriptor_t ool_ports;
1178  mach_msg_type_descriptor_t type;
1179} mach_msg_descriptor_t;
1180
1181
1182typedef struct
1183{
1184        mach_msg_size_t msgh_descriptor_count;
1185} mach_msg_body_t;
1186
1187
1188
1189
1190typedef struct
1191{
1192  mach_msg_bits_t msgh_bits;
1193  mach_msg_size_t msgh_size;
1194  mach_port_t msgh_remote_port;
1195  mach_port_t msgh_local_port;
1196  mach_msg_size_t msgh_reserved;
1197  mach_msg_id_t msgh_id;
1198} mach_msg_header_t;
1199
1200
1201
1202typedef struct
1203{
1204        mach_msg_header_t header;
1205        mach_msg_body_t body;
1206} mach_msg_base_t;
1207
1208typedef unsigned int mach_msg_trailer_type_t;
1209
1210
1211
1212typedef unsigned int mach_msg_trailer_size_t;
1213
1214typedef struct
1215{
1216  mach_msg_trailer_type_t msgh_trailer_type;
1217  mach_msg_trailer_size_t msgh_trailer_size;
1218} mach_msg_trailer_t;
1219
1220typedef struct
1221{
1222  mach_msg_trailer_type_t msgh_trailer_type;
1223  mach_msg_trailer_size_t msgh_trailer_size;
1224  mach_port_seqno_t msgh_seqno;
1225} mach_msg_seqno_trailer_t;
1226
1227typedef struct
1228{
1229  unsigned int val[2];
1230} security_token_t;
1231
1232typedef struct
1233{
1234  mach_msg_trailer_type_t msgh_trailer_type;
1235  mach_msg_trailer_size_t msgh_trailer_size;
1236  mach_port_seqno_t msgh_seqno;
1237  security_token_t msgh_sender;
1238} mach_msg_security_trailer_t;
1239# 406 "/usr/include/mach/message.h" 3 4
1240typedef struct
1241{
1242  unsigned int val[8];
1243} audit_token_t;
1244
1245typedef struct
1246{
1247  mach_msg_trailer_type_t msgh_trailer_type;
1248  mach_msg_trailer_size_t msgh_trailer_size;
1249  mach_port_seqno_t msgh_seqno;
1250  security_token_t msgh_sender;
1251  audit_token_t msgh_audit;
1252} mach_msg_audit_trailer_t;
1253
1254typedef struct
1255{
1256  mach_msg_trailer_type_t msgh_trailer_type;
1257  mach_msg_trailer_size_t msgh_trailer_size;
1258  mach_port_seqno_t msgh_seqno;
1259  security_token_t msgh_sender;
1260  audit_token_t msgh_audit;
1261  mach_vm_address_t msgh_context;
1262} mach_msg_context_trailer_t;
1263
1264
1265typedef struct
1266{
1267  mach_port_name_t sender;
1268} msg_labels_t;
1269
1270
1271
1272
1273
1274
1275typedef struct
1276{
1277  mach_msg_trailer_type_t msgh_trailer_type;
1278  mach_msg_trailer_size_t msgh_trailer_size;
1279  mach_port_seqno_t msgh_seqno;
1280  security_token_t msgh_sender;
1281  audit_token_t msgh_audit;
1282  mach_vm_address_t msgh_context;
1283  int msgh_ad;
1284  msg_labels_t msgh_labels;
1285} mach_msg_mac_trailer_t;
1286# 464 "/usr/include/mach/message.h" 3 4
1287typedef mach_msg_mac_trailer_t mach_msg_max_trailer_t;
1288# 474 "/usr/include/mach/message.h" 3 4
1289typedef mach_msg_security_trailer_t mach_msg_format_0_trailer_t;
1290
1291
1292
1293
1294
1295
1296
1297extern security_token_t KERNEL_SECURITY_TOKEN;
1298
1299
1300extern audit_token_t KERNEL_AUDIT_TOKEN;
1301
1302typedef integer_t mach_msg_options_t;
1303
1304typedef struct
1305{
1306  mach_msg_header_t header;
1307} mach_msg_empty_send_t;
1308
1309typedef struct
1310{
1311  mach_msg_header_t header;
1312  mach_msg_trailer_t trailer;
1313} mach_msg_empty_rcv_t;
1314
1315typedef union
1316{
1317  mach_msg_empty_send_t send;
1318  mach_msg_empty_rcv_t rcv;
1319} mach_msg_empty_t;
1320
1321#pragma pack()
1322# 527 "/usr/include/mach/message.h" 3 4
1323typedef natural_t mach_msg_type_size_t;
1324typedef natural_t mach_msg_type_number_t;
1325# 571 "/usr/include/mach/message.h" 3 4
1326typedef integer_t mach_msg_option_t;
1327# 648 "/usr/include/mach/message.h" 3 4
1328typedef kern_return_t mach_msg_return_t;
1329# 731 "/usr/include/mach/message.h" 3 4
1330
1331# 750 "/usr/include/mach/message.h" 3 4
1332extern mach_msg_return_t mach_msg_overwrite(
1333     mach_msg_header_t *msg,
1334     mach_msg_option_t option,
1335     mach_msg_size_t send_size,
1336     mach_msg_size_t rcv_size,
1337     mach_port_name_t rcv_name,
1338     mach_msg_timeout_t timeout,
1339     mach_port_name_t notify,
1340     mach_msg_header_t *rcv_msg,
1341     mach_msg_size_t rcv_limit);
1342# 770 "/usr/include/mach/message.h" 3 4
1343extern mach_msg_return_t mach_msg(
1344     mach_msg_header_t *msg,
1345     mach_msg_option_t option,
1346     mach_msg_size_t send_size,
1347     mach_msg_size_t rcv_size,
1348     mach_port_name_t rcv_name,
1349     mach_msg_timeout_t timeout,
1350     mach_port_name_t notify);
1351
1352
1353
1354# 72 "/usr/include/mach/i386/thread_status.h" 2 3 4
1355# 1 "/usr/include/mach/i386/fp_reg.h" 1 3 4
1356# 64 "/usr/include/mach/i386/fp_reg.h" 3 4
1357struct x86_fx_save {
1358        unsigned short fx_control;
1359        unsigned short fx_status;
1360        unsigned char fx_tag;
1361        unsigned char fx_bbz1;
1362        unsigned short fx_opcode;
1363        unsigned int fx_eip;
1364        unsigned short fx_cs;
1365        unsigned short fx_bbz2;
1366        unsigned int fx_dp;
1367        unsigned short fx_ds;
1368        unsigned short fx_bbz3;
1369        unsigned int fx_MXCSR;
1370        unsigned int fx_MXCSR_MASK;
1371        unsigned short fx_reg_word[8][8];
1372        unsigned short fx_XMM_reg[8][16];
1373
1374        unsigned char fx_reserved[16*6];
1375};
1376# 73 "/usr/include/mach/i386/thread_status.h" 2 3 4
1377# 1 "/usr/include/mach/i386/thread_state.h" 1 3 4
1378# 74 "/usr/include/mach/i386/thread_status.h" 2 3 4
1379# 1 "/usr/include/i386/eflags.h" 1 3 4
1380# 75 "/usr/include/mach/i386/thread_status.h" 2 3 4
1381# 141 "/usr/include/mach/i386/thread_status.h" 3 4
1382struct x86_state_hdr {
1383 int flavor;
1384 int count;
1385};
1386typedef struct x86_state_hdr x86_state_hdr_t;
1387# 159 "/usr/include/mach/i386/thread_status.h" 3 4
1388typedef struct __darwin_i386_thread_state i386_thread_state_t;
1389
1390
1391
1392typedef struct __darwin_i386_thread_state x86_thread_state32_t;
1393
1394
1395
1396
1397
1398
1399typedef struct __darwin_i386_float_state i386_float_state_t;
1400
1401
1402
1403typedef struct __darwin_i386_float_state x86_float_state32_t;
1404
1405
1406
1407
1408
1409
1410typedef struct __darwin_i386_exception_state i386_exception_state_t;
1411
1412
1413
1414typedef struct __darwin_i386_exception_state x86_exception_state32_t;
1415
1416
1417
1418
1419
1420typedef struct __darwin_x86_debug_state32 x86_debug_state32_t;
1421
1422
1423
1424
1425
1426typedef struct __darwin_x86_thread_state64 x86_thread_state64_t;
1427
1428
1429
1430typedef struct __darwin_x86_float_state64 x86_float_state64_t;
1431
1432
1433
1434typedef struct __darwin_x86_exception_state64 x86_exception_state64_t;
1435
1436
1437
1438
1439
1440typedef struct __darwin_x86_debug_state64 x86_debug_state64_t;
1441# 220 "/usr/include/mach/i386/thread_status.h" 3 4
1442struct x86_thread_state {
1443 x86_state_hdr_t tsh;
1444 union {
1445     x86_thread_state32_t ts32;
1446     x86_thread_state64_t ts64;
1447 } uts;
1448};
1449
1450struct x86_float_state {
1451 x86_state_hdr_t fsh;
1452 union {
1453  x86_float_state32_t fs32;
1454  x86_float_state64_t fs64;
1455 } ufs;
1456};
1457
1458struct x86_exception_state {
1459 x86_state_hdr_t esh;
1460 union {
1461  x86_exception_state32_t es32;
1462  x86_exception_state64_t es64;
1463 } ues;
1464};
1465
1466struct x86_debug_state {
1467 x86_state_hdr_t dsh;
1468 union {
1469  x86_debug_state32_t ds32;
1470  x86_debug_state64_t ds64;
1471 } uds;
1472};
1473
1474typedef struct x86_thread_state x86_thread_state_t;
1475
1476
1477
1478typedef struct x86_float_state x86_float_state_t;
1479
1480
1481
1482typedef struct x86_exception_state x86_exception_state_t;
1483
1484
1485
1486typedef struct x86_debug_state x86_debug_state_t;
1487# 288 "/usr/include/mach/i386/thread_status.h" 3 4
1488struct x86_seg_load_fault32 {
1489 unsigned int trapno;
1490 unsigned int err;
1491 unsigned int eip;
1492 unsigned int cs;
1493 unsigned int efl;
1494};
1495# 36 "/usr/include/mach/machine/thread_status.h" 2 3 4
1496# 48 "./../include/mach-o/loader.h" 2
1497# 1 "/usr/include/architecture/byte_order.h" 1 3 4
1498# 38 "/usr/include/architecture/byte_order.h" 3 4
1499# 1 "/usr/include/libkern/OSByteOrder.h" 1 3 4
1500# 33 "/usr/include/libkern/OSByteOrder.h" 3 4
1501# 1 "/usr/include/libkern/_OSByteOrder.h" 1 3 4
1502# 66 "/usr/include/libkern/_OSByteOrder.h" 3 4
1503# 1 "/usr/include/libkern/i386/_OSByteOrder.h" 1 3 4
1504# 44 "/usr/include/libkern/i386/_OSByteOrder.h" 3 4
1505static __inline__
1506__uint16_t
1507_OSSwapInt16(
1508    __uint16_t _data
1509)
1510{
1511    return ((_data << 8) | (_data >> 8));
1512}
1513
1514static __inline__
1515__uint32_t
1516_OSSwapInt32(
1517    __uint32_t _data
1518)
1519{
1520
1521
1522
1523    __asm__ ("bswap   %0" : "+r" (_data));
1524    return _data;
1525
1526}
1527# 91 "/usr/include/libkern/i386/_OSByteOrder.h" 3 4
1528static __inline__
1529__uint64_t
1530_OSSwapInt64(
1531    __uint64_t _data
1532)
1533{
1534    __asm__ ("bswap   %0" : "+r" (_data));
1535    return _data;
1536}
1537# 67 "/usr/include/libkern/_OSByteOrder.h" 2 3 4
1538# 34 "/usr/include/libkern/OSByteOrder.h" 2 3 4
1539# 45 "/usr/include/libkern/OSByteOrder.h" 3 4
1540# 1 "/usr/include/libkern/i386/OSByteOrder.h" 1 3 4
1541# 41 "/usr/include/libkern/i386/OSByteOrder.h" 3 4
1542static __inline__
1543uint16_t
1544OSReadSwapInt16(
1545    const volatile void * base,
1546    uintptr_t byteOffset
1547)
1548{
1549    uint16_t result;
1550
1551    result = *(volatile uint16_t *)((uintptr_t)base + byteOffset);
1552    return _OSSwapInt16(result);
1553}
1554
1555static __inline__
1556uint32_t
1557OSReadSwapInt32(
1558    const volatile void * base,
1559    uintptr_t byteOffset
1560)
1561{
1562    uint32_t result;
1563
1564    result = *(volatile uint32_t *)((uintptr_t)base + byteOffset);
1565    return _OSSwapInt32(result);
1566}
1567
1568static __inline__
1569uint64_t
1570OSReadSwapInt64(
1571    const volatile void * base,
1572    uintptr_t byteOffset
1573)
1574{
1575    uint64_t result;
1576
1577    result = *(volatile uint64_t *)((uintptr_t)base + byteOffset);
1578    return _OSSwapInt64(result);
1579}
1580
1581
1582
1583static __inline__
1584void
1585OSWriteSwapInt16(
1586    volatile void * base,
1587    uintptr_t byteOffset,
1588    uint16_t data
1589)
1590{
1591    *(volatile uint16_t *)((uintptr_t)base + byteOffset) = _OSSwapInt16(data);
1592}
1593
1594static __inline__
1595void
1596OSWriteSwapInt32(
1597    volatile void * base,
1598    uintptr_t byteOffset,
1599    uint32_t data
1600)
1601{
1602    *(volatile uint32_t *)((uintptr_t)base + byteOffset) = _OSSwapInt32(data);
1603}
1604
1605static __inline__
1606void
1607OSWriteSwapInt64(
1608    volatile void * base,
1609    uintptr_t byteOffset,
1610    uint64_t data
1611)
1612{
1613    *(volatile uint64_t *)((uintptr_t)base + byteOffset) = _OSSwapInt64(data);
1614}
1615# 46 "/usr/include/libkern/OSByteOrder.h" 2 3 4
1616# 62 "/usr/include/libkern/OSByteOrder.h" 3 4
1617enum {
1618    OSUnknownByteOrder,
1619    OSLittleEndian,
1620    OSBigEndian
1621};
1622
1623static __inline__
1624int32_t
1625OSHostByteOrder(void) {
1626
1627    return OSLittleEndian;
1628
1629
1630
1631
1632
1633}
1634# 91 "/usr/include/libkern/OSByteOrder.h" 3 4
1635static __inline__
1636uint16_t
1637_OSReadInt16(
1638    const volatile void * base,
1639    uintptr_t byteOffset
1640)
1641{
1642    return *(volatile uint16_t *)((uintptr_t)base + byteOffset);
1643}
1644
1645static __inline__
1646uint32_t
1647_OSReadInt32(
1648    const volatile void * base,
1649    uintptr_t byteOffset
1650)
1651{
1652    return *(volatile uint32_t *)((uintptr_t)base + byteOffset);
1653}
1654
1655static __inline__
1656uint64_t
1657_OSReadInt64(
1658    const volatile void * base,
1659    uintptr_t byteOffset
1660)
1661{
1662    return *(volatile uint64_t *)((uintptr_t)base + byteOffset);
1663}
1664
1665
1666
1667static __inline__
1668void
1669_OSWriteInt16(
1670    volatile void * base,
1671    uintptr_t byteOffset,
1672    uint16_t data
1673)
1674{
1675    *(volatile uint16_t *)((uintptr_t)base + byteOffset) = data;
1676}
1677
1678static __inline__
1679void
1680_OSWriteInt32(
1681    volatile void * base,
1682    uintptr_t byteOffset,
1683    uint32_t data
1684)
1685{
1686    *(volatile uint32_t *)((uintptr_t)base + byteOffset) = data;
1687}
1688
1689static __inline__
1690void
1691_OSWriteInt64(
1692    volatile void * base,
1693    uintptr_t byteOffset,
1694    uint64_t data
1695)
1696{
1697    *(volatile uint64_t *)((uintptr_t)base + byteOffset) = data;
1698}
1699# 39 "/usr/include/architecture/byte_order.h" 2 3 4
1700
1701typedef unsigned long NXSwappedFloat;
1702typedef unsigned long long NXSwappedDouble;
1703
1704static __inline__ __attribute__((deprecated))
1705unsigned short
1706NXSwapShort(
1707    unsigned short inv
1708)
1709{
1710    return (unsigned short)(__builtin_constant_p((uint16_t)inv) ? ((__uint16_t)((((__uint16_t)((uint16_t)inv) & 0xff00) >> 8) | (((__uint16_t)((uint16_t)inv) & 0x00ff) << 8))) : _OSSwapInt16((uint16_t)inv));
1711}
1712
1713static __inline__ __attribute__((deprecated))
1714unsigned int
1715NXSwapInt(
1716    unsigned int inv
1717)
1718{
1719    return (unsigned int)(__builtin_constant_p((uint32_t)inv) ? ((__uint32_t)((((__uint32_t)((uint32_t)inv) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)inv) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)inv) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)inv) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)inv));
1720}
1721
1722static __inline__ __attribute__((deprecated))
1723unsigned long
1724NXSwapLong(
1725    unsigned long inv
1726)
1727{
1728    return (unsigned long)(__builtin_constant_p((uint32_t)inv) ? ((__uint32_t)((((__uint32_t)((uint32_t)inv) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)inv) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)inv) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)inv) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)inv));
1729}
1730
1731static __inline__ __attribute__((deprecated))
1732unsigned long long
1733NXSwapLongLong(
1734    unsigned long long inv
1735)
1736{
1737    return (unsigned long long)(__builtin_constant_p((uint64_t)inv) ? ((__uint64_t)((((__uint64_t)((uint64_t)inv) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)((uint64_t)inv) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)((uint64_t)inv) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)((uint64_t)inv) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)((uint64_t)inv) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)((uint64_t)inv) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)((uint64_t)inv) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)((uint64_t)inv) & 0x00000000000000ffULL) << 56))) : _OSSwapInt64((uint64_t)inv));
1738}
1739
1740static __inline__ __attribute__((deprecated))
1741NXSwappedFloat
1742NXConvertHostFloatToSwapped(float x)
1743{
1744    union fconv {
1745        float number;
1746        NXSwappedFloat sf;
1747    } u;
1748    u.number = x;
1749    return u.sf;
1750}
1751
1752static __inline__ __attribute__((deprecated))
1753float
1754NXConvertSwappedFloatToHost(NXSwappedFloat x)
1755{
1756    union fconv {
1757        float number;
1758        NXSwappedFloat sf;
1759    } u;
1760    u.sf = x;
1761    return u.number;
1762}
1763
1764static __inline__ __attribute__((deprecated))
1765NXSwappedDouble
1766NXConvertHostDoubleToSwapped(double x)
1767{
1768    union dconv {
1769        double number;
1770        NXSwappedDouble sd;
1771    } u;
1772    u.number = x;
1773    return u.sd;
1774}
1775
1776static __inline__ __attribute__((deprecated))
1777double
1778NXConvertSwappedDoubleToHost(NXSwappedDouble x)
1779{
1780    union dconv {
1781        double number;
1782        NXSwappedDouble sd;
1783    } u;
1784    u.sd = x;
1785    return u.number;
1786}
1787
1788static __inline__ __attribute__((deprecated))
1789NXSwappedFloat
1790NXSwapFloat(NXSwappedFloat x)
1791{
1792    return (NXSwappedFloat)(__builtin_constant_p((uint32_t)x) ? ((__uint32_t)((((__uint32_t)((uint32_t)x) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)x) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)x) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)x) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)x));
1793}
1794
1795static __inline__ __attribute__((deprecated))
1796NXSwappedDouble
1797NXSwapDouble(NXSwappedDouble x)
1798{
1799    return (NXSwappedDouble)(__builtin_constant_p((uint64_t)x) ? ((__uint64_t)((((__uint64_t)((uint64_t)x) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)((uint64_t)x) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)((uint64_t)x) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)((uint64_t)x) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)((uint64_t)x) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)((uint64_t)x) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)((uint64_t)x) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)((uint64_t)x) & 0x00000000000000ffULL) << 56))) : _OSSwapInt64((uint64_t)x));
1800}
1801
1802
1803
1804
1805
1806
1807enum NXByteOrder {
1808    NX_UnknownByteOrder,
1809    NX_LittleEndian,
1810    NX_BigEndian
1811};
1812
1813static __inline__
1814enum NXByteOrder
1815NXHostByteOrder(void)
1816{
1817
1818    return NX_LittleEndian;
1819
1820
1821
1822
1823
1824}
1825
1826static __inline__ __attribute__((deprecated))
1827unsigned short
1828NXSwapBigShortToHost(
1829    unsigned short x
1830)
1831{
1832    return (unsigned short)(__builtin_constant_p((uint16_t)x) ? ((__uint16_t)((((__uint16_t)((uint16_t)x) & 0xff00) >> 8) | (((__uint16_t)((uint16_t)x) & 0x00ff) << 8))) : _OSSwapInt16((uint16_t)x));
1833}
1834
1835static __inline__ __attribute__((deprecated))
1836unsigned int
1837NXSwapBigIntToHost(
1838    unsigned int x
1839)
1840{
1841    return (unsigned int)(__builtin_constant_p((uint32_t)x) ? ((__uint32_t)((((__uint32_t)((uint32_t)x) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)x) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)x) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)x) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)x));
1842}
1843
1844static __inline__ __attribute__((deprecated))
1845unsigned long
1846NXSwapBigLongToHost(
1847    unsigned long x
1848)
1849{
1850    return (unsigned long)(__builtin_constant_p((uint32_t)x) ? ((__uint32_t)((((__uint32_t)((uint32_t)x) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)x) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)x) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)x) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)x));
1851}
1852
1853static __inline__ __attribute__((deprecated))
1854unsigned long long
1855NXSwapBigLongLongToHost(
1856    unsigned long long x
1857)
1858{
1859    return (unsigned long long)(__builtin_constant_p((uint64_t)x) ? ((__uint64_t)((((__uint64_t)((uint64_t)x) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)((uint64_t)x) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)((uint64_t)x) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)((uint64_t)x) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)((uint64_t)x) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)((uint64_t)x) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)((uint64_t)x) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)((uint64_t)x) & 0x00000000000000ffULL) << 56))) : _OSSwapInt64((uint64_t)x));
1860}
1861
1862static __inline__ __attribute__((deprecated))
1863double
1864NXSwapBigDoubleToHost(
1865    NXSwappedDouble x
1866)
1867{
1868    return NXConvertSwappedDoubleToHost((NXSwappedDouble)(__builtin_constant_p((uint64_t)x) ? ((__uint64_t)((((__uint64_t)((uint64_t)x) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)((uint64_t)x) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)((uint64_t)x) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)((uint64_t)x) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)((uint64_t)x) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)((uint64_t)x) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)((uint64_t)x) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)((uint64_t)x) & 0x00000000000000ffULL) << 56))) : _OSSwapInt64((uint64_t)x)));
1869}
1870
1871static __inline__ __attribute__((deprecated))
1872float
1873NXSwapBigFloatToHost(
1874    NXSwappedFloat x
1875)
1876{
1877    return NXConvertSwappedFloatToHost((NXSwappedFloat)(__builtin_constant_p((uint32_t)x) ? ((__uint32_t)((((__uint32_t)((uint32_t)x) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)x) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)x) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)x) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)x)));
1878}
1879
1880static __inline__ __attribute__((deprecated))
1881unsigned short
1882NXSwapHostShortToBig(
1883    unsigned short x
1884)
1885{
1886    return (unsigned short)(__builtin_constant_p((uint16_t)x) ? ((__uint16_t)((((__uint16_t)((uint16_t)x) & 0xff00) >> 8) | (((__uint16_t)((uint16_t)x) & 0x00ff) << 8))) : _OSSwapInt16((uint16_t)x));
1887}
1888
1889static __inline__ __attribute__((deprecated))
1890unsigned int
1891NXSwapHostIntToBig(
1892    unsigned int x
1893)
1894{
1895    return (unsigned int)(__builtin_constant_p((uint32_t)x) ? ((__uint32_t)((((__uint32_t)((uint32_t)x) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)x) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)x) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)x) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)x));
1896}
1897
1898static __inline__ __attribute__((deprecated))
1899unsigned long
1900NXSwapHostLongToBig(
1901    unsigned long x
1902)
1903{
1904    return (unsigned long)(__builtin_constant_p((uint32_t)x) ? ((__uint32_t)((((__uint32_t)((uint32_t)x) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)x) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)x) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)x) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)x));
1905}
1906
1907static __inline__ __attribute__((deprecated))
1908unsigned long long
1909NXSwapHostLongLongToBig(
1910    unsigned long long x
1911)
1912{
1913    return (unsigned long long)(__builtin_constant_p((uint64_t)x) ? ((__uint64_t)((((__uint64_t)((uint64_t)x) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)((uint64_t)x) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)((uint64_t)x) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)((uint64_t)x) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)((uint64_t)x) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)((uint64_t)x) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)((uint64_t)x) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)((uint64_t)x) & 0x00000000000000ffULL) << 56))) : _OSSwapInt64((uint64_t)x));
1914}
1915
1916static __inline__ __attribute__((deprecated))
1917NXSwappedDouble
1918NXSwapHostDoubleToBig(
1919    double x
1920)
1921{
1922    return (NXSwappedDouble)(__builtin_constant_p((uint64_t)NXConvertHostDoubleToSwapped(x)) ? ((__uint64_t)((((__uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)) & 0x00000000000000ffULL) << 56))) : _OSSwapInt64((uint64_t)NXConvertHostDoubleToSwapped(x)));
1923}
1924
1925static __inline__ __attribute__((deprecated))
1926NXSwappedFloat
1927NXSwapHostFloatToBig(
1928    float x
1929)
1930{
1931    return (NXSwappedFloat)(__builtin_constant_p((uint32_t)NXConvertHostFloatToSwapped(x)) ? ((__uint32_t)((((__uint32_t)((uint32_t)NXConvertHostFloatToSwapped(x)) & 0xff000000) >> 24) | (((__uint32_t)((uint32_t)NXConvertHostFloatToSwapped(x)) & 0x00ff0000) >> 8) | (((__uint32_t)((uint32_t)NXConvertHostFloatToSwapped(x)) & 0x0000ff00) << 8) | (((__uint32_t)((uint32_t)NXConvertHostFloatToSwapped(x)) & 0x000000ff) << 24))) : _OSSwapInt32((uint32_t)NXConvertHostFloatToSwapped(x)));
1932}
1933
1934static __inline__ __attribute__((deprecated))
1935unsigned short
1936NXSwapLittleShortToHost(
1937    unsigned short x
1938)
1939{
1940    return (unsigned short)((uint16_t)((uint16_t)x));
1941}
1942
1943static __inline__ __attribute__((deprecated))
1944unsigned int
1945NXSwapLittleIntToHost(
1946    unsigned int x
1947)
1948{
1949    return (unsigned int)((uint32_t)((uint32_t)x));
1950}
1951
1952static __inline__ __attribute__((deprecated))
1953unsigned long
1954NXSwapLittleLongToHost(
1955    unsigned long x
1956)
1957{
1958    return (unsigned long)((uint32_t)((uint32_t)x));
1959}
1960
1961static __inline__ __attribute__((deprecated))
1962unsigned long long
1963NXSwapLittleLongLongToHost(
1964    unsigned long long x
1965)
1966{
1967    return (unsigned long long)((uint64_t)((uint64_t)x));
1968}
1969
1970static __inline__ __attribute__((deprecated))
1971double
1972NXSwapLittleDoubleToHost(
1973    NXSwappedDouble x
1974)
1975{
1976    return NXConvertSwappedDoubleToHost((NXSwappedDouble)((uint64_t)((uint64_t)x)));
1977}
1978
1979static __inline__ __attribute__((deprecated))
1980float
1981NXSwapLittleFloatToHost(
1982    NXSwappedFloat x
1983)
1984{
1985    return NXConvertSwappedFloatToHost((NXSwappedFloat)((uint32_t)((uint32_t)x)));
1986}
1987
1988static __inline__ __attribute__((deprecated))
1989unsigned short
1990NXSwapHostShortToLittle(
1991    unsigned short x
1992)
1993{
1994    return (unsigned short)((uint16_t)((uint16_t)x));
1995}
1996
1997static __inline__ __attribute__((deprecated))
1998unsigned int
1999NXSwapHostIntToLittle(
2000    unsigned int x
2001)
2002{
2003    return (unsigned int)((uint32_t)((uint32_t)x));
2004}
2005
2006static __inline__ __attribute__((deprecated))
2007unsigned long
2008NXSwapHostLongToLittle(
2009    unsigned long x
2010)
2011{
2012    return (unsigned long)((uint32_t)((uint32_t)x));
2013}
2014
2015static __inline__ __attribute__((deprecated))
2016unsigned long long
2017NXSwapHostLongLongToLittle(
2018    unsigned long long x
2019)
2020{
2021    return (unsigned long long)((uint64_t)((uint64_t)x));
2022}
2023
2024static __inline__ __attribute__((deprecated))
2025NXSwappedDouble
2026NXSwapHostDoubleToLittle(
2027    double x
2028)
2029{
2030    return (NXSwappedDouble)((uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x)));
2031}
2032
2033static __inline__ __attribute__((deprecated))
2034NXSwappedFloat
2035NXSwapHostFloatToLittle(
2036    float x
2037)
2038{
2039    return (NXSwappedFloat)((uint32_t)((uint32_t)NXConvertHostFloatToSwapped(x)));
2040}
2041# 49 "./../include/mach-o/loader.h" 2
2042
2043
2044
2045
2046
2047struct mach_header {
2048 uint32_t magic;
2049 cpu_type_t cputype;
2050 cpu_subtype_t cpusubtype;
2051 uint32_t filetype;
2052 uint32_t ncmds;
2053 uint32_t sizeofcmds;
2054 uint32_t flags;
2055};
2056# 72 "./../include/mach-o/loader.h"
2057struct mach_header_64 {
2058 uint32_t magic;
2059 cpu_type_t cputype;
2060 cpu_subtype_t cpusubtype;
2061 uint32_t filetype;
2062 uint32_t ncmds;
2063 uint32_t sizeofcmds;
2064 uint32_t flags;
2065 uint32_t reserved;
2066};
2067# 227 "./../include/mach-o/loader.h"
2068struct load_command {
2069 uint32_t cmd;
2070 uint32_t cmdsize;
2071};
2072# 307 "./../include/mach-o/loader.h"
2073union lc_str {
2074 uint32_t offset;
2075
2076
2077
2078};
2079# 326 "./../include/mach-o/loader.h"
2080struct segment_command {
2081 uint32_t cmd;
2082 uint32_t cmdsize;
2083 char segname[16];
2084 uint32_t vmaddr;
2085 uint32_t vmsize;
2086 uint32_t fileoff;
2087 uint32_t filesize;
2088 vm_prot_t maxprot;
2089 vm_prot_t initprot;
2090 uint32_t nsects;
2091 uint32_t flags;
2092};
2093
2094
2095
2096
2097
2098
2099
2100struct segment_command_64 {
2101 uint32_t cmd;
2102 uint32_t cmdsize;
2103 char segname[16];
2104 uint64_t vmaddr;
2105 uint64_t vmsize;
2106 uint64_t fileoff;
2107 uint64_t filesize;
2108 vm_prot_t maxprot;
2109 vm_prot_t initprot;
2110 uint32_t nsects;
2111 uint32_t flags;
2112};
2113# 403 "./../include/mach-o/loader.h"
2114struct section {
2115 char sectname[16];
2116 char segname[16];
2117 uint32_t addr;
2118 uint32_t size;
2119 uint32_t offset;
2120 uint32_t align;
2121 uint32_t reloff;
2122 uint32_t nreloc;
2123 uint32_t flags;
2124 uint32_t reserved1;
2125 uint32_t reserved2;
2126};
2127
2128struct section_64 {
2129 char sectname[16];
2130 char segname[16];
2131 uint64_t addr;
2132 uint64_t size;
2133 uint32_t offset;
2134 uint32_t align;
2135 uint32_t reloff;
2136 uint32_t nreloc;
2137 uint32_t flags;
2138 uint32_t reserved1;
2139 uint32_t reserved2;
2140 uint32_t reserved3;
2141};
2142# 605 "./../include/mach-o/loader.h"
2143struct fvmlib {
2144 union lc_str name;
2145 uint32_t minor_version;
2146 uint32_t header_addr;
2147};
2148# 618 "./../include/mach-o/loader.h"
2149struct fvmlib_command {
2150 uint32_t cmd;
2151 uint32_t cmdsize;
2152 struct fvmlib fvmlib;
2153};
2154# 633 "./../include/mach-o/loader.h"
2155struct dylib {
2156    union lc_str name;
2157    uint32_t timestamp;
2158    uint32_t current_version;
2159    uint32_t compatibility_version;
2160};
2161# 647 "./../include/mach-o/loader.h"
2162struct dylib_command {
2163 uint32_t cmd;
2164
2165 uint32_t cmdsize;
2166 struct dylib dylib;
2167};
2168# 664 "./../include/mach-o/loader.h"
2169struct sub_framework_command {
2170 uint32_t cmd;
2171 uint32_t cmdsize;
2172 union lc_str umbrella;
2173};
2174# 679 "./../include/mach-o/loader.h"
2175struct sub_client_command {
2176 uint32_t cmd;
2177 uint32_t cmdsize;
2178 union lc_str client;
2179};
2180# 698 "./../include/mach-o/loader.h"
2181struct sub_umbrella_command {
2182 uint32_t cmd;
2183 uint32_t cmdsize;
2184 union lc_str sub_umbrella;
2185};
2186# 719 "./../include/mach-o/loader.h"
2187struct sub_library_command {
2188 uint32_t cmd;
2189 uint32_t cmdsize;
2190 union lc_str sub_library;
2191};
2192# 734 "./../include/mach-o/loader.h"
2193struct prebound_dylib_command {
2194 uint32_t cmd;
2195 uint32_t cmdsize;
2196 union lc_str name;
2197 uint32_t nmodules;
2198 union lc_str linked_modules;
2199};
2200# 750 "./../include/mach-o/loader.h"
2201struct dylinker_command {
2202 uint32_t cmd;
2203
2204 uint32_t cmdsize;
2205 union lc_str name;
2206};
2207# 778 "./../include/mach-o/loader.h"
2208struct thread_command {
2209 uint32_t cmd;
2210 uint32_t cmdsize;
2211
2212
2213
2214
2215};
2216# 795 "./../include/mach-o/loader.h"
2217struct routines_command {
2218 uint32_t cmd;
2219 uint32_t cmdsize;
2220 uint32_t init_address;
2221 uint32_t init_module;
2222
2223 uint32_t reserved1;
2224 uint32_t reserved2;
2225 uint32_t reserved3;
2226 uint32_t reserved4;
2227 uint32_t reserved5;
2228 uint32_t reserved6;
2229};
2230
2231
2232
2233
2234struct routines_command_64 {
2235 uint32_t cmd;
2236 uint32_t cmdsize;
2237 uint64_t init_address;
2238 uint64_t init_module;
2239
2240 uint64_t reserved1;
2241 uint64_t reserved2;
2242 uint64_t reserved3;
2243 uint64_t reserved4;
2244 uint64_t reserved5;
2245 uint64_t reserved6;
2246};
2247
2248
2249
2250
2251
2252
2253struct symtab_command {
2254 uint32_t cmd;
2255 uint32_t cmdsize;
2256 uint32_t symoff;
2257 uint32_t nsyms;
2258 uint32_t stroff;
2259 uint32_t strsize;
2260};
2261# 880 "./../include/mach-o/loader.h"
2262struct dysymtab_command {
2263    uint32_t cmd;
2264    uint32_t cmdsize;
2265# 899 "./../include/mach-o/loader.h"
2266    uint32_t ilocalsym;
2267    uint32_t nlocalsym;
2268
2269    uint32_t iextdefsym;
2270    uint32_t nextdefsym;
2271
2272    uint32_t iundefsym;
2273    uint32_t nundefsym;
2274# 916 "./../include/mach-o/loader.h"
2275    uint32_t tocoff;
2276    uint32_t ntoc;
2277# 928 "./../include/mach-o/loader.h"
2278    uint32_t modtaboff;
2279    uint32_t nmodtab;
2280# 940 "./../include/mach-o/loader.h"
2281    uint32_t extrefsymoff;
2282    uint32_t nextrefsyms;
2283# 953 "./../include/mach-o/loader.h"
2284    uint32_t indirectsymoff;
2285    uint32_t nindirectsyms;
2286# 983 "./../include/mach-o/loader.h"
2287    uint32_t extreloff;
2288    uint32_t nextrel;
2289
2290
2291
2292
2293
2294
2295    uint32_t locreloff;
2296    uint32_t nlocrel;
2297
2298};
2299# 1008 "./../include/mach-o/loader.h"
2300struct dylib_table_of_contents {
2301    uint32_t symbol_index;
2302
2303    uint32_t module_index;
2304
2305};
2306
2307
2308struct dylib_module {
2309    uint32_t module_name;
2310
2311    uint32_t iextdefsym;
2312    uint32_t nextdefsym;
2313    uint32_t irefsym;
2314    uint32_t nrefsym;
2315    uint32_t ilocalsym;
2316    uint32_t nlocalsym;
2317
2318    uint32_t iextrel;
2319    uint32_t nextrel;
2320
2321    uint32_t iinit_iterm;
2322
2323
2324    uint32_t ninit_nterm;
2325
2326
2327
2328    uint32_t
2329 objc_module_info_addr;
2330    uint32_t
2331 objc_module_info_size;
2332};
2333
2334
2335struct dylib_module_64 {
2336    uint32_t module_name;
2337
2338    uint32_t iextdefsym;
2339    uint32_t nextdefsym;
2340    uint32_t irefsym;
2341    uint32_t nrefsym;
2342    uint32_t ilocalsym;
2343    uint32_t nlocalsym;
2344
2345    uint32_t iextrel;
2346    uint32_t nextrel;
2347
2348    uint32_t iinit_iterm;
2349
2350
2351    uint32_t ninit_nterm;
2352
2353
2354
2355    uint32_t
2356        objc_module_info_size;
2357    uint64_t
2358        objc_module_info_addr;
2359};
2360# 1077 "./../include/mach-o/loader.h"
2361struct dylib_reference {
2362    uint32_t isym:24,
2363        flags:8;
2364};
2365
2366
2367
2368
2369
2370struct twolevel_hints_command {
2371    uint32_t cmd;
2372    uint32_t cmdsize;
2373    uint32_t offset;
2374    uint32_t nhints;
2375};
2376# 1109 "./../include/mach-o/loader.h"
2377struct twolevel_hint {
2378    uint32_t
2379 isub_image:8,
2380 itoc:24;
2381};
2382# 1125 "./../include/mach-o/loader.h"
2383struct prebind_cksum_command {
2384    uint32_t cmd;
2385    uint32_t cmdsize;
2386    uint32_t cksum;
2387};
2388
2389
2390
2391
2392
2393struct uuid_command {
2394    uint32_t cmd;
2395    uint32_t cmdsize;
2396    uint8_t uuid[16];
2397};
2398
2399
2400
2401
2402
2403struct rpath_command {
2404    uint32_t cmd;
2405    uint32_t cmdsize;
2406    union lc_str path;
2407};
2408
2409
2410
2411
2412
2413struct linkedit_data_command {
2414    uint32_t cmd;
2415
2416
2417    uint32_t cmdsize;
2418    uint32_t dataoff;
2419    uint32_t datasize;
2420};
2421
2422
2423
2424
2425
2426struct encryption_info_command {
2427   uint32_t cmd;
2428   uint32_t cmdsize;
2429   uint32_t cryptoff;
2430   uint32_t cryptsize;
2431   uint32_t cryptid;
2432
2433};
2434
2435
2436
2437
2438
2439struct version_min_command {
2440    uint32_t cmd;
2441
2442    uint32_t cmdsize;
2443    uint32_t version;
2444    uint32_t sdk;
2445};
2446# 1197 "./../include/mach-o/loader.h"
2447struct dyld_info_command {
2448   uint32_t cmd;
2449   uint32_t cmdsize;
2450# 1212 "./../include/mach-o/loader.h"
2451    uint32_t rebase_off;
2452    uint32_t rebase_size;
2453# 1227 "./../include/mach-o/loader.h"
2454    uint32_t bind_off;
2455    uint32_t bind_size;
2456# 1245 "./../include/mach-o/loader.h"
2457    uint32_t weak_bind_off;
2458    uint32_t weak_bind_size;
2459# 1260 "./../include/mach-o/loader.h"
2460    uint32_t lazy_bind_off;
2461    uint32_t lazy_bind_size;
2462# 1296 "./../include/mach-o/loader.h"
2463    uint32_t export_off;
2464    uint32_t export_size;
2465};
2466# 1371 "./../include/mach-o/loader.h"
2467struct symseg_command {
2468 uint32_t cmd;
2469 uint32_t cmdsize;
2470 uint32_t offset;
2471 uint32_t size;
2472};
2473
2474
2475
2476
2477
2478
2479
2480struct ident_command {
2481 uint32_t cmd;
2482 uint32_t cmdsize;
2483};
2484
2485
2486
2487
2488
2489
2490
2491struct fvmfile_command {
2492 uint32_t cmd;
2493 uint32_t cmdsize;
2494 union lc_str name;
2495 uint32_t header_addr;
2496};
2497# 1409 "./../include/mach-o/loader.h"
2498struct entry_point_command {
2499    uint32_t cmd;
2500    uint32_t cmdsize;
2501    uint64_t entryoff;
2502    uint64_t stacksize;
2503};
2504
2505
2506
2507
2508
2509
2510struct source_version_command {
2511    uint32_t cmd;
2512    uint32_t cmdsize;
2513    uint64_t version;
2514};
2515# 1434 "./../include/mach-o/loader.h"
2516struct data_in_code_entry {
2517    uint32_t offset;
2518    uint16_t length;
2519    uint16_t kind;
2520};
2521# 1451 "./../include/mach-o/loader.h"
2522struct tlv_descriptor
2523{
2524 void* (*thunk)(struct tlv_descriptor*);
2525 unsigned long key;
2526 unsigned long offset;
2527};
2528# 34 "print_objc.c" 2
2529# 1 "/usr/include/objc/objc-runtime.h" 1 3 4
2530# 1 "/opt/local/include/objc/runtime.h" 1 3 4
2531# 29 "/opt/local/include/objc/runtime.h" 3 4
2532# 1 "/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/stdarg.h" 1 3 4
2533# 43 "/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/stdarg.h" 3 4
2534typedef __builtin_va_list __gnuc_va_list;
2535# 30 "/opt/local/include/objc/runtime.h" 2 3 4
2536
2537# 1 "/usr/include/stdio.h" 1 3 4
2538# 32 "/opt/local/include/objc/runtime.h" 2 3 4
2539# 1 "/usr/include/ctype.h" 1 3 4
2540# 69 "/usr/include/ctype.h" 3 4
2541# 1 "/usr/include/runetype.h" 1 3 4
2542# 53 "/usr/include/runetype.h" 3 4
2543typedef __darwin_ct_rune_t ct_rune_t;
2544
2545
2546
2547
2548typedef __darwin_rune_t rune_t;
2549
2550
2551
2552
2553
2554typedef __darwin_wchar_t wchar_t;
2555
2556
2557
2558
2559
2560typedef __darwin_wint_t wint_t;
2561# 81 "/usr/include/runetype.h" 3 4
2562typedef struct {
2563 __darwin_rune_t __min;
2564 __darwin_rune_t __max;
2565 __darwin_rune_t __map;
2566 __uint32_t *__types;
2567} _RuneEntry;
2568
2569typedef struct {
2570 int __nranges;
2571 _RuneEntry *__ranges;
2572} _RuneRange;
2573
2574typedef struct {
2575 char __name[14];
2576 __uint32_t __mask;
2577} _RuneCharClass;
2578
2579typedef struct {
2580 char __magic[8];
2581 char __encoding[32];
2582
2583 __darwin_rune_t (*__sgetrune)(const char *, __darwin_size_t, char const **);
2584 int (*__sputrune)(__darwin_rune_t, char *, __darwin_size_t, char **);
2585 __darwin_rune_t __invalid_rune;
2586
2587 __uint32_t __runetype[(1 <<8 )];
2588 __darwin_rune_t __maplower[(1 <<8 )];
2589 __darwin_rune_t __mapupper[(1 <<8 )];
2590
2591
2592
2593
2594
2595
2596 _RuneRange __runetype_ext;
2597 _RuneRange __maplower_ext;
2598 _RuneRange __mapupper_ext;
2599
2600 void *__variable;
2601 int __variable_len;
2602
2603
2604
2605
2606 int __ncharclasses;
2607 _RuneCharClass *__charclasses;
2608} _RuneLocale;
2609
2610
2611
2612
2613extern _RuneLocale _DefaultRuneLocale;
2614extern _RuneLocale *_CurrentRuneLocale;
2615
2616# 70 "/usr/include/ctype.h" 2 3 4
2617# 145 "/usr/include/ctype.h" 3 4
2618
2619unsigned long ___runetype(__darwin_ct_rune_t);
2620__darwin_ct_rune_t ___tolower(__darwin_ct_rune_t);
2621__darwin_ct_rune_t ___toupper(__darwin_ct_rune_t);
2622
2623
2624static __inline int
2625isascii(int _c)
2626{
2627 return ((_c & ~0x7F) == 0);
2628}
2629# 164 "/usr/include/ctype.h" 3 4
2630
2631int __maskrune(__darwin_ct_rune_t, unsigned long);
2632
2633
2634
2635static __inline int
2636__istype(__darwin_ct_rune_t _c, unsigned long _f)
2637{
2638
2639
2640
2641 return (isascii(_c) ? !!(_DefaultRuneLocale.__runetype[_c] & _f)
2642  : !!__maskrune(_c, _f));
2643
2644}
2645
2646static __inline __darwin_ct_rune_t
2647__isctype(__darwin_ct_rune_t _c, unsigned long _f)
2648{
2649
2650
2651
2652 return (_c < 0 || _c >= (1 <<8 )) ? 0 :
2653  !!(_DefaultRuneLocale.__runetype[_c] & _f);
2654
2655}
2656# 204 "/usr/include/ctype.h" 3 4
2657
2658__darwin_ct_rune_t __toupper(__darwin_ct_rune_t);
2659__darwin_ct_rune_t __tolower(__darwin_ct_rune_t);
2660
2661
2662
2663static __inline int
2664__wcwidth(__darwin_ct_rune_t _c)
2665{
2666 unsigned int _x;
2667
2668 if (_c == 0)
2669  return (0);
2670 _x = (unsigned int)__maskrune(_c, 0xe0000000L|0x00040000L);
2671 if ((_x & 0xe0000000L) != 0)
2672  return ((_x & 0xe0000000L) >> 30);
2673 return ((_x & 0x00040000L) != 0 ? 1 : -1);
2674}
2675
2676
2677
2678
2679
2680
2681static __inline int
2682isalnum(int _c)
2683{
2684 return (__istype(_c, 0x00000100L|0x00000400L));
2685}
2686
2687static __inline int
2688isalpha(int _c)
2689{
2690 return (__istype(_c, 0x00000100L));
2691}
2692
2693static __inline int
2694isblank(int _c)
2695{
2696 return (__istype(_c, 0x00020000L));
2697}
2698
2699static __inline int
2700iscntrl(int _c)
2701{
2702 return (__istype(_c, 0x00000200L));
2703}
2704
2705
2706static __inline int
2707isdigit(int _c)
2708{
2709 return (__isctype(_c, 0x00000400L));
2710}
2711
2712static __inline int
2713isgraph(int _c)
2714{
2715 return (__istype(_c, 0x00000800L));
2716}
2717
2718static __inline int
2719islower(int _c)
2720{
2721 return (__istype(_c, 0x00001000L));
2722}
2723
2724static __inline int
2725isprint(int _c)
2726{
2727 return (__istype(_c, 0x00040000L));
2728}
2729
2730static __inline int
2731ispunct(int _c)
2732{
2733 return (__istype(_c, 0x00002000L));
2734}
2735
2736static __inline int
2737isspace(int _c)
2738{
2739 return (__istype(_c, 0x00004000L));
2740}
2741
2742static __inline int
2743isupper(int _c)
2744{
2745 return (__istype(_c, 0x00008000L));
2746}
2747
2748
2749static __inline int
2750isxdigit(int _c)
2751{
2752 return (__isctype(_c, 0x00010000L));
2753}
2754
2755static __inline int
2756toascii(int _c)
2757{
2758 return (_c & 0x7F);
2759}
2760
2761static __inline int
2762tolower(int _c)
2763{
2764        return (__tolower(_c));
2765}
2766
2767static __inline int
2768toupper(int _c)
2769{
2770        return (__toupper(_c));
2771}
2772
2773
2774static __inline int
2775digittoint(int _c)
2776{
2777 return (__maskrune(_c, 0x0F));
2778}
2779
2780static __inline int
2781ishexnumber(int _c)
2782{
2783 return (__istype(_c, 0x00010000L));
2784}
2785
2786static __inline int
2787isideogram(int _c)
2788{
2789 return (__istype(_c, 0x00080000L));
2790}
2791
2792static __inline int
2793isnumber(int _c)
2794{
2795 return (__istype(_c, 0x00000400L));
2796}
2797
2798static __inline int
2799isphonogram(int _c)
2800{
2801 return (__istype(_c, 0x00200000L));
2802}
2803
2804static __inline int
2805isrune(int _c)
2806{
2807 return (__istype(_c, 0xFFFFFFF0L));
2808}
2809
2810static __inline int
2811isspecial(int _c)
2812{
2813 return (__istype(_c, 0x00100000L));
2814}
2815# 33 "/opt/local/include/objc/runtime.h" 2 3 4
2816
2817# 1 "/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/stddef.h" 1 3 4
2818# 152 "/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/stddef.h" 3 4
2819typedef long int ptrdiff_t;
2820# 35 "/opt/local/include/objc/runtime.h" 2 3 4
2821# 1 "/usr/include/assert.h" 1 3 4
2822# 36 "/opt/local/include/objc/runtime.h" 2 3 4
2823
2824# 1 "/opt/local/include/objc/objc.h" 1 3 4
2825# 34 "/opt/local/include/objc/objc.h" 3 4
2826# 1 "/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/stddef.h" 1 3 4
2827# 35 "/opt/local/include/objc/objc.h" 2 3 4
2828
2829
2830
2831
2832
2833
2834
2835typedef unsigned char BOOL;
2836# 51 "/opt/local/include/objc/objc.h" 3 4
2837typedef const struct objc_selector
2838{
2839  void *sel_id;
2840  const char *sel_types;
2841} *SEL;
2842
2843inline static BOOL
2844sel_eq (SEL s1, SEL s2)
2845{
2846  if (s1 == 0 || s2 == 0)
2847    return s1 == s2;
2848  else
2849    return s1->sel_id == s2->sel_id;
2850}
2851
2852
2853
2854
2855
2856typedef struct objc_object {
2857  struct objc_class* class_pointer;
2858} *id;
2859
2860
2861
2862
2863
2864typedef id (*IMP)(id, SEL, ...);
2865
2866
2867
2868
2869
2870
2871typedef char *STR;
2872# 97 "/opt/local/include/objc/objc.h" 3 4
2873typedef struct objc_class *MetaClass;
2874typedef struct objc_class *Class;
2875struct objc_class {
2876  MetaClass class_pointer;
2877
2878  struct objc_class* super_class;
2879
2880
2881  const char* name;
2882  long version;
2883  unsigned long info;
2884
2885  long instance_size;
2886
2887
2888
2889  struct objc_ivar_list* ivars;
2890
2891
2892
2893
2894
2895
2896  struct objc_method_list* methods;
2897
2898
2899  struct sarray * dtable;
2900
2901  struct objc_class* subclass_list;
2902  struct objc_class* sibling_class;
2903
2904  struct objc_protocol_list *protocols;
2905  void* gc_object_type;
2906};
2907
2908
2909typedef struct objc_protocol {
2910  struct objc_class* class_pointer;
2911  char *protocol_name;
2912  struct objc_protocol_list *protocol_list;
2913  struct objc_method_description_list *instance_methods, *class_methods;
2914} Protocol;
2915
2916
2917
2918
2919
2920typedef void* retval_t;
2921typedef void(*apply_t)(void);
2922typedef union {
2923  char *arg_ptr;
2924  char arg_regs[sizeof (char*)];
2925} *arglist_t;
2926
2927
2928IMP objc_msg_lookup (id receiver, SEL op);
2929# 38 "/opt/local/include/objc/runtime.h" 2 3 4
2930# 1 "/opt/local/include/objc/objc-api.h" 1 3 4
2931# 35 "/opt/local/include/objc/objc-api.h" 3 4
2932# 1 "/opt/local/include/objc/hash.h" 1 3 4
2933# 31 "/opt/local/include/objc/hash.h" 3 4
2934# 1 "/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/stddef.h" 1 3 4
2935# 32 "/opt/local/include/objc/hash.h" 2 3 4
2936# 1 "/opt/local/include/objc/objc.h" 1 3 4
2937# 33 "/opt/local/include/objc/hash.h" 2 3 4
2938# 1 "/opt/local/include/objc/externvar.h" 1 3 4
2939# 34 "/opt/local/include/objc/hash.h" 2 3 4
2940# 1 "/usr/include/string.h" 1 3 4
2941# 35 "/opt/local/include/objc/hash.h" 2 3 4
2942# 43 "/opt/local/include/objc/hash.h" 3 4
2943typedef struct cache_node
2944{
2945  struct cache_node *next;
2946
2947  const void *key;
2948
2949
2950
2951  void *value;
2952} *node_ptr;
2953# 64 "/opt/local/include/objc/hash.h" 3 4
2954typedef unsigned int (*hash_func_type)(void *, const void *);
2955# 73 "/opt/local/include/objc/hash.h" 3 4
2956typedef int (*compare_func_type)(const void *, const void *);
2957# 82 "/opt/local/include/objc/hash.h" 3 4
2958typedef struct
2959{
2960
2961  node_ptr *node_table;
2962
2963
2964  unsigned int size;
2965
2966
2967  unsigned int used;
2968  unsigned int mask;
2969
2970
2971
2972  unsigned int last_bucket;
2973
2974
2975
2976  hash_func_type hash_func;
2977
2978  compare_func_type compare_func;
2979} cache_t;
2980
2981typedef cache_t *cache_ptr;
2982
2983
2984
2985extern cache_ptr module_hash_table, class_hash_table;
2986
2987
2988
2989cache_ptr hash_new (unsigned int size,
2990      hash_func_type hash_func,
2991      compare_func_type compare_func);
2992
2993
2994
2995void hash_delete (cache_ptr cache);
2996
2997
2998
2999
3000
3001
3002void hash_add (cache_ptr *cachep, const void *key, void *value);
3003
3004
3005
3006
3007void hash_remove (cache_ptr cache, const void *key);
3008# 142 "/opt/local/include/objc/hash.h" 3 4
3009node_ptr hash_next (cache_ptr cache, node_ptr node);
3010
3011
3012
3013void *hash_value_for_key (cache_ptr cache, const void *key);
3014
3015
3016
3017BOOL hash_is_key_in_hash (cache_ptr cache, const void *key);
3018# 164 "/opt/local/include/objc/hash.h" 3 4
3019static inline unsigned int
3020hash_ptr (cache_ptr cache, const void *key)
3021{
3022  return ((size_t)key / sizeof (void *)) & cache->mask;
3023}
3024
3025
3026
3027
3028
3029static inline unsigned int
3030hash_string (cache_ptr cache, const void *key)
3031{
3032  unsigned int ret = 0;
3033  unsigned int ctr = 0;
3034
3035
3036  while (*(char*)key) {
3037    ret ^= *(char*)key++ << ctr;
3038    ctr = (ctr + 1) % sizeof (void *);
3039  }
3040
3041  return ret & cache->mask;
3042}
3043
3044
3045
3046static inline int
3047compare_ptrs (const void *k1, const void *k2)
3048{
3049  return !(k1 - k2);
3050}
3051
3052
3053
3054static inline int
3055compare_strings (const void *k1, const void *k2)
3056{
3057  if (k1 == k2)
3058    return 1;
3059  else if (k1 == 0 || k2 == 0)
3060    return 0;
3061  else
3062    return !strcmp (k1, k2);
3063}
3064# 36 "/opt/local/include/objc/objc-api.h" 2 3 4
3065# 1 "/opt/local/include/objc/thr.h" 1 3 4
3066# 47 "/opt/local/include/objc/thr.h" 3 4
3067extern int __objc_thread_exit_status;
3068# 59 "/opt/local/include/objc/thr.h" 3 4
3069typedef void * objc_thread_t;
3070
3071
3072struct objc_mutex
3073{
3074  volatile objc_thread_t owner;
3075  volatile int depth;
3076  void * backend;
3077};
3078typedef struct objc_mutex *objc_mutex_t;
3079
3080
3081struct objc_condition
3082{
3083  void * backend;
3084};
3085typedef struct objc_condition *objc_condition_t;
3086
3087
3088objc_mutex_t objc_mutex_allocate(void);
3089int objc_mutex_deallocate(objc_mutex_t mutex);
3090int objc_mutex_lock(objc_mutex_t mutex);
3091int objc_mutex_unlock(objc_mutex_t mutex);
3092int objc_mutex_trylock(objc_mutex_t mutex);
3093
3094
3095objc_condition_t objc_condition_allocate(void);
3096int objc_condition_deallocate(objc_condition_t condition);
3097int objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex);
3098int objc_condition_signal(objc_condition_t condition);
3099int objc_condition_broadcast(objc_condition_t condition);
3100
3101
3102objc_thread_t objc_thread_detach(SEL selector, id object, id argument);
3103void objc_thread_yield(void);
3104int objc_thread_exit(void);
3105int objc_thread_set_priority(int priority);
3106int objc_thread_get_priority(void);
3107void * objc_thread_get_data(void);
3108int objc_thread_set_data(void *value);
3109objc_thread_t objc_thread_id(void);
3110# 113 "/opt/local/include/objc/thr.h" 3 4
3111typedef void (*objc_thread_callback)();
3112objc_thread_callback objc_set_thread_callback(objc_thread_callback func);
3113
3114
3115int __objc_init_thread_system(void);
3116int __objc_fini_thread_system(void);
3117
3118
3119int __objc_mutex_allocate(objc_mutex_t mutex);
3120int __objc_mutex_deallocate(objc_mutex_t mutex);
3121int __objc_mutex_lock(objc_mutex_t mutex);
3122int __objc_mutex_trylock(objc_mutex_t mutex);
3123int __objc_mutex_unlock(objc_mutex_t mutex);
3124
3125
3126int __objc_condition_allocate(objc_condition_t condition);
3127int __objc_condition_deallocate(objc_condition_t condition);
3128int __objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex);
3129int __objc_condition_broadcast(objc_condition_t condition);
3130int __objc_condition_signal(objc_condition_t condition);
3131
3132
3133objc_thread_t __objc_thread_detach(void (*func)(void *arg), void *arg);
3134int __objc_thread_set_priority(int priority);
3135int __objc_thread_get_priority(void);
3136void __objc_thread_yield(void);
3137int __objc_thread_exit(void);
3138objc_thread_t __objc_thread_id(void);
3139int __objc_thread_set_data(void *value);
3140void * __objc_thread_get_data(void);
3141# 37 "/opt/local/include/objc/objc-api.h" 2 3 4
3142# 50 "/opt/local/include/objc/objc-api.h" 3 4
3143struct objc_method_description
3144{
3145    SEL name;
3146    char *types;
3147};
3148# 106 "/opt/local/include/objc/objc-api.h" 3 4
3149extern void objc_error (id object, int code, const char* fmt, ...);
3150extern void objc_verror (id object, int code, const char* fmt, va_list ap);
3151typedef BOOL (*objc_error_handler) (id, int code, const char *fmt, va_list ap);
3152objc_error_handler objc_set_error_handler (objc_error_handler func);
3153# 147 "/opt/local/include/objc/objc-api.h" 3 4
3154struct objc_static_instances
3155{
3156  char *class_name;
3157  id instances[0];
3158};
3159# 162 "/opt/local/include/objc/objc-api.h" 3 4
3160typedef struct objc_symtab {
3161  unsigned long sel_ref_cnt;
3162  SEL refs;
3163  unsigned short cls_def_cnt;
3164
3165  unsigned short cat_def_cnt;
3166
3167
3168
3169  void *defs[1];
3170
3171
3172
3173
3174
3175} Symtab, *Symtab_t;
3176# 189 "/opt/local/include/objc/objc-api.h" 3 4
3177typedef struct objc_module {
3178  unsigned long version;
3179  unsigned long size;
3180  const char* name;
3181
3182
3183
3184  Symtab_t symtab;
3185
3186
3187
3188
3189
3190} Module, *Module_t;
3191
3192
3193
3194
3195
3196
3197typedef struct objc_ivar* Ivar_t;
3198typedef struct objc_ivar_list {
3199  int ivar_count;
3200
3201
3202
3203
3204  struct objc_ivar {
3205    const char* ivar_name;
3206
3207
3208    const char* ivar_type;
3209
3210
3211    int ivar_offset;
3212
3213
3214
3215  } ivar_list[1];
3216
3217} IvarList, *IvarList_t;
3218# 240 "/opt/local/include/objc/objc-api.h" 3 4
3219struct objc_method {
3220  SEL method_name;
3221
3222
3223
3224
3225
3226  const char* method_types;
3227
3228
3229  IMP method_imp;
3230
3231};
3232
3233typedef struct objc_method Method;
3234
3235typedef Method* Method_t;
3236typedef struct objc_method_list {
3237  struct objc_method_list* method_next;
3238
3239
3240  int method_count;
3241
3242  struct objc_method method_list[1];
3243
3244} MethodList, *MethodList_t;
3245
3246struct objc_protocol_list {
3247  struct objc_protocol_list *next;
3248  int count;
3249  Protocol *list[1];
3250};
3251# 324 "/opt/local/include/objc/objc-api.h" 3 4
3252typedef struct objc_category {
3253  const char* category_name;
3254
3255
3256  const char* class_name;
3257
3258  MethodList_t instance_methods;
3259
3260
3261
3262  MethodList_t class_methods;
3263
3264
3265
3266  struct objc_protocol_list *protocols;
3267
3268} Category, *Category_t;
3269
3270
3271
3272
3273
3274
3275typedef struct objc_super {
3276  id self;
3277
3278  Class class_type;
3279} Super, *Super_t;
3280
3281IMP objc_msg_lookup_super(Super_t super, SEL sel);
3282
3283retval_t objc_msg_sendv(id, SEL, arglist_t);
3284# 364 "/opt/local/include/objc/objc-api.h" 3 4
3285extern Class (*_objc_lookup_class) (const char *name);
3286
3287
3288
3289
3290
3291
3292
3293extern void (*_objc_load_callback) (Class class_type, Category* category);
3294
3295
3296
3297
3298extern id (*_objc_object_alloc) (Class class_type);
3299extern id (*_objc_object_copy) (id object);
3300extern id (*_objc_object_dispose) (id object);
3301
3302
3303
3304
3305
3306
3307
3308void *objc_malloc (size_t size);
3309
3310void *objc_atomic_malloc (size_t size);
3311
3312void *objc_valloc (size_t size);
3313
3314void *objc_realloc (void *mem, size_t size);
3315
3316void *objc_calloc (size_t nelem, size_t size);
3317
3318void objc_free (void *mem);
3319# 409 "/opt/local/include/objc/objc-api.h" 3 4
3320extern void *(*_objc_malloc) (size_t);
3321extern void *(*_objc_atomic_malloc) (size_t);
3322extern void *(*_objc_valloc) (size_t);
3323extern void *(*_objc_realloc) (void *, size_t);
3324extern void *(*_objc_calloc) (size_t, size_t);
3325extern void (*_objc_free) (void *);
3326
3327Method_t class_get_class_method (MetaClass class_type, SEL aSel);
3328
3329Method_t class_get_instance_method (Class class_type, SEL aSel);
3330
3331Class class_pose_as (Class impostor, Class superclass);
3332
3333Class objc_get_class (const char *name);
3334
3335Class objc_lookup_class (const char *name);
3336
3337Class objc_next_class (void **enum_state);
3338
3339const char *sel_get_name (SEL selector);
3340
3341const char *sel_get_type (SEL selector);
3342
3343SEL sel_get_uid (const char *name);
3344
3345SEL sel_get_any_uid (const char *name);
3346
3347SEL sel_get_any_typed_uid (const char *name);
3348
3349SEL sel_get_typed_uid (const char *name, const char*);
3350
3351SEL sel_register_name (const char *name);
3352
3353SEL sel_register_typed_name (const char *name, const char*type);
3354
3355
3356BOOL sel_is_mapped (SEL aSel);
3357
3358extern id class_create_instance (Class class_type);
3359
3360static inline const char *
3361class_get_class_name (Class class_type)
3362{
3363  return ((class_type)&&((((class_type)->info) & 0x1L) == 0x1L))?class_type->name:((class_type==(Class)0)?"Nil":0);
3364}
3365
3366static inline long
3367class_get_instance_size (Class class_type)
3368{
3369  return ((class_type)&&((((class_type)->info) & 0x1L) == 0x1L)) ? class_type->instance_size : 0;
3370}
3371
3372static inline MetaClass
3373class_get_meta_class (Class class_type)
3374{
3375  return ((class_type)&&((((class_type)->info) & 0x1L) == 0x1L)) ? class_type->class_pointer : (Class)0;
3376}
3377
3378static inline Class
3379class_get_super_class (Class class_type)
3380{
3381  return ((class_type)&&((((class_type)->info) & 0x1L) == 0x1L)) ? class_type->super_class : (Class)0;
3382}
3383
3384static inline int
3385class_get_version (Class class_type)
3386{
3387  return ((class_type)&&((((class_type)->info) & 0x1L) == 0x1L)) ? class_type->version : -1;
3388}
3389
3390static inline BOOL
3391class_is_class (Class class_type)
3392{
3393  return ((class_type)&&((((class_type)->info) & 0x1L) == 0x1L));
3394}
3395
3396static inline BOOL
3397class_is_meta_class (Class class_type)
3398{
3399  return ((class_type)&&((((class_type)->info) & 0x2L) == 0x2L));
3400}
3401
3402
3403static inline void
3404class_set_version (Class class_type, long version)
3405{
3406  if (((class_type)&&((((class_type)->info) & 0x1L) == 0x1L)))
3407    class_type->version = version;
3408}
3409
3410static inline void *
3411class_get_gc_object_type (Class class_type)
3412{
3413  return ((class_type)&&((((class_type)->info) & 0x1L) == 0x1L)) ? class_type->gc_object_type : ((void *)0);
3414}
3415
3416
3417extern void class_ivar_set_gcinvisible (Class class_type,
3418     const char* ivarname,
3419     BOOL gcInvisible);
3420
3421static inline IMP
3422method_get_imp (Method_t method)
3423{
3424  return (method != (Method_t)0) ? method->method_imp : (IMP) 0;
3425}
3426
3427IMP get_imp (Class class_type, SEL sel);
3428
3429
3430
3431
3432
3433
3434
3435id object_copy (id object);
3436
3437id object_dispose (id object);
3438
3439static inline Class
3440object_get_class (id object)
3441{
3442  return ((object != (id)0)
3443   ? (((object->class_pointer)&&((((object->class_pointer)->info) & 0x1L) == 0x1L))
3444      ? object->class_pointer
3445      : (((object->class_pointer)&&((((object->class_pointer)->info) & 0x2L) == 0x2L))
3446  ? (Class) object
3447  : (Class)0))
3448   : (Class)0);
3449}
3450
3451static inline const char *
3452object_get_class_name (id object)
3453{
3454  return ((object!=(id)0) ? (((object->class_pointer)&&((((object->class_pointer)->info) & 0x1L) == 0x1L))
3455                         ? object->class_pointer->name
3456                         : ((Class) object)->name)
3457                       :"Nil");
3458}
3459
3460static inline MetaClass
3461object_get_meta_class(id object)
3462{
3463  return ((object!=(id)0) ? (((object->class_pointer)&&((((object->class_pointer)->info) & 0x1L) == 0x1L))
3464                           ? object->class_pointer->class_pointer
3465                           : (((object->class_pointer)&&((((object->class_pointer)->info) & 0x2L) == 0x2L))
3466                              ? object->class_pointer
3467                              :(Class)0))
3468          : (Class)0);
3469}
3470
3471static inline Class
3472object_get_super_class (id object)
3473{
3474  return ((object!=(id)0) ? (((object->class_pointer)&&((((object->class_pointer)->info) & 0x1L) == 0x1L))
3475                           ? object->class_pointer->super_class
3476                           : (((object->class_pointer)&&((((object->class_pointer)->info) & 0x2L) == 0x2L))
3477                           ?((Class) object)->super_class
3478                              : (Class)0))
3479          : (Class)0);
3480}
3481
3482static inline BOOL
3483object_is_class (id object)
3484{
3485  return (((Class) object)&&(((((Class) object)->info) & 0x1L) == 0x1L));
3486}
3487
3488static inline BOOL
3489object_is_instance(id object)
3490{
3491  return (object != (id)0) && ((object->class_pointer)&&((((object->class_pointer)->info) & 0x1L) == 0x1L));
3492}
3493
3494static inline BOOL
3495object_is_meta_class (id object)
3496{
3497  return (((Class) object)&&(((((Class) object)->info) & 0x2L) == 0x2L));
3498}
3499
3500struct sarray* objc_get_uninstalled_dtable (void);
3501# 39 "/opt/local/include/objc/runtime.h" 2 3 4
3502
3503
3504
3505
3506# 1 "/opt/local/include/objc/objc-list.h" 1 3 4
3507# 31 "/opt/local/include/objc/objc-list.h" 3 4
3508struct objc_list {
3509  void *head;
3510  struct objc_list *tail;
3511};
3512
3513
3514
3515static inline struct objc_list*
3516list_cons(void* head, struct objc_list* tail)
3517{
3518  struct objc_list* cell;
3519
3520  cell = (struct objc_list*)objc_malloc(sizeof(struct objc_list));
3521  cell->head = head;
3522  cell->tail = tail;
3523  return cell;
3524}
3525
3526
3527
3528static inline int
3529list_length(struct objc_list* list)
3530{
3531  int i = 0;
3532  while(list)
3533    {
3534      i += 1;
3535      list = list->tail;
3536    }
3537  return i;
3538}
3539
3540
3541
3542
3543static inline void*
3544list_nth(int index, struct objc_list* list)
3545{
3546  while(index-- != 0)
3547    {
3548      if(list->tail)
3549 list = list->tail;
3550      else
3551 return 0;
3552    }
3553  return list->head;
3554}
3555
3556
3557
3558static inline void
3559list_remove_head(struct objc_list** list)
3560{
3561  if ((*list)->tail)
3562    {
3563      struct objc_list* tail = (*list)->tail;
3564      *(*list) = *tail;
3565      objc_free(tail);
3566    }
3567  else
3568    {
3569      objc_free(*list);
3570      (*list) = 0;
3571    }
3572}
3573
3574
3575
3576
3577static inline void
3578list_remove_elem(struct objc_list** list, void* elem)
3579{
3580  while (*list) {
3581    if ((*list)->head == elem)
3582      list_remove_head(list);
3583    list = &((*list)->tail);
3584  }
3585}
3586
3587
3588
3589static inline void
3590list_mapcar(struct objc_list* list, void(*function)(void*))
3591{
3592  while(list)
3593    {
3594      (*function)(list->head);
3595      list = list->tail;
3596    }
3597}
3598
3599
3600
3601static inline struct objc_list**
3602list_find(struct objc_list** list, void* elem)
3603{
3604  while(*list)
3605    {
3606    if ((*list)->head == elem)
3607      return list;
3608    list = &((*list)->tail);
3609    }
3610  return ((void *)0);
3611}
3612
3613
3614
3615static void
3616list_free(struct objc_list* list)
3617{
3618  if(list)
3619    {
3620      list_free(list->tail);
3621      objc_free(list);
3622    }
3623}
3624# 44 "/opt/local/include/objc/runtime.h" 2 3 4
3625
3626
3627
3628extern void __objc_add_class_to_hash (Class);
3629extern void __objc_init_selector_tables (void);
3630extern void __objc_init_class_tables (void);
3631extern void __objc_init_dispatch_tables (void);
3632extern void __objc_install_premature_dtable (Class);
3633extern void __objc_resolve_class_links (void);
3634extern void __objc_register_selectors_from_class (Class);
3635extern void __objc_update_dispatch_table_for_class (Class);
3636
3637extern int __objc_init_thread_system (void);
3638extern int __objc_fini_thread_system (void);
3639extern void __objc_print_dtable_stats (void);
3640
3641extern void class_add_method_list (Class, MethodList_t);
3642
3643
3644extern void __objc_register_instance_methods_to_class (Class);
3645extern Method_t search_for_method_in_list(MethodList_t list, SEL op);
3646
3647
3648extern BOOL __objc_class_links_resolved;
3649
3650
3651extern int __objc_selector_max_index;
3652
3653
3654extern objc_mutex_t __objc_runtime_mutex;
3655
3656
3657extern int __objc_runtime_threads_alive;
3658
3659
3660
3661
3662
3663
3664
3665BOOL __objc_responds_to (id object, SEL sel);
3666SEL __sel_register_typed_name (const char*, const char*,
3667    struct objc_selector*, BOOL is_const);
3668# 2 "/usr/include/objc/objc-runtime.h" 2 3 4
3669# 1 "/usr/include/objc/message.h" 1 3 4
3670# 33 "/usr/include/objc/message.h" 3 4
3671struct objc_super {
3672    id receiver;
3673
3674    Class class;
3675
3676
3677
3678
3679};
3680# 53 "/usr/include/objc/message.h" 3 4
3681OBJC_EXPORT id objc_msgSend(id self, SEL op, ...);
3682OBJC_EXPORT id objc_msgSendSuper(struct objc_super *super, SEL op, ...);
3683# 75 "/usr/include/objc/message.h" 3 4
3684OBJC_EXPORT void objc_msgSend_stret(void * stretAddr, id self, SEL op, ...);
3685OBJC_EXPORT void objc_msgSendSuper_stret(void * stretAddr, struct objc_super *super, SEL op, ...);
3686# 99 "/usr/include/objc/message.h" 3 4
3687OBJC_EXPORT long double objc_msgSend_fpret(id self, SEL op, ...);
3688# 114 "/usr/include/objc/message.h" 3 4
3689OBJC_EXPORT id method_invoke(id receiver, Method m, ...)
3690     AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
3691OBJC_EXPORT void method_invoke_stret(id receiver, Method m, ...)
3692     AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
3693# 135 "/usr/include/objc/message.h" 3 4
3694OBJC_EXPORT id _objc_msgForward(id receiver, SEL sel, ...)
3695     AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
3696OBJC_EXPORT void _objc_msgForward_stret(id receiver, SEL sel, ...)
3697     AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER;
3698# 154 "/usr/include/objc/message.h" 3 4
3699typedef void* marg_list;
3700
3701OBJC_EXPORT id objc_msgSendv(id self, SEL op, size_t arg_size, marg_list arg_frame) OBJC2_UNAVAILABLE;
3702OBJC_EXPORT void objc_msgSendv_stret(void *stretAddr, id self, SEL op, size_t arg_size, marg_list arg_frame) OBJC2_UNAVAILABLE;
3703# 2 "/usr/include/objc/objc-runtime.h" 2 3 4
3704# 35 "print_objc.c" 2
3705# 1 "./../include/stuff/allocate.h" 1
3706# 29 "./../include/stuff/allocate.h"
3707__private_extern__ void *allocate(
3708    size_t size);
3709
3710__private_extern__ void *reallocate(
3711    void *,
3712    size_t size);
3713
3714__private_extern__ char *savestr(
3715    const char *s);
3716
3717__private_extern__ char *makestr(
3718    const char *args, ...);
3719# 36 "print_objc.c" 2
3720# 1 "./../include/stuff/bytesex.h" 1
3721# 36 "./../include/stuff/bytesex.h"
3722# 1 "./../include/mach-o/fat.h" 1
3723# 51 "./../include/mach-o/fat.h"
3724struct fat_header {
3725 uint32_t magic;
3726 uint32_t nfat_arch;
3727};
3728
3729struct fat_arch {
3730 cpu_type_t cputype;
3731 cpu_subtype_t cpusubtype;
3732 uint32_t offset;
3733 uint32_t size;
3734 uint32_t align;
3735};
3736# 37 "./../include/stuff/bytesex.h" 2
3737# 1 "./../include/mach-o/loader.h" 1
3738# 38 "./../include/stuff/bytesex.h" 2
3739# 1 "./../include/mach/m68k/thread_status.h" 1
3740# 68 "./../include/mach/m68k/thread_status.h"
3741struct m68k_thread_state_regs {
3742 int dreg[8];
3743 int areg[8];
3744 short pad0;
3745 short sr;
3746 int pc;
3747};
3748
3749
3750
3751
3752struct m68k_thread_state_68882 {
3753 struct {
3754  int fp[3];
3755 } regs[8];
3756 int cr;
3757 int sr;
3758 int iar;
3759 int state;
3760};
3761
3762
3763
3764
3765struct m68k_thread_state_user_reg {
3766 int user_reg;
3767};
3768# 39 "./../include/stuff/bytesex.h" 2
3769
3770
3771
3772
3773# 1 "./../include/mach/ppc/thread_status.h" 1
3774# 35 "./../include/mach/ppc/thread_status.h"
3775# 1 "./../include/mach/ppc/_structs.h" 1
3776# 45 "./../include/mach/ppc/_structs.h"
3777struct __darwin_ppc_thread_state
3778{
3779 unsigned int __srr0;
3780 unsigned int __srr1;
3781 unsigned int __r0;
3782 unsigned int __r1;
3783 unsigned int __r2;
3784 unsigned int __r3;
3785 unsigned int __r4;
3786 unsigned int __r5;
3787 unsigned int __r6;
3788 unsigned int __r7;
3789 unsigned int __r8;
3790 unsigned int __r9;
3791 unsigned int __r10;
3792 unsigned int __r11;
3793 unsigned int __r12;
3794 unsigned int __r13;
3795 unsigned int __r14;
3796 unsigned int __r15;
3797 unsigned int __r16;
3798 unsigned int __r17;
3799 unsigned int __r18;
3800 unsigned int __r19;
3801 unsigned int __r20;
3802 unsigned int __r21;
3803 unsigned int __r22;
3804 unsigned int __r23;
3805 unsigned int __r24;
3806 unsigned int __r25;
3807 unsigned int __r26;
3808 unsigned int __r27;
3809 unsigned int __r28;
3810 unsigned int __r29;
3811 unsigned int __r30;
3812 unsigned int __r31;
3813
3814 unsigned int __cr;
3815 unsigned int __xer;
3816 unsigned int __lr;
3817 unsigned int __ctr;
3818 unsigned int __mq;
3819
3820 unsigned int __vrsave;
3821};
3822# 141 "./../include/mach/ppc/_structs.h"
3823#pragma pack(4)
3824
3825
3826
3827struct __darwin_ppc_thread_state64
3828{
3829 unsigned long long __srr0;
3830 unsigned long long __srr1;
3831 unsigned long long __r0;
3832 unsigned long long __r1;
3833 unsigned long long __r2;
3834 unsigned long long __r3;
3835 unsigned long long __r4;
3836 unsigned long long __r5;
3837 unsigned long long __r6;
3838 unsigned long long __r7;
3839 unsigned long long __r8;
3840 unsigned long long __r9;
3841 unsigned long long __r10;
3842 unsigned long long __r11;
3843 unsigned long long __r12;
3844 unsigned long long __r13;
3845 unsigned long long __r14;
3846 unsigned long long __r15;
3847 unsigned long long __r16;
3848 unsigned long long __r17;
3849 unsigned long long __r18;
3850 unsigned long long __r19;
3851 unsigned long long __r20;
3852 unsigned long long __r21;
3853 unsigned long long __r22;
3854 unsigned long long __r23;
3855 unsigned long long __r24;
3856 unsigned long long __r25;
3857 unsigned long long __r26;
3858 unsigned long long __r27;
3859 unsigned long long __r28;
3860 unsigned long long __r29;
3861 unsigned long long __r30;
3862 unsigned long long __r31;
3863
3864 unsigned int __cr;
3865 unsigned long long __xer;
3866 unsigned long long __lr;
3867 unsigned long long __ctr;
3868
3869 unsigned int __vrsave;
3870};
3871# 237 "./../include/mach/ppc/_structs.h"
3872#pragma pack()
3873
3874
3875
3876
3877
3878
3879
3880struct __darwin_ppc_float_state
3881{
3882 double __fpregs[32];
3883
3884 unsigned int __fpscr_pad;
3885 unsigned int __fpscr;
3886};
3887# 263 "./../include/mach/ppc/_structs.h"
3888#pragma pack(4)
3889
3890
3891
3892struct __darwin_ppc_vector_state
3893{
3894
3895 unsigned int __save_vr[32][4];
3896 unsigned int __save_vscr[4];
3897
3898
3899
3900
3901 unsigned int __save_pad5[4];
3902 unsigned int __save_vrvalid;
3903 unsigned int __save_pad6[7];
3904};
3905# 297 "./../include/mach/ppc/_structs.h"
3906#pragma pack()
3907# 316 "./../include/mach/ppc/_structs.h"
3908#pragma pack(4)
3909
3910
3911
3912struct __darwin_ppc_exception_state
3913{
3914
3915 unsigned int __dar;
3916 unsigned int __dsisr;
3917 unsigned int __exception;
3918 unsigned int __pad0;
3919 unsigned int __pad1[4];
3920
3921
3922
3923
3924
3925
3926
3927};
3928# 359 "./../include/mach/ppc/_structs.h"
3929struct __darwin_ppc_exception_state64
3930{
3931 unsigned long long __dar;
3932
3933 unsigned int __dsisr;
3934 unsigned int __exception;
3935 unsigned int __pad1[4];
3936
3937
3938
3939
3940
3941};
3942# 390 "./../include/mach/ppc/_structs.h"
3943#pragma pack()
3944# 36 "./../include/mach/ppc/thread_status.h" 2
3945# 72 "./../include/mach/ppc/thread_status.h"
3946typedef struct __darwin_ppc_thread_state ppc_thread_state_t;
3947
3948typedef struct __darwin_ppc_thread_state64 ppc_thread_state64_t;
3949
3950typedef struct __darwin_ppc_float_state ppc_float_state_t;
3951typedef struct __darwin_ppc_vector_state ppc_vector_state_t;
3952# 94 "./../include/mach/ppc/thread_status.h"
3953typedef struct ppc_thread_state ppc_saved_state_t;
3954# 115 "./../include/mach/ppc/thread_status.h"
3955typedef struct __darwin_ppc_exception_state ppc_exception_state_t;
3956
3957typedef struct __darwin_ppc_exception_state64 ppc_exception_state64_t;
3958# 44 "./../include/stuff/bytesex.h" 2
3959
3960
3961
3962
3963# 1 "./../include/mach/m88k/thread_status.h" 1
3964# 52 "./../include/mach/m88k/thread_status.h"
3965# 1 "./../include/architecture/m88k/fp_regs.h" 1
3966# 44 "./../include/architecture/m88k/fp_regs.h"
3967# 1 "./../include/architecture/m88k/reg_help.h" 1
3968# 44 "./../include/architecture/m88k/reg_help.h"
3969# 1 "./../include/architecture/nrw/reg_help.h" 1
3970# 45 "./../include/architecture/m88k/reg_help.h" 2
3971# 45 "./../include/architecture/m88k/fp_regs.h" 2
3972
3973
3974
3975
3976
3977typedef union {
3978 float f;
3979 double d;
3980
3981
3982
3983
3984
3985
3986 long double e;
3987
3988
3989 unsigned x[4] __attribute__(( aligned(16) ));
3990
3991
3992
3993} m88k_xrf_t;
3994
3995
3996
3997
3998typedef struct {
3999 unsigned :((31)-(17)+1);
4000 unsigned xmod:(1);
4001 unsigned :((15)-(5)+1);
4002 unsigned afinv:(1);
4003 unsigned afdvz:(1);
4004 unsigned afunf:(1);
4005 unsigned afovf:(1);
4006 unsigned afinx:(1);
4007} m88k_fpsr_t;
4008
4009
4010
4011
4012
4013
4014typedef enum {
4015 M88K_RM_NEAREST = 0,
4016 M88K_RM_ZERO = 1,
4017 M88K_RM_NEGINF = 2,
4018 M88K_RM_POSINF =3
4019} m88k_fpcr_rm_t;
4020
4021typedef struct {
4022 unsigned :((31)-(16)+1);
4023 m88k_fpcr_rm_t rm:((15)-(14)+1);
4024 unsigned :((13)-(5)+1);
4025 unsigned efinv:(1);
4026 unsigned efdvz:(1);
4027 unsigned efunf:(1);
4028 unsigned efovf:(1);
4029 unsigned efinx:(1);
4030} m88k_fpcr_t;
4031
4032
4033
4034
4035
4036typedef struct {
4037 unsigned :((31)-(22)+1);
4038 unsigned tcfp:(1);
4039 unsigned :((20)-(19)+1);
4040 unsigned tcfpunf:(1);
4041 unsigned tcfpovf:(1);
4042 unsigned :(1);
4043 m88k_fpcr_rm_t rm:((15)-(14)+1);
4044 unsigned :((13)-(5)+1);
4045 unsigned efinv:(1);
4046 unsigned efdvz:(1);
4047 unsigned efunf:(1);
4048 unsigned efovf:(1);
4049 unsigned efinx:(1);
4050} m88110_fpcr_t;
4051# 53 "./../include/mach/m88k/thread_status.h" 2
4052# 70 "./../include/mach/m88k/thread_status.h"
4053typedef struct _m88k_thread_state_grf {
4054 unsigned r1;
4055 unsigned r2;
4056 unsigned r3;
4057 unsigned r4;
4058 unsigned r5;
4059 unsigned r6;
4060 unsigned r7;
4061 unsigned r8;
4062 unsigned r9;
4063 unsigned r10;
4064 unsigned r11;
4065 unsigned r12;
4066 unsigned r13;
4067 unsigned r14;
4068 unsigned r15;
4069 unsigned r16;
4070 unsigned r17;
4071 unsigned r18;
4072 unsigned r19;
4073 unsigned r20;
4074 unsigned r21;
4075 unsigned r22;
4076 unsigned r23;
4077 unsigned r24;
4078 unsigned r25;
4079 unsigned r26;
4080 unsigned r27;
4081 unsigned r28;
4082 unsigned r29;
4083 unsigned r30;
4084 unsigned r31;
4085 unsigned xip;
4086 unsigned xip_in_bd;
4087
4088
4089
4090 unsigned nip;
4091} m88k_thread_state_grf_t;
4092# 117 "./../include/mach/m88k/thread_status.h"
4093typedef struct _m88k_thread_state_xrf {
4094 m88k_xrf_t x1;
4095 m88k_xrf_t x2;
4096 m88k_xrf_t x3;
4097 m88k_xrf_t x4;
4098 m88k_xrf_t x5;
4099 m88k_xrf_t x6;
4100 m88k_xrf_t x7;
4101 m88k_xrf_t x8;
4102 m88k_xrf_t x9;
4103 m88k_xrf_t x10;
4104 m88k_xrf_t x11;
4105 m88k_xrf_t x12;
4106 m88k_xrf_t x13;
4107 m88k_xrf_t x14;
4108 m88k_xrf_t x15;
4109 m88k_xrf_t x16;
4110 m88k_xrf_t x17;
4111 m88k_xrf_t x18;
4112 m88k_xrf_t x19;
4113 m88k_xrf_t x20;
4114 m88k_xrf_t x21;
4115 m88k_xrf_t x22;
4116 m88k_xrf_t x23;
4117 m88k_xrf_t x24;
4118 m88k_xrf_t x25;
4119 m88k_xrf_t x26;
4120 m88k_xrf_t x27;
4121 m88k_xrf_t x28;
4122 m88k_xrf_t x29;
4123 m88k_xrf_t x30;
4124 m88k_xrf_t x31;
4125 m88k_fpsr_t fpsr;
4126 m88k_fpcr_t fpcr;
4127} m88k_thread_state_xrf_t;
4128
4129
4130
4131
4132typedef struct _m88k_thread_state_user {
4133 int user;
4134} m88k_thread_state_user_t;
4135# 174 "./../include/mach/m88k/thread_status.h"
4136typedef enum {
4137 M88110_MATCH_BYTE = 0,
4138 M88110_MATCH_SHORT = 0x1,
4139 M88110_MATCH_WORD = 0x3,
4140 M88110_MATCH_DOUBLE = 0x7,
4141 M88110_MATCH_QUAD = 0xf,
4142 M88110_MATCH_32 = 0x1f,
4143 M88110_MATCH_64 = 0x3f,
4144 M88110_MATCH_128 = 0x7f,
4145 M88110_MATCH_256 = 0xff,
4146 M88110_MATCH_512 = 0x1ff,
4147 M88110_MATCH_1024 = 0x3ff,
4148 M88110_MATCH_2048 = 0x7ff,
4149 M88110_MATCH_4096 = 0xfff
4150} m88110_match_t;
4151
4152
4153
4154
4155typedef struct {
4156 unsigned :((31)-(29)+1);
4157 unsigned rw:(1);
4158 unsigned rwm:(1);
4159 unsigned :((26)-(13)+1);
4160 m88110_match_t addr_match:((12)-(1)+1);
4161 unsigned v:(1);
4162} m88110_bp_ctrl_t;
4163
4164
4165
4166
4167typedef struct {
4168 unsigned addr;
4169 m88110_bp_ctrl_t ctrl;
4170} m88110_data_bp_t;
4171
4172
4173
4174
4175
4176
4177typedef struct {
4178 unsigned supr:(1);
4179 unsigned le:(1);
4180 unsigned se:(1);
4181 unsigned c:(1);
4182 unsigned :(1);
4183 unsigned sgn_imd:(1);
4184 unsigned sm:(1);
4185 unsigned :(1);
4186 unsigned trace:(1);
4187 unsigned :((22)-(5)+1);
4188 unsigned sfu2dis:(1);
4189 unsigned sfu1dis:(1);
4190 unsigned mxm_dis:(1);
4191 unsigned :((1)-(0)+1);
4192} m88110_psr_t;
4193
4194
4195
4196
4197typedef enum {
4198 M88110_IRESULT_SIZE_NONE = 0,
4199 M88110_IRESULT_SIZE_SINGLE = 1,
4200 M88110_IRESULT_SIZE_DOUBLE = 2,
4201 M88110_IRESULT_SIZE_EXTENDED = 3
4202} m88110_iresult_size_t;
4203
4204typedef struct {
4205 unsigned :((31)-(16)+1);
4206 m88110_iresult_size_t iresult_size:((15)-(14)+1);
4207
4208 unsigned :((13)-(9)+1);
4209 unsigned sfu1_disabled:(1);
4210 unsigned int:(1);
4211 unsigned unimp:(1);
4212 unsigned priv:(1);
4213 unsigned efinv:(1);
4214 unsigned efdvz:(1);
4215 unsigned efunf:(1);
4216 unsigned efovf:(1);
4217 unsigned efinx:(1);
4218} m88110_fp_trap_status_t;
4219
4220
4221
4222
4223
4224typedef struct _m88110_thread_state_impl {
4225 m88110_data_bp_t data_bp[2];
4226
4227
4228
4229
4230 m88110_psr_t psr;
4231# 277 "./../include/mach/m88k/thread_status.h"
4232 m88k_xrf_t intermediate_result;
4233 m88110_fp_trap_status_t fp_trap_status;
4234} m88110_thread_state_impl_t;
4235# 49 "./../include/stuff/bytesex.h" 2
4236# 1 "./../include/mach/i860/thread_status.h" 1
4237# 44 "./../include/mach/i860/thread_status.h"
4238struct i860_thread_state_regs {
4239 int ireg[31];
4240 int freg[30];
4241 int psr;
4242 int epsr;
4243 int db;
4244 int pc;
4245 int _padding_;
4246
4247 double Mres3;
4248 double Ares3;
4249 double Mres2;
4250 double Ares2;
4251 double Mres1;
4252 double Ares1;
4253 double Ires1;
4254 double Lres3m;
4255 double Lres2m;
4256 double Lres1m;
4257 double KR;
4258 double KI;
4259 double T;
4260 int Fsr3;
4261 int Fsr2;
4262 int Fsr1;
4263 int Mergelo32;
4264 int Mergehi32;
4265};
4266# 50 "./../include/stuff/bytesex.h" 2
4267# 1 "/usr/include/mach/i386/thread_status.h" 1 3 4
4268# 51 "./../include/stuff/bytesex.h" 2
4269# 1 "./../include/mach/hppa/thread_status.h" 1
4270# 73 "./../include/mach/hppa/thread_status.h"
4271struct hp_pa_frame_thread_state {
4272 uint32_t ts_pcsq_front;
4273 uint32_t ts_pcsq_back;
4274 uint32_t ts_pcoq_front;
4275 uint32_t ts_pcoq_back;
4276 uint32_t ts_psw;
4277 uint32_t ts_unaligned_faults;
4278 uint32_t ts_fault_address;
4279# 96 "./../include/mach/hppa/thread_status.h"
4280 uint32_t ts_step_range_start;
4281 uint32_t ts_step_range_stop;
4282
4283
4284 boolean_t ts_alignment_trap_reflect;
4285
4286
4287 boolean_t ts_execution_trap_reflect;
4288};
4289
4290
4291
4292
4293
4294struct hp_pa_old_frame_thread_state {
4295 uint32_t ts_pcsq_front;
4296 uint32_t ts_pcsq_back;
4297 uint32_t ts_pcoq_front;
4298 uint32_t ts_pcoq_back;
4299 uint32_t ts_psw;
4300};
4301
4302
4303
4304
4305
4306typedef struct hp_pa_integer_thread_state {
4307 uint32_t ts_gr1;
4308 uint32_t ts_gr2;
4309 uint32_t ts_gr3;
4310 uint32_t ts_gr4;
4311 uint32_t ts_gr5;
4312 uint32_t ts_gr6;
4313 uint32_t ts_gr7;
4314 uint32_t ts_gr8;
4315 uint32_t ts_gr9;
4316 uint32_t ts_gr10;
4317 uint32_t ts_gr11;
4318 uint32_t ts_gr12;
4319 uint32_t ts_gr13;
4320 uint32_t ts_gr14;
4321 uint32_t ts_gr15;
4322 uint32_t ts_gr16;
4323 uint32_t ts_gr17;
4324 uint32_t ts_gr18;
4325 uint32_t ts_gr19;
4326 uint32_t ts_gr20;
4327 uint32_t ts_gr21;
4328 uint32_t ts_gr22;
4329 uint32_t ts_gr23;
4330 uint32_t ts_gr24;
4331 uint32_t ts_gr25;
4332 uint32_t ts_gr26;
4333 uint32_t ts_gr27;
4334 uint32_t ts_gr28;
4335 uint32_t ts_gr29;
4336 uint32_t ts_gr30;
4337 uint32_t ts_gr31;
4338 uint32_t ts_sr0;
4339 uint32_t ts_sr1;
4340 uint32_t ts_sr2;
4341 uint32_t ts_sr3;
4342 uint32_t ts_sar;
4343} hp_pa_integer_thread_state_t;
4344
4345
4346
4347
4348
4349typedef struct hp_pa_fp_thread_state {
4350 double ts_fp0;
4351 double ts_fp1;
4352 double ts_fp2;
4353 double ts_fp3;
4354 double ts_fp4;
4355 double ts_fp5;
4356 double ts_fp6;
4357 double ts_fp7;
4358 double ts_fp8;
4359 double ts_fp9;
4360 double ts_fp10;
4361 double ts_fp11;
4362 double ts_fp12;
4363 double ts_fp13;
4364 double ts_fp14;
4365 double ts_fp15;
4366 double ts_fp16;
4367 double ts_fp17;
4368 double ts_fp18;
4369 double ts_fp19;
4370 double ts_fp20;
4371 double ts_fp21;
4372 double ts_fp22;
4373 double ts_fp23;
4374 double ts_fp24;
4375 double ts_fp25;
4376 double ts_fp26;
4377 double ts_fp27;
4378 double ts_fp28;
4379 double ts_fp29;
4380 double ts_fp30;
4381 double ts_fp31;
4382} hp_pa_fp_thread_state_t;
4383# 52 "./../include/stuff/bytesex.h" 2
4384# 1 "./../include/mach/sparc/thread_status.h" 1
4385# 35 "./../include/mach/sparc/thread_status.h"
4386# 1 "./../include/architecture/sparc/reg.h" 1
4387# 72 "./../include/architecture/sparc/reg.h"
4388struct regs {
4389 int r_psr;
4390 int r_pc;
4391 int r_npc;
4392 int r_y;
4393 int r_g1;
4394 int r_g2;
4395 int r_g3;
4396 int r_g4;
4397 int r_g5;
4398 int r_g6;
4399 int r_g7;
4400 int r_o0;
4401 int r_o1;
4402 int r_o2;
4403 int r_o3;
4404 int r_o4;
4405 int r_o5;
4406 int r_o6;
4407 int r_o7;
4408};
4409# 116 "./../include/architecture/sparc/reg.h"
4410struct fpq {
4411 unsigned int *addr;
4412 unsigned int instr;
4413};
4414struct fq {
4415 union {
4416  double whole;
4417  struct fpq fpq;
4418 } FQu;
4419};
4420
4421
4422
4423
4424
4425struct fpu {
4426 union {
4427  unsigned Fpu_regs[32];
4428  double Fpu_dregs[16];
4429 } fpu_fr;
4430 unsigned Fpu_fsr;
4431 unsigned Fpu_flags;
4432 unsigned Fpu_extra;
4433 unsigned Fpu_qcnt;
4434 struct fq Fpu_q[16];
4435};
4436# 268 "./../include/architecture/sparc/reg.h"
4437struct rwindow {
4438 int rw_local[8];
4439 int rw_in[8];
4440};
4441# 288 "./../include/architecture/sparc/reg.h"
4442struct p_status {
4443  union {
4444    unsigned int psr;
4445    struct {
4446 unsigned int
4447 impl:4,
4448 ver:4,
4449 icc:4,
4450 reserved:6,
4451 ec:1,
4452 ef:1,
4453 pil:4,
4454 s:1,
4455 ps:1,
4456 et:1,
4457 cwp:5;
4458      } psr_bits;
4459  } PSRREG;
4460};
4461
4462struct f_status {
4463  union {
4464    unsigned Fpu_fsr;
4465    struct {
4466      unsigned int
4467      rd:2,
4468      rp:2,
4469      tem:5,
4470      res:6,
4471      ftt:3,
4472      qne:1,
4473      pr:1,
4474      fcc:2,
4475      aexc:5,
4476      cexc:5;
4477    } Fpu_fsr_bits;
4478  } FPUREG;
4479};
4480# 36 "./../include/mach/sparc/thread_status.h" 2
4481# 55 "./../include/mach/sparc/thread_status.h"
4482struct sparc_thread_state_regs {
4483 struct regs regs;
4484};
4485# 69 "./../include/mach/sparc/thread_status.h"
4486struct sparc_thread_state_fpu {
4487 struct fpu fpu;
4488};
4489# 53 "./../include/stuff/bytesex.h" 2
4490# 1 "./../include/mach/arm/thread_status.h" 1
4491# 12 "./../include/mach/arm/thread_status.h"
4492# 1 "./../include/mach/arm/_structs.h" 1
4493# 12 "./../include/mach/arm/_structs.h"
4494struct __darwin_arm_exception_state
4495{
4496 __uint32_t __exception;
4497 __uint32_t __fsr;
4498 __uint32_t __far;
4499};
4500# 30 "./../include/mach/arm/_structs.h"
4501struct __darwin_arm_thread_state
4502{
4503 __uint32_t __r[13];
4504 __uint32_t __sp;
4505 __uint32_t __lr;
4506 __uint32_t __pc;
4507 __uint32_t __cpsr;
4508};
4509# 52 "./../include/mach/arm/_structs.h"
4510struct __darwin_arm_vfp_state
4511{
4512 __uint32_t __r[64];
4513 __uint32_t __fpscr;
4514
4515};
4516# 68 "./../include/mach/arm/_structs.h"
4517struct __darwin_arm_debug_state
4518{
4519 __uint32_t __bvr[16];
4520 __uint32_t __bcr[16];
4521 __uint32_t __wvr[16];
4522 __uint32_t __wcr[16];
4523};
4524# 13 "./../include/mach/arm/thread_status.h" 2
4525
4526# 1 "./../include/mach/arm/thread_state.h" 1
4527# 15 "./../include/mach/arm/thread_status.h" 2
4528# 38 "./../include/mach/arm/thread_status.h"
4529typedef struct __darwin_arm_thread_state arm_thread_state_t;
4530typedef struct __darwin_arm_vfp_state arm_vfp_state_t;
4531typedef struct __darwin_arm_exception_state arm_exception_state_t;
4532typedef struct __darwin_arm_debug_state arm_debug_state_t;
4533# 54 "./../include/stuff/bytesex.h" 2
4534# 1 "./../include/mach-o/nlist.h" 1
4535# 76 "./../include/mach-o/nlist.h"
4536struct nlist {
4537 union {
4538
4539
4540
4541  uint32_t n_strx;
4542 } n_un;
4543 uint8_t n_type;
4544 uint8_t n_sect;
4545 int16_t n_desc;
4546 uint32_t n_value;
4547};
4548
4549
4550
4551
4552struct nlist_64 {
4553    union {
4554        uint32_t n_strx;
4555    } n_un;
4556    uint8_t n_type;
4557    uint8_t n_sect;
4558    uint16_t n_desc;
4559    uint64_t n_value;
4560};
4561# 306 "./../include/mach-o/nlist.h"
4562extern int nlist (const char *filename, struct nlist *list);
4563# 55 "./../include/stuff/bytesex.h" 2
4564# 1 "./../include/mach-o/reloc.h" 1
4565# 64 "./../include/mach-o/reloc.h"
4566struct relocation_info {
4567   int32_t r_address;
4568
4569   uint32_t r_symbolnum:24,
4570
4571  r_pcrel:1,
4572  r_length:2,
4573  r_extern:1,
4574  r_type:4;
4575};
4576# 151 "./../include/mach-o/reloc.h"
4577struct scattered_relocation_info {
4578# 163 "./../include/mach-o/reloc.h"
4579   uint32_t
4580     r_address:24,
4581
4582  r_type:4,
4583  r_length:2,
4584  r_pcrel:1,
4585  r_scattered:1;
4586   int32_t r_value;
4587
4588
4589};
4590# 193 "./../include/mach-o/reloc.h"
4591enum reloc_type_generic
4592{
4593    GENERIC_RELOC_VANILLA,
4594    GENERIC_RELOC_PAIR,
4595    GENERIC_RELOC_SECTDIFF,
4596    GENERIC_RELOC_PB_LA_PTR,
4597    GENERIC_RELOC_LOCAL_SECTDIFF,
4598    GENERIC_RELOC_TLV
4599};
4600# 56 "./../include/stuff/bytesex.h" 2
4601# 1 "./../include/mach-o/ranlib.h" 1
4602# 28 "./../include/mach-o/ranlib.h"
4603# 1 "/usr/include/sys/types.h" 1 3 4
4604# 72 "/usr/include/sys/types.h" 3 4
4605# 1 "/usr/include/sys/appleapiopts.h" 1 3 4
4606# 73 "/usr/include/sys/types.h" 2 3 4
4607
4608
4609
4610
4611
4612# 1 "/usr/include/machine/types.h" 1 3 4
4613# 37 "/usr/include/machine/types.h" 3 4
4614# 1 "/usr/include/i386/types.h" 1 3 4
4615# 80 "/usr/include/i386/types.h" 3 4
4616typedef unsigned char u_int8_t;
4617
4618
4619
4620
4621typedef unsigned short u_int16_t;
4622
4623
4624
4625
4626typedef unsigned int u_int32_t;
4627
4628
4629
4630
4631typedef unsigned long long u_int64_t;
4632
4633
4634typedef int64_t register_t;
4635# 114 "/usr/include/i386/types.h" 3 4
4636typedef u_int64_t user_addr_t;
4637typedef u_int64_t user_size_t;
4638typedef int64_t user_ssize_t;
4639typedef int64_t user_long_t;
4640typedef u_int64_t user_ulong_t;
4641typedef int64_t user_time_t;
4642typedef int64_t user_off_t;
4643
4644
4645
4646
4647
4648
4649
4650typedef u_int64_t syscall_arg_t;
4651# 38 "/usr/include/machine/types.h" 2 3 4
4652# 79 "/usr/include/sys/types.h" 2 3 4
4653
4654
4655# 1 "/usr/include/machine/endian.h" 1 3 4
4656# 37 "/usr/include/machine/endian.h" 3 4
4657# 1 "/usr/include/i386/endian.h" 1 3 4
4658# 99 "/usr/include/i386/endian.h" 3 4
4659# 1 "/usr/include/sys/_endian.h" 1 3 4
4660# 100 "/usr/include/i386/endian.h" 2 3 4
4661# 38 "/usr/include/machine/endian.h" 2 3 4
4662# 82 "/usr/include/sys/types.h" 2 3 4
4663
4664
4665typedef unsigned char u_char;
4666typedef unsigned short u_short;
4667typedef unsigned int u_int;
4668
4669typedef unsigned long u_long;
4670
4671
4672typedef unsigned short ushort;
4673typedef unsigned int uint;
4674
4675
4676typedef u_int64_t u_quad_t;
4677typedef int64_t quad_t;
4678typedef quad_t * qaddr_t;
4679
4680typedef char * caddr_t;
4681typedef int32_t daddr_t;
4682
4683
4684typedef __darwin_dev_t dev_t;
4685
4686
4687
4688typedef u_int32_t fixpt_t;
4689
4690
4691typedef __darwin_blkcnt_t blkcnt_t;
4692
4693
4694
4695
4696typedef __darwin_blksize_t blksize_t;
4697
4698
4699
4700
4701typedef __darwin_gid_t gid_t;
4702
4703
4704
4705
4706
4707typedef __uint32_t in_addr_t;
4708
4709
4710
4711
4712typedef __uint16_t in_port_t;
4713
4714
4715
4716typedef __darwin_ino_t ino_t;
4717
4718
4719
4720
4721
4722typedef __darwin_ino64_t ino64_t;
4723
4724
4725
4726
4727
4728
4729typedef __int32_t key_t;
4730
4731
4732
4733typedef __darwin_mode_t mode_t;
4734
4735
4736
4737
4738typedef __uint16_t nlink_t;
4739
4740
4741
4742
4743
4744typedef __darwin_id_t id_t;
4745
4746
4747
4748typedef __darwin_pid_t pid_t;
4749# 176 "/usr/include/sys/types.h" 3 4
4750typedef int32_t segsz_t;
4751typedef int32_t swblk_t;
4752
4753
4754typedef __darwin_uid_t uid_t;
4755# 223 "/usr/include/sys/types.h" 3 4
4756typedef __darwin_clock_t clock_t;
4757# 240 "/usr/include/sys/types.h" 3 4
4758typedef __darwin_time_t time_t;
4759
4760
4761
4762
4763typedef __darwin_useconds_t useconds_t;
4764
4765
4766
4767
4768typedef __darwin_suseconds_t suseconds_t;
4769# 260 "/usr/include/sys/types.h" 3 4
4770# 1 "/usr/include/sys/_structs.h" 1 3 4
4771# 183 "/usr/include/sys/_structs.h" 3 4
4772
4773typedef struct fd_set {
4774 __int32_t fds_bits[((((1024) % ((sizeof(__int32_t) * 8))) == 0) ? ((1024) / ((sizeof(__int32_t) * 8))) : (((1024) / ((sizeof(__int32_t) * 8))) + 1))];
4775} fd_set;
4776
4777
4778
4779static __inline int
4780__darwin_fd_isset(int _n, const struct fd_set *_p)
4781{
4782 return (_p->fds_bits[_n/(sizeof(__int32_t) * 8)] & (1<<(_n % (sizeof(__int32_t) * 8))));
4783}
4784# 261 "/usr/include/sys/types.h" 2 3 4
4785
4786
4787
4788
4789typedef __int32_t fd_mask;
4790# 318 "/usr/include/sys/types.h" 3 4
4791typedef __darwin_pthread_attr_t pthread_attr_t;
4792
4793
4794
4795typedef __darwin_pthread_cond_t pthread_cond_t;
4796
4797
4798
4799typedef __darwin_pthread_condattr_t pthread_condattr_t;
4800
4801
4802
4803typedef __darwin_pthread_mutex_t pthread_mutex_t;
4804
4805
4806
4807typedef __darwin_pthread_mutexattr_t pthread_mutexattr_t;
4808
4809
4810
4811typedef __darwin_pthread_once_t pthread_once_t;
4812
4813
4814
4815typedef __darwin_pthread_rwlock_t pthread_rwlock_t;
4816
4817
4818
4819typedef __darwin_pthread_rwlockattr_t pthread_rwlockattr_t;
4820
4821
4822
4823typedef __darwin_pthread_t pthread_t;
4824
4825
4826
4827
4828
4829
4830typedef __darwin_pthread_key_t pthread_key_t;
4831
4832
4833
4834
4835
4836typedef __darwin_fsblkcnt_t fsblkcnt_t;
4837
4838
4839
4840
4841typedef __darwin_fsfilcnt_t fsfilcnt_t;
4842# 29 "./../include/mach-o/ranlib.h" 2
4843# 58 "./../include/mach-o/ranlib.h"
4844struct ranlib {
4845    union {
4846 uint32_t ran_strx;
4847
4848
4849
4850    } ran_un;
4851    uint32_t ran_off;
4852};
4853# 57 "./../include/stuff/bytesex.h" 2
4854# 1 "./../include/stuff/bool.h" 1
4855# 41 "./../include/stuff/bool.h"
4856enum bool {
4857    FALSE,
4858    TRUE
4859};
4860# 58 "./../include/stuff/bytesex.h" 2
4861
4862enum byte_sex {
4863    UNKNOWN_BYTE_SEX,
4864    BIG_ENDIAN_BYTE_SEX,
4865    LITTLE_ENDIAN_BYTE_SEX
4866};
4867# 79 "./../include/stuff/bytesex.h"
4868__private_extern__ long long SWAP_LONG_LONG(
4869    long long ll);
4870
4871__private_extern__ float SWAP_FLOAT(
4872    float f);
4873
4874__private_extern__ double SWAP_DOUBLE(
4875    double d);
4876
4877__private_extern__ enum byte_sex get_host_byte_sex(
4878    void);
4879
4880__private_extern__ void swap_fat_header(
4881    struct fat_header *fat_header,
4882    enum byte_sex target_byte_sex);
4883
4884__private_extern__ void swap_fat_arch(
4885    struct fat_arch *fat_archs,
4886    uint32_t nfat_arch,
4887    enum byte_sex target_byte_sex);
4888
4889__private_extern__ void swap_mach_header(
4890    struct mach_header *mh,
4891    enum byte_sex target_byte_sex);
4892
4893__private_extern__ void swap_mach_header_64(
4894    struct mach_header_64 *mh,
4895    enum byte_sex target_byte_sex);
4896
4897__private_extern__ void swap_load_command(
4898    struct load_command *lc,
4899    enum byte_sex target_byte_sex);
4900
4901__private_extern__ void swap_segment_command(
4902    struct segment_command *sg,
4903    enum byte_sex target_byte_sex);
4904
4905__private_extern__ void swap_segment_command_64(
4906    struct segment_command_64 *sg,
4907    enum byte_sex target_byte_sex);
4908
4909__private_extern__ void swap_section(
4910    struct section *s,
4911    uint32_t nsects,
4912    enum byte_sex target_byte_sex);
4913
4914__private_extern__ void swap_section_64(
4915    struct section_64 *s,
4916    uint32_t nsects,
4917    enum byte_sex target_byte_sex);
4918
4919__private_extern__ void swap_symtab_command(
4920    struct symtab_command *st,
4921    enum byte_sex target_byte_sex);
4922
4923__private_extern__ void swap_dysymtab_command(
4924    struct dysymtab_command *dyst,
4925    enum byte_sex target_byte_sex);
4926
4927__private_extern__ void swap_symseg_command(
4928    struct symseg_command *ss,
4929    enum byte_sex target_byte_sex);
4930
4931__private_extern__ void swap_fvmlib_command(
4932    struct fvmlib_command *fl,
4933    enum byte_sex target_byte_sex);
4934
4935__private_extern__ void swap_dylib_command(
4936    struct dylib_command *dl,
4937    enum byte_sex target_byte_sex);
4938
4939__private_extern__ void swap_sub_framework_command(
4940    struct sub_framework_command *sub,
4941    enum byte_sex target_byte_sex);
4942
4943__private_extern__ void swap_sub_umbrella_command(
4944    struct sub_umbrella_command *usub,
4945    enum byte_sex target_byte_sex);
4946
4947__private_extern__ void swap_sub_library_command(
4948    struct sub_library_command *lsub,
4949    enum byte_sex target_byte_sex);
4950
4951__private_extern__ void swap_sub_client_command(
4952    struct sub_client_command *csub,
4953    enum byte_sex target_byte_sex);
4954
4955__private_extern__ void swap_prebound_dylib_command(
4956    struct prebound_dylib_command *pbdylib,
4957    enum byte_sex target_byte_sex);
4958
4959__private_extern__ void swap_dylinker_command(
4960    struct dylinker_command *dyld,
4961    enum byte_sex target_byte_sex);
4962
4963__private_extern__ void swap_fvmfile_command(
4964    struct fvmfile_command *ff,
4965    enum byte_sex target_byte_sex);
4966
4967__private_extern__ void swap_thread_command(
4968    struct thread_command *ut,
4969    enum byte_sex target_byte_sex);
4970
4971__private_extern__ void swap_m68k_thread_state_regs(
4972    struct m68k_thread_state_regs *cpu,
4973    enum byte_sex target_byte_sex);
4974
4975__private_extern__ void swap_m68k_thread_state_68882(
4976    struct m68k_thread_state_68882 *fpu,
4977    enum byte_sex target_byte_sex);
4978
4979__private_extern__ void swap_m68k_thread_state_user_reg(
4980    struct m68k_thread_state_user_reg *user_reg,
4981    enum byte_sex target_byte_sex);
4982
4983__private_extern__ void swap_ppc_thread_state_t(
4984    ppc_thread_state_t *cpu,
4985    enum byte_sex target_byte_sex);
4986
4987__private_extern__ void swap_ppc_thread_state64_t(
4988    ppc_thread_state64_t *cpu,
4989    enum byte_sex target_byte_sex);
4990
4991__private_extern__ void swap_ppc_float_state_t(
4992    ppc_float_state_t *fpu,
4993    enum byte_sex target_byte_sex);
4994
4995__private_extern__ void swap_ppc_exception_state_t(
4996    ppc_exception_state_t *state,
4997    enum byte_sex target_byte_sex);
4998
4999__private_extern__ void swap_m88k_thread_state_grf_t(
5000    m88k_thread_state_grf_t *cpu,
5001    enum byte_sex target_byte_sex);
5002
5003__private_extern__ void swap_m88k_thread_state_xrf_t(
5004    m88k_thread_state_xrf_t *fpu,
5005    enum byte_sex target_byte_sex);
5006
5007__private_extern__ void swap_m88k_thread_state_user_t(
5008    m88k_thread_state_user_t *user,
5009    enum byte_sex target_byte_sex);
5010
5011__private_extern__ void swap_m88110_thread_state_impl_t(
5012    m88110_thread_state_impl_t *spu,
5013    enum byte_sex target_byte_sex);
5014
5015__private_extern__ void swap_i860_thread_state_regs(
5016    struct i860_thread_state_regs *cpu,
5017    enum byte_sex target_byte_sex);
5018
5019__private_extern__ void swap_i386_thread_state(
5020    i386_thread_state_t *cpu,
5021    enum byte_sex target_byte_sex);
5022
5023
5024
5025__private_extern__ void swap_i386_float_state(
5026    struct __darwin_i386_float_state *fpu,
5027    enum byte_sex target_byte_sex);
5028
5029__private_extern__ void swap_i386_exception_state(
5030    i386_exception_state_t *exc,
5031    enum byte_sex target_byte_sex);
5032# 261 "./../include/stuff/bytesex.h"
5033__private_extern__ void swap_x86_thread_state64(
5034    x86_thread_state64_t *cpu,
5035    enum byte_sex target_byte_sex);
5036
5037__private_extern__ void swap_x86_float_state64(
5038    x86_float_state64_t *fpu,
5039    enum byte_sex target_byte_sex);
5040
5041__private_extern__ void swap_x86_state_hdr(
5042    struct x86_state_hdr *hdr,
5043    enum byte_sex target_byte_sex);
5044
5045__private_extern__ void swap_x86_exception_state64(
5046    x86_exception_state64_t *exc,
5047    enum byte_sex target_byte_sex);
5048
5049__private_extern__ void swap_x86_debug_state32(
5050    x86_debug_state32_t *debug,
5051    enum byte_sex target_byte_sex);
5052
5053__private_extern__ void swap_x86_debug_state64(
5054    x86_debug_state64_t *debug,
5055    enum byte_sex target_byte_sex);
5056
5057
5058__private_extern__ void swap_hppa_integer_thread_state(
5059    struct hp_pa_integer_thread_state *regs,
5060    enum byte_sex target_byte_order);
5061
5062__private_extern__ void swap_hppa_frame_thread_state(
5063  struct hp_pa_frame_thread_state *frame,
5064  enum byte_sex target_byte_order);
5065
5066__private_extern__ void swap_hppa_fp_thread_state(
5067  struct hp_pa_fp_thread_state *fp,
5068  enum byte_sex target_byte_order);
5069
5070__private_extern__ void swap_sparc_thread_state_regs(
5071  struct sparc_thread_state_regs *cpu,
5072  enum byte_sex target_byte_order);
5073
5074__private_extern__ void swap_sparc_thread_state_fpu(
5075  struct sparc_thread_state_fpu *fpu,
5076  enum byte_sex target_byte_order);
5077
5078__private_extern__ void swap_arm_thread_state_t(
5079    arm_thread_state_t *cpu,
5080    enum byte_sex target_byte_sex);
5081
5082__private_extern__ void swap_ident_command(
5083    struct ident_command *id_cmd,
5084    enum byte_sex target_byte_sex);
5085
5086__private_extern__ void swap_routines_command(
5087    struct routines_command *r_cmd,
5088    enum byte_sex target_byte_sex);
5089
5090__private_extern__ void swap_routines_command_64(
5091    struct routines_command_64 *r_cmd,
5092    enum byte_sex target_byte_sex);
5093
5094__private_extern__ void swap_twolevel_hints_command(
5095    struct twolevel_hints_command *hints_cmd,
5096    enum byte_sex target_byte_sex);
5097
5098__private_extern__ void swap_prebind_cksum_command(
5099    struct prebind_cksum_command *cksum_cmd,
5100    enum byte_sex target_byte_sex);
5101
5102__private_extern__ void swap_uuid_command(
5103    struct uuid_command *uuid_cmd,
5104    enum byte_sex target_byte_sex);
5105
5106__private_extern__ void swap_linkedit_data_command(
5107    struct linkedit_data_command *ld,
5108    enum byte_sex target_byte_sex);
5109
5110__private_extern__ void swap_version_min_command(
5111    struct version_min_command *ver_cmd,
5112    enum byte_sex target_byte_sex);
5113
5114__private_extern__ void swap_rpath_command(
5115    struct rpath_command *rpath_cmd,
5116    enum byte_sex target_byte_sex);
5117
5118__private_extern__ void swap_encryption_command(
5119    struct encryption_info_command *ec,
5120    enum byte_sex target_byte_sex);
5121
5122__private_extern__ void swap_dyld_info_command(
5123    struct dyld_info_command *dc,
5124    enum byte_sex target_byte_sex);
5125
5126__private_extern__ void swap_entry_point_command(
5127    struct entry_point_command *ep,
5128    enum byte_sex target_byte_sex);
5129
5130__private_extern__ void swap_source_version_command(
5131    struct source_version_command *sv,
5132    enum byte_sex target_byte_sex);
5133
5134__private_extern__ void swap_nlist(
5135    struct nlist *symbols,
5136    uint32_t nsymbols,
5137    enum byte_sex target_byte_sex);
5138
5139__private_extern__ void swap_nlist_64(
5140    struct nlist_64 *symbols,
5141    uint32_t nsymbols,
5142    enum byte_sex target_byte_sex);
5143
5144__private_extern__ void swap_ranlib(
5145    struct ranlib *ranlibs,
5146    uint32_t nranlibs,
5147    enum byte_sex target_byte_sex);
5148
5149__private_extern__ void swap_relocation_info(
5150    struct relocation_info *relocs,
5151    uint32_t nrelocs,
5152    enum byte_sex target_byte_sex);
5153
5154__private_extern__ void swap_indirect_symbols(
5155    uint32_t *indirect_symbols,
5156    uint32_t nindirect_symbols,
5157    enum byte_sex target_byte_sex);
5158
5159__private_extern__ void swap_dylib_reference(
5160    struct dylib_reference *refs,
5161    uint32_t nrefs,
5162    enum byte_sex target_byte_sex);
5163
5164__private_extern__ void swap_dylib_module(
5165    struct dylib_module *mods,
5166    uint32_t nmods,
5167    enum byte_sex target_byte_sex);
5168
5169__private_extern__ void swap_dylib_module_64(
5170    struct dylib_module_64 *mods,
5171    uint32_t nmods,
5172    enum byte_sex target_byte_sex);
5173
5174__private_extern__ void swap_dylib_table_of_contents(
5175    struct dylib_table_of_contents *tocs,
5176    uint32_t ntocs,
5177    enum byte_sex target_byte_sex);
5178
5179__private_extern__ void swap_twolevel_hint(
5180    struct twolevel_hint *hints,
5181    uint32_t nhints,
5182    enum byte_sex target_byte_sex);
5183
5184
5185
5186
5187
5188
5189
5190__private_extern__ enum bool swap_object_headers(
5191    void *mach_header,
5192    struct load_command *load_commands);
5193
5194
5195
5196
5197
5198
5199
5200__private_extern__ enum byte_sex get_toc_byte_sex(
5201    char *addr,
5202    uint32_t size);
5203# 37 "print_objc.c" 2
5204# 1 "./../include/stuff/symbol.h" 1
5205
5206
5207
5208
5209
5210struct symbol {
5211    char *name;
5212    char *indr_name;
5213    uint64_t n_value;
5214    int is_thumb;
5215};
5216# 38 "print_objc.c" 2
5217# 1 "ofile_print.h" 1
5218# 31 "ofile_print.h"
5219# 1 "/usr/include/ar.h" 1 3 4
5220# 56 "/usr/include/ar.h" 3 4
5221struct ar_hdr {
5222 char ar_name[16];
5223 char ar_date[12];
5224 char ar_uid[6];
5225 char ar_gid[6];
5226 char ar_mode[8];
5227 char ar_size[10];
5228
5229 char ar_fmag[2];
5230};
5231# 32 "ofile_print.h" 2
5232# 40 "ofile_print.h"
5233extern void print_fat_headers(
5234    struct fat_header *fat_header,
5235    struct fat_arch *fat_archs,
5236    uint32_t size,
5237    enum bool verbose);
5238
5239extern void print_ar_hdr(
5240    struct ar_hdr *ar_hdr,
5241    char *member_name,
5242    uint32_t member_name_size,
5243    uint32_t member_offset,
5244    enum bool verbose,
5245    enum bool print_offset);
5246
5247extern void print_library_toc(
5248    struct ar_hdr *toc_ar_hdr,
5249    char *toc_name,
5250    uint32_t toc_name_size,
5251    char *toc_addr,
5252    uint32_t toc_size,
5253    enum byte_sex toc_byte_sex,
5254    char *library_name,
5255    char *library_addr,
5256    uint32_t library_size,
5257    char *arch_name,
5258    enum bool verbose);
5259
5260extern void print_mach_header(
5261    uint32_t magic,
5262    cpu_type_t cputype,
5263    cpu_subtype_t cpusubtype,
5264    uint32_t filetype,
5265    uint32_t ncmds,
5266    uint32_t sizeofcmds,
5267    uint32_t flags,
5268    enum bool verbose);
5269
5270extern void print_loadcmds(
5271    struct load_command *load_commands,
5272    uint32_t ncmds,
5273    uint32_t sizeofcmds,
5274    cpu_type_t cputype,
5275    uint32_t filetype,
5276    enum byte_sex load_commands_byte_sex,
5277    uint32_t object_size,
5278    enum bool verbose,
5279    enum bool very_verbose);
5280
5281extern void print_libraries(
5282    struct load_command *load_commands,
5283    uint32_t ncmds,
5284    uint32_t sizeofcmds,
5285    enum byte_sex load_commands_byte_sex,
5286    enum bool just_id,
5287    enum bool verbose);
5288
5289extern void print_reloc(
5290    struct load_command *load_commands,
5291    uint32_t ncmds,
5292    uint32_t sizeofcmds,
5293    cpu_type_t cputype,
5294    enum byte_sex load_commands_byte_sex,
5295    char *object_addr,
5296    uint32_t object_size,
5297    struct nlist *symbols,
5298    struct nlist_64 *symbols64,
5299    uint32_t nsymbols,
5300    char *strings,
5301    uint32_t strings_size,
5302    enum bool verbose);
5303
5304extern void print_toc(
5305    struct load_command *load_commands,
5306    uint32_t ncmds,
5307    uint32_t sizeofcmds,
5308    enum byte_sex load_commands_byte_sex,
5309    char *object_addr,
5310    uint32_t object_size,
5311    struct dylib_table_of_contents *tocs,
5312    uint32_t ntocs,
5313    struct dylib_module *mods,
5314    struct dylib_module_64 *mods64,
5315    uint32_t nmods,
5316    struct nlist *symbols,
5317    struct nlist_64 *symbols64,
5318    uint32_t nsymbols,
5319    char *strings,
5320    uint32_t strings_size,
5321    enum bool verbose);
5322
5323extern void print_module_table(
5324    struct dylib_module *mods,
5325    uint32_t nmods,
5326    char *strings,
5327    uint32_t strings_size,
5328    enum bool verbose);
5329
5330extern void print_module_table_64(
5331    struct dylib_module_64 *mods64,
5332    uint32_t nmods,
5333    char *strings,
5334    uint32_t strings_size,
5335    enum bool verbose);
5336
5337void print_refs(
5338    struct dylib_reference *refs,
5339    uint32_t nrefs,
5340    struct dylib_module *mods,
5341    struct dylib_module_64 *mods64,
5342    uint32_t nmods,
5343    struct nlist *symbols,
5344    struct nlist_64 *symbols64,
5345    uint32_t nsymbols,
5346    char *strings,
5347    uint32_t strings_size,
5348    enum bool verbose);
5349
5350extern void print_indirect_symbols(
5351    struct load_command *load_commands,
5352    uint32_t ncmds,
5353    uint32_t sizeofcmds,
5354    cpu_type_t cputype,
5355    enum byte_sex load_commands_byte_sex,
5356    uint32_t *indirect_symbols,
5357    uint32_t nindirect_symbols,
5358    struct nlist *symbols,
5359    struct nlist_64 *symbols64,
5360    uint32_t nsymbols,
5361    char *strings,
5362    uint32_t strings_size,
5363    enum bool verbose);
5364
5365extern void print_hints(
5366    struct load_command *load_commands,
5367    uint32_t ncmds,
5368    uint32_t sizeofcmds,
5369    enum byte_sex load_commands_byte_sex,
5370    struct twolevel_hint *hints,
5371    uint32_t nhints,
5372    struct nlist *symbols,
5373    struct nlist_64 *symbols64,
5374    uint32_t nsymbols,
5375    char *strings,
5376    uint32_t strings_size,
5377    enum bool verbose);
5378
5379extern void print_segment_command(
5380    uint32_t cmd,
5381    uint32_t cmdsize,
5382    char *segname,
5383    uint64_t vmaddr,
5384    uint64_t vmsize,
5385    uint64_t fileoff,
5386    uint64_t filesize,
5387    vm_prot_t maxprot,
5388    vm_prot_t initprot,
5389    uint32_t nsects,
5390    uint32_t flags,
5391    uint32_t object_size,
5392    enum bool verbose);
5393
5394extern void print_section(
5395    char *sectname,
5396    char *segname,
5397    uint64_t addr,
5398    uint64_t size,
5399    uint32_t offset,
5400    uint32_t align,
5401    uint32_t reloff,
5402    uint32_t nreloc,
5403    uint32_t flags,
5404    uint32_t reserved1,
5405    uint32_t reserved2,
5406    uint32_t cmd,
5407    char *sg_segname,
5408    uint32_t filetype,
5409    uint32_t object_size,
5410    enum bool verbose);
5411
5412extern void print_symtab_command(
5413    struct symtab_command *sg,
5414    cpu_type_t cputype,
5415    uint32_t object_size);
5416
5417extern void print_dysymtab_command(
5418    struct dysymtab_command *dyst,
5419    uint32_t nsyms,
5420    uint32_t object_size,
5421    cpu_type_t cputype);
5422
5423extern void print_symseg_command(
5424    struct symseg_command *ss,
5425    uint32_t object_size);
5426
5427extern void print_fvmlib_command(
5428    struct fvmlib_command *fl,
5429    struct load_command *lc);
5430
5431extern void print_dylib_command(
5432    struct dylib_command *dl,
5433    struct load_command *lc);
5434
5435extern void print_sub_framework_command(
5436    struct sub_framework_command *sub,
5437    struct load_command *lc);
5438
5439extern void print_sub_umbrella_command(
5440    struct sub_umbrella_command *usub,
5441    struct load_command *lc);
5442
5443extern void print_sub_library_command(
5444    struct sub_library_command *lsub,
5445    struct load_command *lc);
5446
5447extern void print_sub_client_command(
5448    struct sub_client_command *csub,
5449    struct load_command *lc);
5450
5451extern void print_prebound_dylib_command(
5452    struct prebound_dylib_command *pbdylib,
5453    struct load_command *lc,
5454    enum bool verbose);
5455
5456extern void print_dylinker_command(
5457    struct dylinker_command *dyld,
5458    struct load_command *lc);
5459
5460extern void print_fvmfile_command(
5461    struct fvmfile_command *ff,
5462    struct load_command *lc);
5463
5464extern void print_routines_command(
5465    struct routines_command *rc);
5466
5467extern void print_routines_command_64(
5468    struct routines_command_64 *rc64);
5469
5470extern void print_twolevel_hints_command(
5471    struct twolevel_hints_command *hints,
5472    uint32_t object_size);
5473
5474extern void print_prebind_cksum_command(
5475    struct prebind_cksum_command *cksum);
5476
5477extern void print_uuid_command(
5478    struct uuid_command *uuid);
5479
5480extern void print_linkedit_data_command(
5481    struct linkedit_data_command *ld,
5482    uint32_t object_size);
5483
5484extern void print_version_min_command(
5485    struct version_min_command *vd);
5486
5487extern void print_source_version_command(
5488    struct source_version_command *sv);
5489
5490extern void print_entry_point_command(
5491    struct entry_point_command *ep);
5492
5493extern void print_rpath_command(
5494    struct rpath_command *rpath,
5495    struct load_command *lc);
5496
5497extern void print_encryption_info_command(
5498    struct encryption_info_command *ec,
5499    uint32_t object_size);
5500
5501extern void print_dyld_info_info_command(
5502    struct dyld_info_command *dc,
5503    uint32_t object_size);
5504
5505extern void print_thread_states(
5506    char *begin,
5507    char *end,
5508    cpu_type_t cputype,
5509    enum byte_sex thread_states_byte_sex);
5510
5511extern void print_cstring_section(
5512    cpu_type_t cputype,
5513    char *sect,
5514    uint32_t sect_size,
5515    uint64_t sect_addr,
5516    enum bool print_addresses);
5517
5518extern void print_literal4_section(
5519    char *sect,
5520    uint32_t sect_size,
5521    uint32_t sect_addr,
5522    enum byte_sex literal_byte_sex,
5523    enum bool print_addresses);
5524
5525extern void print_literal8_section(
5526    char *sect,
5527    uint32_t sect_size,
5528    uint32_t sect_addr,
5529    enum byte_sex literal_byte_sex,
5530    enum bool print_addresses);
5531
5532extern void print_literal16_section(
5533    char *sect,
5534    uint32_t sect_size,
5535    uint32_t sect_addr,
5536    enum byte_sex literal_byte_sex,
5537    enum bool print_addresses);
5538
5539extern void print_literal_pointer_section(
5540    struct load_command *lc,
5541    uint32_t ncmds,
5542    uint32_t sizeofcmds,
5543    enum byte_sex object_byte_sex,
5544    char *addr,
5545    uint32_t size,
5546    char *sect,
5547    uint32_t sect_size,
5548    uint32_t sect_addr,
5549    struct nlist *symbols,
5550    struct nlist_64 *symbols64,
5551    uint32_t nsymbols,
5552    char *strings,
5553    uint32_t strings_size,
5554    struct relocation_info *relocs,
5555    uint32_t nrelocs,
5556    enum bool print_addresses);
5557
5558extern void print_init_term_pointer_section(
5559    cpu_type_t cputype,
5560    char *sect,
5561    uint32_t sect_size,
5562    uint64_t sect_addr,
5563    enum byte_sex object_byte_sex,
5564    struct symbol *sorted_symbols,
5565    uint32_t nsorted_symbols,
5566    enum bool verbose);
5567
5568extern void print_shlib_init(
5569    enum byte_sex object_byte_sex,
5570    char *sect,
5571    uint32_t sect_size,
5572    uint32_t sect_addr,
5573    struct symbol *sorted_symbols,
5574    uint32_t nsorted_symbols,
5575    struct nlist *symbols,
5576    struct nlist_64 *symbols64,
5577    uint32_t nsymbols,
5578    char *strings,
5579    uint32_t strings_size,
5580    struct relocation_info *relocs,
5581    uint32_t nrelocs,
5582    enum bool verbose);
5583
5584extern enum bool print_symbol(
5585    uint64_t value,
5586    uint32_t r_address,
5587    uint32_t dot_value,
5588    struct relocation_info *sorted_relocs,
5589    uint32_t nsorted_relocs,
5590    struct nlist *symbols,
5591    struct nlist_64 *symbols64,
5592    uint32_t nsymbols,
5593    struct symbol *sorted_symbols,
5594    uint32_t nsorted_symbols,
5595    char *strings,
5596    uint32_t strings_size,
5597    enum bool verbose);
5598
5599extern const char *guess_symbol(
5600    const uint64_t value,
5601    const struct symbol *sorted_symbols,
5602    const uint32_t nsorted_symbols,
5603    const enum bool verbose);
5604
5605extern const char * guess_indirect_symbol(
5606    const uint64_t value,
5607    const uint32_t ncmds,
5608    const uint32_t sizeofcmds,
5609    const struct load_command *load_commands,
5610    const enum byte_sex load_commands_byte_sex,
5611    const uint32_t *indirect_symbols,
5612    const uint32_t nindirect_symbols,
5613    const struct nlist *symbols,
5614    const struct nlist_64 *symbols64,
5615    const uint32_t nsymbols,
5616    const char *strings,
5617    const uint32_t strings_size);
5618
5619extern void print_sect(
5620    cpu_type_t cputype,
5621    enum byte_sex object_byte_sex,
5622    char *sect,
5623    uint64_t size,
5624    uint64_t addr);
5625
5626extern enum bool print_objc_segment(
5627    cpu_type_t mh_cputype,
5628    struct load_command *load_commands,
5629    uint32_t ncmds,
5630    uint32_t sizeofcmds,
5631    enum byte_sex object_byte_sex,
5632    char *object_addr,
5633    uint32_t object_size,
5634    struct symbol *sorted_symbols,
5635    uint32_t nsorted_symbols,
5636    enum bool verbose);
5637
5638extern void print_objc2_64bit(
5639    cpu_type_t cputype,
5640    struct load_command *load_commands,
5641    uint32_t ncmds,
5642    uint32_t sizeofcmds,
5643    enum byte_sex object_byte_sex,
5644    char *object_addr,
5645    uint32_t object_size,
5646    struct nlist_64 *symbols64,
5647    uint32_t nsymbols,
5648    char *strings,
5649    uint32_t strings_size,
5650    struct symbol *sorted_symbols,
5651    uint32_t nsorted_symbols,
5652    struct relocation_info *ext_relocs,
5653    uint32_t next_relocs,
5654    struct relocation_info *loc_relocs,
5655    uint32_t nloc_relocs,
5656    enum bool verbose,
5657    enum bool Vflag);
5658
5659extern void print_objc2_32bit(
5660    cpu_type_t cputype,
5661    struct load_command *load_commands,
5662    uint32_t ncmds,
5663    uint32_t sizeofcmds,
5664    enum byte_sex object_byte_sex,
5665    char *object_addr,
5666    uint32_t object_size,
5667    struct nlist *symbols,
5668    uint32_t nsymbols,
5669    char *strings,
5670    uint32_t strings_size,
5671    struct symbol *sorted_symbols,
5672    uint32_t nsorted_symbols,
5673    struct relocation_info *ext_relocs,
5674    uint32_t next_relocs,
5675    struct relocation_info *loc_relocs,
5676    uint32_t nloc_relocs,
5677    enum bool verbose);
5678
5679extern void print_objc_protocol_section(
5680    struct load_command *load_commands,
5681    uint32_t ncmds,
5682    uint32_t sizeofcmds,
5683    enum byte_sex object_byte_sex,
5684    char *object_addr,
5685    uint32_t object_size,
5686    enum bool verbose);
5687
5688extern void print_objc_string_object_section(
5689    char *sectname,
5690    struct load_command *load_commands,
5691    uint32_t ncmds,
5692    uint32_t sizeofcmds,
5693    enum byte_sex object_byte_sex,
5694    char *object_addr,
5695    uint32_t object_size,
5696    enum bool verbose);
5697
5698extern void print_objc_string_object_section_64(
5699    char *sectname,
5700    struct load_command *load_commands,
5701    uint32_t ncmds,
5702    uint32_t sizeofcmds,
5703    enum byte_sex object_byte_sex,
5704    char *object_addr,
5705    uint32_t object_size,
5706    cpu_type_t cputype,
5707    struct nlist_64 *symbols64,
5708    uint32_t nsymbols,
5709    char *strings,
5710    const uint32_t strings_size,
5711    struct symbol *sorted_symbols,
5712    uint32_t nsorted_symbols,
5713    enum bool verbose);
5714
5715extern void print_objc_runtime_setup_section(
5716    struct load_command *load_commands,
5717    uint32_t ncmds,
5718    uint32_t sizeofcmds,
5719    enum byte_sex object_byte_sex,
5720    char *object_addr,
5721    uint32_t object_size,
5722    enum bool verbose);
5723
5724extern void print_coff_reloc_section(
5725    struct load_command *load_commands,
5726    uint32_t ncmds,
5727    uint32_t sizeofcmds,
5728    uint32_t filetype,
5729    enum byte_sex object_byte_sex,
5730    char *object_addr,
5731    uint32_t object_size,
5732    enum bool verbose);
5733
5734extern void print_label(
5735    uint64_t addr,
5736    enum bool colon_and_newline,
5737    struct symbol *sorted_symbols,
5738    uint32_t nsorted_symbols);
5739
5740extern enum bool get_sect_info(
5741    char *segname,
5742    char *sectname,
5743    struct load_command *load_commands,
5744    uint32_t ncmds,
5745    uint32_t sizeofcmds,
5746    uint32_t filetype,
5747    enum byte_sex load_commands_byte_sex,
5748    char *object_addr,
5749    uint32_t object_size,
5750    char **sect_pointer,
5751    uint64_t *sect_size,
5752    uint64_t *sect_addr,
5753    struct relocation_info **sect_relocs,
5754    uint32_t *sect_nrelocs,
5755    uint32_t *sect_flags);
5756# 39 "print_objc.c" 2
5757# 49 "print_objc.c"
5758struct objc_module_t {
5759    uint32_t version;
5760    uint32_t size;
5761    uint32_t name;
5762    uint32_t symtab;
5763};
5764
5765struct objc_symtab_t {
5766    uint32_t sel_ref_cnt;
5767    uint32_t refs;
5768    uint16_t cls_def_cnt;
5769    uint16_t cat_def_cnt;
5770    uint32_t defs[1];
5771};
5772
5773struct objc_class_t {
5774    uint32_t isa;
5775    uint32_t super_class;
5776    uint32_t name;
5777    int32_t version;
5778    int32_t info;
5779    int32_t instance_size;
5780    uint32_t ivars;
5781    uint32_t methodLists;
5782    uint32_t cache;
5783    uint32_t protocols;
5784};
5785
5786struct objc_category_t {
5787    uint32_t category_name;
5788    uint32_t class_name;
5789    uint32_t instance_methods;
5790    uint32_t class_methods;
5791    uint32_t protocols;
5792};
5793
5794struct objc_ivar_t {
5795    uint32_t ivar_name;
5796    uint32_t ivar_type;
5797    int32_t ivar_offset;
5798};
5799
5800struct objc_ivar_list_t {
5801    int32_t ivar_count;
5802    struct objc_ivar_t ivar_list[1];
5803};
5804
5805struct objc_method_t {
5806    uint32_t method_name;
5807    uint32_t method_types;
5808    uint32_t method_imp;
5809
5810};
5811
5812struct objc_method_list_t {
5813    uint32_t obsolete;
5814    int32_t method_count;
5815    struct objc_method_t method_list[1];
5816};
5817
5818struct objc_protocol_t {
5819    uint32_t isa;
5820    uint32_t protocol_name;
5821    uint32_t protocol_list;
5822
5823    uint32_t instance_methods;
5824
5825    uint32_t class_methods;
5826
5827};
5828
5829struct objc_protocol_list_t {
5830    uint32_t next;
5831    int32_t count;
5832    uint32_t list[1];
5833
5834};
5835
5836struct objc_method_description_t {
5837    uint32_t name;
5838    uint32_t types;
5839};
5840
5841struct objc_method_description_list_t {
5842    int32_t count;
5843    struct objc_method_description_t list[1];
5844};
5845
5846
5847
5848
5849
5850
5851struct objc_string_object_t {
5852    uint32_t isa;
5853    uint32_t characters;
5854    uint32_t _length;
5855};
5856typedef struct objc_string_object_t NXConstantString;
5857
5858
5859struct _hashEntry_t {
5860    uint32_t next;
5861    uint32_t sel;
5862};
5863
5864struct imageInfo_t {
5865    uint32_t version;
5866    uint32_t flags;
5867};
5868
5869static
5870void
5871swap_imageInfo_t(
5872struct imageInfo_t *o,
5873enum byte_sex target_byte_sex)
5874{
5875 o->version = ( ((o->version) << 24) | (((o->version) << 8) & 0x00ff0000) | (((o->version) >> 8) & 0x0000ff00) | ((unsigned int)(o->version) >> 24) );
5876 o->flags = ( ((o->flags) << 24) | (((o->flags) << 8) & 0x00ff0000) | (((o->flags) >> 8) & 0x0000ff00) | ((unsigned int)(o->flags) >> 24) );
5877}
5878
5879void
5880swap_objc_module_t(
5881struct objc_module_t *module,
5882enum byte_sex target_byte_sex)
5883{
5884 module->version = ( ((module->version) << 24) | (((module->version) << 8) & 0x00ff0000) | (((module->version) >> 8) & 0x0000ff00) | ((unsigned int)(module->version) >> 24) );
5885 module->size = ( ((module->size) << 24) | (((module->size) << 8) & 0x00ff0000) | (((module->size) >> 8) & 0x0000ff00) | ((unsigned int)(module->size) >> 24) );
5886 module->name = ( ((module->name) << 24) | (((module->name) << 8) & 0x00ff0000) | (((module->name) >> 8) & 0x0000ff00) | ((unsigned int)(module->name) >> 24) );
5887 module->symtab = ( ((module->symtab) << 24) | (((module->symtab) << 8) & 0x00ff0000) | (((module->symtab) >> 8) & 0x0000ff00) | ((unsigned int)(module->symtab) >> 24) );
5888}
5889
5890void
5891swap_objc_symtab_t(
5892struct objc_symtab_t *symtab,
5893enum byte_sex target_byte_sex)
5894{
5895 symtab->sel_ref_cnt = ( ((symtab->sel_ref_cnt) << 24) | (((symtab->sel_ref_cnt) << 8) & 0x00ff0000) | (((symtab->sel_ref_cnt) >> 8) & 0x0000ff00) | ((unsigned int)(symtab->sel_ref_cnt) >> 24) );
5896 symtab->refs = ( ((symtab->refs) << 24) | (((symtab->refs) << 8) & 0x00ff0000) | (((symtab->refs) >> 8) & 0x0000ff00) | ((unsigned int)(symtab->refs) >> 24) );
5897 symtab->cls_def_cnt = ( ((symtab->cls_def_cnt & 0xff) << 8) | ((unsigned short)(symtab->cls_def_cnt) >> 8) );
5898 symtab->cat_def_cnt = ( ((symtab->cat_def_cnt & 0xff) << 8) | ((unsigned short)(symtab->cat_def_cnt) >> 8) );
5899}
5900
5901void
5902swap_objc_class_t(
5903struct objc_class_t *objc_class,
5904enum byte_sex target_byte_sex)
5905{
5906 objc_class->isa = ( ((objc_class->isa) << 24) | (((objc_class->isa) << 8) & 0x00ff0000) | (((objc_class->isa) >> 8) & 0x0000ff00) | ((unsigned int)(objc_class->isa) >> 24) );
5907 objc_class->super_class = ( ((objc_class->super_class) << 24) | (((objc_class->super_class) << 8) & 0x00ff0000) | (((objc_class->super_class) >> 8) & 0x0000ff00) | ((unsigned int)(objc_class->super_class) >> 24) );
5908 objc_class->name = ( ((objc_class->name) << 24) | (((objc_class->name) << 8) & 0x00ff0000) | (((objc_class->name) >> 8) & 0x0000ff00) | ((unsigned int)(objc_class->name) >> 24) );
5909 objc_class->version = ( ((objc_class->version) << 24) | (((objc_class->version) << 8) & 0x00ff0000) | (((objc_class->version) >> 8) & 0x0000ff00) | ((unsigned int)(objc_class->version) >> 24) );
5910 objc_class->info = ( ((objc_class->info) << 24) | (((objc_class->info) << 8) & 0x00ff0000) | (((objc_class->info) >> 8) & 0x0000ff00) | ((unsigned int)(objc_class->info) >> 24) );
5911 objc_class->instance_size = ( ((objc_class->instance_size) << 24) | (((objc_class->instance_size) << 8) & 0x00ff0000) | (((objc_class->instance_size) >> 8) & 0x0000ff00) | ((unsigned int)(objc_class->instance_size) >> 24) );
5912 objc_class->ivars = ( ((objc_class->ivars) << 24) | (((objc_class->ivars) << 8) & 0x00ff0000) | (((objc_class->ivars) >> 8) & 0x0000ff00) | ((unsigned int)(objc_class->ivars) >> 24) );
5913 objc_class->methodLists = ( ((objc_class->methodLists) << 24) | (((objc_class->methodLists) << 8) & 0x00ff0000) | (((objc_class->methodLists) >> 8) & 0x0000ff00) | ((unsigned int)(objc_class->methodLists) >> 24) );
5914 objc_class->cache = ( ((objc_class->cache) << 24) | (((objc_class->cache) << 8) & 0x00ff0000) | (((objc_class->cache) >> 8) & 0x0000ff00) | ((unsigned int)(objc_class->cache) >> 24) );
5915 objc_class->protocols = ( ((objc_class->protocols) << 24) | (((objc_class->protocols) << 8) & 0x00ff0000) | (((objc_class->protocols) >> 8) & 0x0000ff00) | ((unsigned int)(objc_class->protocols) >> 24) );
5916}
5917
5918void
5919swap_objc_category_t(
5920struct objc_category_t *objc_category,
5921enum byte_sex target_byte_sex)
5922{
5923 objc_category->category_name = ( ((objc_category->category_name) << 24) | (((objc_category->category_name) << 8) & 0x00ff0000) | (((objc_category->category_name) >> 8) & 0x0000ff00) | ((unsigned int)(objc_category->category_name) >> 24) );
5924 objc_category->class_name = ( ((objc_category->class_name) << 24) | (((objc_category->class_name) << 8) & 0x00ff0000) | (((objc_category->class_name) >> 8) & 0x0000ff00) | ((unsigned int)(objc_category->class_name) >> 24) );
5925 objc_category->instance_methods =
5926  ( ((objc_category->instance_methods) << 24) | (((objc_category->instance_methods) << 8) & 0x00ff0000) | (((objc_category->instance_methods) >> 8) & 0x0000ff00) | ((unsigned int)(objc_category->instance_methods) >> 24) );
5927 objc_category->class_methods =
5928  ( ((objc_category->class_methods) << 24) | (((objc_category->class_methods) << 8) & 0x00ff0000) | (((objc_category->class_methods) >> 8) & 0x0000ff00) | ((unsigned int)(objc_category->class_methods) >> 24) );
5929 objc_category->protocols =
5930  ( ((objc_category->protocols) << 24) | (((objc_category->protocols) << 8) & 0x00ff0000) | (((objc_category->protocols) >> 8) & 0x0000ff00) | ((unsigned int)(objc_category->protocols) >> 24) );
5931}
5932
5933void
5934swap_objc_ivar_list_t(
5935struct objc_ivar_list_t *objc_ivar_list,
5936enum byte_sex target_byte_sex)
5937{
5938 objc_ivar_list->ivar_count = ( ((objc_ivar_list->ivar_count) << 24) | (((objc_ivar_list->ivar_count) << 8) & 0x00ff0000) | (((objc_ivar_list->ivar_count) >> 8) & 0x0000ff00) | ((unsigned int)(objc_ivar_list->ivar_count) >> 24) );
5939}
5940
5941void
5942swap_objc_ivar_t(
5943struct objc_ivar_t *objc_ivar,
5944enum byte_sex target_byte_sex)
5945{
5946 objc_ivar->ivar_name = ( ((objc_ivar->ivar_name) << 24) | (((objc_ivar->ivar_name) << 8) & 0x00ff0000) | (((objc_ivar->ivar_name) >> 8) & 0x0000ff00) | ((unsigned int)(objc_ivar->ivar_name) >> 24) );
5947 objc_ivar->ivar_type = ( ((objc_ivar->ivar_type) << 24) | (((objc_ivar->ivar_type) << 8) & 0x00ff0000) | (((objc_ivar->ivar_type) >> 8) & 0x0000ff00) | ((unsigned int)(objc_ivar->ivar_type) >> 24) );
5948 objc_ivar->ivar_offset = ( ((objc_ivar->ivar_offset) << 24) | (((objc_ivar->ivar_offset) << 8) & 0x00ff0000) | (((objc_ivar->ivar_offset) >> 8) & 0x0000ff00) | ((unsigned int)(objc_ivar->ivar_offset) >> 24) );
5949}
5950
5951void
5952swap_objc_method_list_t(
5953struct objc_method_list_t *method_list,
5954enum byte_sex target_byte_sex)
5955{
5956 method_list->obsolete = ( ((method_list->obsolete) << 24) | (((method_list->obsolete) << 8) & 0x00ff0000) | (((method_list->obsolete) >> 8) & 0x0000ff00) | ((unsigned int)(method_list->obsolete) >> 24) );
5957 method_list->method_count = ( ((method_list->method_count) << 24) | (((method_list->method_count) << 8) & 0x00ff0000) | (((method_list->method_count) >> 8) & 0x0000ff00) | ((unsigned int)(method_list->method_count) >> 24) );
5958}
5959
5960void
5961swap_objc_method_t(
5962struct objc_method_t *method,
5963enum byte_sex target_byte_sex)
5964{
5965 method->method_name = ( ((method->method_name) << 24) | (((method->method_name) << 8) & 0x00ff0000) | (((method->method_name) >> 8) & 0x0000ff00) | ((unsigned int)(method->method_name) >> 24) );
5966 method->method_types = ( ((method->method_types) << 24) | (((method->method_types) << 8) & 0x00ff0000) | (((method->method_types) >> 8) & 0x0000ff00) | ((unsigned int)(method->method_types) >> 24) );
5967 method->method_imp = ( ((method->method_imp) << 24) | (((method->method_imp) << 8) & 0x00ff0000) | (((method->method_imp) >> 8) & 0x0000ff00) | ((unsigned int)(method->method_imp) >> 24) );
5968}
5969
5970void
5971swap_objc_protocol_list_t(
5972struct objc_protocol_list_t *protocol_list,
5973enum byte_sex target_byte_sex)
5974{
5975 protocol_list->next = ( ((protocol_list->next) << 24) | (((protocol_list->next) << 8) & 0x00ff0000) | (((protocol_list->next) >> 8) & 0x0000ff00) | ((unsigned int)(protocol_list->next) >> 24) );
5976 protocol_list->count = ( ((protocol_list->count) << 24) | (((protocol_list->count) << 8) & 0x00ff0000) | (((protocol_list->count) >> 8) & 0x0000ff00) | ((unsigned int)(protocol_list->count) >> 24) );
5977}
5978
5979void
5980swap_objc_protocol_t(
5981struct objc_protocol_t *protocol,
5982enum byte_sex target_byte_sex)
5983{
5984 protocol->isa = ( ((protocol->isa) << 24) | (((protocol->isa) << 8) & 0x00ff0000) | (((protocol->isa) >> 8) & 0x0000ff00) | ((unsigned int)(protocol->isa) >> 24) );
5985 protocol->protocol_name = ( ((protocol->protocol_name) << 24) | (((protocol->protocol_name) << 8) & 0x00ff0000) | (((protocol->protocol_name) >> 8) & 0x0000ff00) | ((unsigned int)(protocol->protocol_name) >> 24) );
5986 protocol->protocol_list = ( ((protocol->protocol_list) << 24) | (((protocol->protocol_list) << 8) & 0x00ff0000) | (((protocol->protocol_list) >> 8) & 0x0000ff00) | ((unsigned int)(protocol->protocol_list) >> 24) );
5987 protocol->instance_methods = ( ((protocol->instance_methods) << 24) | (((protocol->instance_methods) << 8) & 0x00ff0000) | (((protocol->instance_methods) >> 8) & 0x0000ff00) | ((unsigned int)(protocol->instance_methods) >> 24) );
5988 protocol->class_methods = ( ((protocol->class_methods) << 24) | (((protocol->class_methods) << 8) & 0x00ff0000) | (((protocol->class_methods) >> 8) & 0x0000ff00) | ((unsigned int)(protocol->class_methods) >> 24) );
5989}
5990
5991void
5992swap_objc_method_description_list_t(
5993struct objc_method_description_list_t *mdl,
5994enum byte_sex target_byte_sex)
5995{
5996 mdl->count = ( ((mdl->count) << 24) | (((mdl->count) << 8) & 0x00ff0000) | (((mdl->count) >> 8) & 0x0000ff00) | ((unsigned int)(mdl->count) >> 24) );
5997}
5998
5999void
6000swap_objc_method_description_t(
6001struct objc_method_description_t *md,
6002enum byte_sex target_byte_sex)
6003{
6004 md->name = ( ((md->name) << 24) | (((md->name) << 8) & 0x00ff0000) | (((md->name) >> 8) & 0x0000ff00) | ((unsigned int)(md->name) >> 24) );
6005 md->types = ( ((md->types) << 24) | (((md->types) << 8) & 0x00ff0000) | (((md->types) >> 8) & 0x0000ff00) | ((unsigned int)(md->types) >> 24) );
6006}
6007
6008void
6009swap_string_object_t(
6010struct objc_string_object_t *string_object,
6011enum byte_sex target_byte_sex)
6012{
6013 string_object->isa = ( ((string_object->isa) << 24) | (((string_object->isa) << 8) & 0x00ff0000) | (((string_object->isa) >> 8) & 0x0000ff00) | ((unsigned int)(string_object->isa) >> 24) );
6014 string_object->characters = ( ((string_object->characters) << 24) | (((string_object->characters) << 8) & 0x00ff0000) | (((string_object->characters) >> 8) & 0x0000ff00) | ((unsigned int)(string_object->characters) >> 24) );
6015 string_object->_length = ( ((string_object->_length) << 24) | (((string_object->_length) << 8) & 0x00ff0000) | (((string_object->_length) >> 8) & 0x0000ff00) | ((unsigned int)(string_object->_length) >> 24) );
6016}
6017
6018void
6019swap_hashEntry_t(
6020struct _hashEntry_t *_hashEntry,
6021enum byte_sex target_byte_sex)
6022{
6023 _hashEntry->next = ( ((_hashEntry->next) << 24) | (((_hashEntry->next) << 8) & 0x00ff0000) | (((_hashEntry->next) >> 8) & 0x0000ff00) | ((unsigned int)(_hashEntry->next) >> 24) );
6024 _hashEntry->sel = ( ((_hashEntry->sel) << 24) | (((_hashEntry->sel) << 8) & 0x00ff0000) | (((_hashEntry->sel) >> 8) & 0x0000ff00) | ((unsigned int)(_hashEntry->sel) >> 24) );
6025}
6026
6027struct section_info {
6028    char *contents;
6029    uint32_t addr;
6030    uint32_t size;
6031    uint32_t offset;
6032    enum bool protected;
6033    enum bool zerofill;
6034};
6035
6036static void get_objc_sections(
6037    struct load_command *load_commands,
6038    uint32_t ncmds,
6039    uint32_t sizeofcmds,
6040    enum byte_sex object_byte_sex,
6041    char *object_addr,
6042    uint32_t object_size,
6043    struct section_info **objc_sections,
6044    uint32_t *nobjc_sections,
6045    char *sectname,
6046    char **sect,
6047    uint32_t *sect_addr,
6048    uint32_t *sect_size);
6049
6050static void get_cstring_section(
6051    struct load_command *load_commands,
6052    uint32_t ncmds,
6053    uint32_t sizeofcmds,
6054    enum byte_sex object_byte_sex,
6055    char *object_addr,
6056    uint32_t object_size,
6057    struct section_info *cstring_section_ptr);
6058
6059static enum bool print_method_list(
6060    uint32_t addr,
6061    struct section_info *objc_sections,
6062    uint32_t nobjc_sections,
6063    struct section_info *cstring_section_ptr,
6064    enum byte_sex host_byte_sex,
6065    enum bool swapped,
6066    struct symbol *sorted_symbols,
6067    uint32_t nsorted_symbols,
6068    enum bool verbose);
6069
6070static enum bool print_protocol_list(
6071    uint32_t indent,
6072    uint32_t addr,
6073    struct section_info *objc_sections,
6074    uint32_t nobjc_sections,
6075    struct section_info *cstring_section_ptr,
6076    enum byte_sex host_byte_sex,
6077    enum bool swapped,
6078    enum bool verbose);
6079
6080static void print_protocol(
6081    uint32_t indent,
6082    struct objc_protocol_t *protocol,
6083    struct section_info *objc_sections,
6084    uint32_t nobjc_sections,
6085    struct section_info *cstring_section_ptr,
6086    enum byte_sex host_byte_sex,
6087    enum bool swapped,
6088    enum bool verbose);
6089
6090static enum bool print_method_description_list(
6091    uint32_t indent,
6092    uint32_t addr,
6093    struct section_info *objc_sections,
6094    uint32_t nobjc_sections,
6095    struct section_info *cstring_section_ptr,
6096    enum byte_sex host_byte_sex,
6097    enum bool swapped,
6098    enum bool verbose);
6099
6100static enum bool print_PHASH(
6101    uint32_t indent,
6102    uint32_t addr,
6103    struct section_info *objc_sections,
6104    uint32_t nobjc_sections,
6105    struct section_info *cstring_section_ptr,
6106    enum byte_sex host_byte_sex,
6107    enum bool swapped,
6108    enum bool verbose);
6109
6110static void print_indent(
6111    uint32_t indent);
6112
6113static void *get_pointer(
6114    uint32_t addr,
6115    uint32_t *left,
6116    struct section_info *objc_sections,
6117    uint32_t nobjc_sections,
6118    struct section_info *cstring_section_ptr);
6119
6120static enum bool get_symtab(
6121    uint32_t addr,
6122    struct objc_symtab_t *symtab,
6123    uint32_t **defs,
6124    uint32_t *left,
6125    enum bool *trunc,
6126    struct section_info *objc_sections,
6127    uint32_t nobjc_sections,
6128    enum byte_sex host_byte_sex,
6129    enum bool swapped);
6130
6131static enum bool get_objc_class(
6132    uint32_t addr,
6133    struct objc_class_t *objc_class,
6134    enum bool *trunc,
6135    struct section_info *objc_sections,
6136    uint32_t nobjc_sections,
6137    enum byte_sex host_byte_sex,
6138    enum bool swapped);
6139
6140static enum bool get_objc_category(
6141    uint32_t addr,
6142    struct objc_category_t *objc_category,
6143    enum bool *trunc,
6144    struct section_info *objc_sections,
6145    uint32_t nobjc_sections,
6146    enum byte_sex host_byte_sex,
6147    enum bool swapped);
6148
6149static enum bool get_ivar_list(
6150    uint32_t addr,
6151    struct objc_ivar_list_t *objc_ivar_list,
6152    struct objc_ivar_t **ivar_list,
6153    uint32_t *left,
6154    enum bool *trunc,
6155    struct section_info *objc_sections,
6156    uint32_t nobjc_sections,
6157    enum byte_sex host_byte_sex,
6158    enum bool swapped);
6159
6160static enum bool get_method_list(
6161    uint32_t addr,
6162    struct objc_method_list_t *method_list,
6163    struct objc_method_t **methods,
6164    uint32_t *left,
6165    enum bool *trunc,
6166    struct section_info *objc_sections,
6167    uint32_t nobjc_sections,
6168    enum byte_sex host_byte_sex,
6169    enum bool swapped);
6170
6171static enum bool get_protocol_list(
6172    uint32_t addr,
6173    struct objc_protocol_list_t *protocol_list,
6174    uint32_t **list,
6175    uint32_t *left,
6176    enum bool *trunc,
6177    struct section_info *objc_sections,
6178    uint32_t nobjc_sections,
6179    enum byte_sex host_byte_sex,
6180    enum bool swapped);
6181
6182static enum bool get_protocol(
6183    uint32_t addr,
6184    struct objc_protocol_t *protocol,
6185    enum bool *trunc,
6186    struct section_info *objc_sections,
6187    uint32_t nobjc_sections,
6188    enum byte_sex host_byte_sex,
6189    enum bool swapped);
6190
6191static enum bool get_method_description_list(
6192    uint32_t addr,
6193    struct objc_method_description_list_t *mdl,
6194    struct objc_method_description_t **list,
6195    uint32_t *left,
6196    enum bool *trunc,
6197    struct section_info *objc_sections,
6198    uint32_t nobjc_sections,
6199    enum byte_sex host_byte_sex,
6200    enum bool swapped);
6201
6202static enum bool get_hashEntry(
6203    uint32_t addr,
6204    struct _hashEntry_t *_hashEntry,
6205    enum bool *trunc,
6206    struct section_info *objc_sections,
6207    uint32_t nobjc_sections,
6208    enum byte_sex host_byte_sex,
6209    enum bool swapped);
6210
6211
6212
6213
6214enum bool
6215print_objc_segment(
6216cpu_type_t mh_cputype,
6217struct load_command *load_commands,
6218uint32_t ncmds,
6219uint32_t sizeofcmds,
6220enum byte_sex object_byte_sex,
6221char *object_addr,
6222uint32_t object_size,
6223struct symbol *sorted_symbols,
6224uint32_t nsorted_symbols,
6225enum bool verbose)
6226{
6227    enum byte_sex host_byte_sex;
6228    enum bool swapped, trunc;
6229    uint32_t i, j, left, size, defs_left, def, ivar_list_left;
6230    char *p;
6231    struct section_info *objc_sections;
6232    uint32_t nobjc_sections;
6233    struct section_info cstring_section;
6234
6235    struct objc_module_t *modules, *m, module;
6236    uint32_t modules_addr, modules_size;
6237    struct objc_symtab_t symtab;
6238    uint32_t *defs;
6239    struct objc_class_t objc_class;
6240    struct objc_ivar_list_t objc_ivar_list;
6241    struct objc_ivar_t *ivar_list, ivar;
6242    struct objc_category_t objc_category;
6243
6244    struct imageInfo_t *imageInfo, info;
6245    uint32_t imageInfo_addr, imageInfo_size;
6246
6247 printf("Objective-C segment\n");
6248 get_objc_sections(load_commands, ncmds, sizeofcmds, object_byte_sex,
6249     object_addr, object_size, &objc_sections,
6250     &nobjc_sections, "__module_info", (char **)&modules,
6251     &modules_addr, &modules_size);
6252
6253 if(modules == ((void *)0)){
6254     if(mh_cputype == ((cpu_type_t) 7))
6255  return(FALSE);
6256     printf("can't print objective-C information no (" "__OBJC" ","
6257     "__module_info" ") section\n");
6258     return(TRUE);
6259 }
6260
6261    if (verbose)
6262        get_cstring_section(load_commands, ncmds, sizeofcmds, object_byte_sex,
6263                            object_addr, object_size, &cstring_section);
6264
6265    host_byte_sex = get_host_byte_sex();
6266 swapped = host_byte_sex != object_byte_sex;
6267
6268 ((__builtin_object_size (&module, 0) != (size_t) -1) ? __builtin___memset_chk (&module, '\0', sizeof(struct objc_module_t), __builtin_object_size (&module, 0)) : __inline_memset_chk (&module, '\0', sizeof(struct objc_module_t)));
6269
6270 for(m = modules;
6271     (char *)m < (char *)modules + modules_size;
6272     m = (struct objc_module_t *)((char *)m + module.size) ){
6273
6274     ((__builtin_object_size (&module, 0) != (size_t) -1) ? __builtin___memset_chk (&module, '\0', sizeof(struct objc_module_t), __builtin_object_size (&module, 0)) : __inline_memset_chk (&module, '\0', sizeof(struct objc_module_t)));
6275     left = modules_size - (m - modules);
6276     size = left < sizeof(struct objc_module_t) ?
6277     left : sizeof(struct objc_module_t);
6278     ((__builtin_object_size (&module, 0) != (size_t) -1) ? __builtin___memcpy_chk (&module, m, size, __builtin_object_size (&module, 0)) : __inline_memcpy_chk (&module, m, size));
6279     if(swapped)
6280  swap_objc_module_t(&module, host_byte_sex);
6281
6282     if((char *)m + module.size > (char *)m + modules_size)
6283  printf("module extends past end of " "__module_info"
6284         " section\n");
6285     printf("Module 0x%x\n", (unsigned int)
6286     (modules_addr + (char *)m - (char *)modules));
6287
6288     printf("    version %u\n", module.version);
6289     printf("       size %u\n", module.size);
6290     if(verbose){
6291  p = get_pointer(module.name, &left,
6292      objc_sections, nobjc_sections, &cstring_section);
6293  if(p != ((void *)0))
6294      printf("       name %.*s\n", (int)left, p);
6295  else
6296      printf("       name 0x%08x (not in an " "__OBJC"
6297      " section)\n", (unsigned int)module.name);
6298     }
6299     else
6300  printf("       name 0x%08x\n", (unsigned int)(module.name));
6301
6302     if(get_symtab(module.symtab, &symtab, &defs, &defs_left, &trunc,
6303      objc_sections, nobjc_sections,
6304      host_byte_sex, swapped) == FALSE){
6305  printf("     symtab 0x%08x (not in an " "__OBJC"
6306         " section)\n", (unsigned int)module.symtab);
6307  continue;
6308     }
6309     printf("     symtab 0x%08x\n", (unsigned int)module.symtab);
6310     if(trunc == TRUE)
6311  printf("\tsymtab extends past end of an " "__OBJC"
6312         " section\n");
6313     printf("\tsel_ref_cnt %u\n", symtab.sel_ref_cnt);
6314     p = get_pointer(symtab.refs, &left,
6315                     objc_sections, nobjc_sections, &cstring_section);
6316     if(p != ((void *)0))
6317  printf("\trefs 0x%08x", symtab.refs);
6318     else
6319  printf("\trefs 0x%08x (not in an " "__OBJC" " section)\n",
6320         symtab.refs);
6321
6322     printf("\tcls_def_cnt %d\n", symtab.cls_def_cnt);
6323     printf("\tcat_def_cnt %d\n", symtab.cat_def_cnt);
6324     if(symtab.cls_def_cnt > 0)
6325  printf("\tClass Definitions\n");
6326     for(i = 0; i < symtab.cls_def_cnt; i++){
6327  if((i + 1) * sizeof(uint32_t) > defs_left){
6328      printf("\t(remaining class defs entries entends past "
6329      "the end of the section)\n");
6330      break;
6331  }
6332
6333  ((__builtin_object_size (&def, 0) != (size_t) -1) ? __builtin___memcpy_chk (&def, defs + i, sizeof(uint32_t), __builtin_object_size (&def, 0)) : __inline_memcpy_chk (&def, defs + i, sizeof(uint32_t)));
6334  if(swapped)
6335      def = ( ((def) << 24) | (((def) << 8) & 0x00ff0000) | (((def) >> 8) & 0x0000ff00) | ((unsigned int)(def) >> 24) );
6336
6337  if(get_objc_class(def, &objc_class, &trunc, objc_sections,
6338     nobjc_sections, host_byte_sex, swapped) == TRUE){
6339      printf("\tdefs[%u] 0x%08x", i, def);
6340print_objc_class:
6341      if(trunc == TRUE)
6342   printf(" (entends past the end of the section)\n");
6343      else
6344   printf("\n");
6345      printf("\t\t      isa 0x%08x", objc_class.isa);
6346
6347      if(verbose && CLS_GETINFO(&objc_class, CLS_META)){
6348   p = get_pointer(objc_class.isa, &left, objc_sections,
6349     nobjc_sections, &cstring_section);
6350   if(p != ((void *)0))
6351       printf(" %.*s\n", (int)left, p);
6352   else
6353       printf(" (not in an " "__OBJC" " section)\n");
6354      }
6355      else
6356   printf("\n");
6357
6358      printf("\t      super_class 0x%08x",objc_class.super_class);
6359      if(verbose){
6360   p = get_pointer(objc_class.super_class, &left,
6361     objc_sections, nobjc_sections, &cstring_section);
6362   if(p != ((void *)0))
6363       printf(" %.*s\n", (int)left, p);
6364   else
6365       printf(" (not in an " "__OBJC" " section)\n");
6366      }
6367      else
6368   printf("\n");
6369
6370      printf("\t\t     name 0x%08x", objc_class.name);
6371      if(verbose){
6372   p = get_pointer(objc_class.name, &left,
6373     objc_sections, nobjc_sections, &cstring_section);
6374   if(p != ((void *)0))
6375       printf(" %.*s\n", (int)left, p);
6376   else
6377       printf(" (not in an " "__OBJC" " section)\n");
6378      }
6379      else
6380   printf("\n");
6381      printf("\t\t  version 0x%08x\n",
6382      (unsigned int)objc_class.version);
6383      printf("\t\t     info 0x%08x",
6384      (unsigned int)objc_class.info);
6385      if(verbose){
6386   if(CLS_GETINFO(&objc_class, CLS_CLASS))
6387       printf(" CLS_CLASS\n");
6388   else if(CLS_GETINFO(&objc_class, CLS_META))
6389       printf(" CLS_META\n");
6390   else
6391       printf("\n");
6392      }
6393      else
6394   printf("\n");
6395      printf("\t    instance_size 0x%08x\n",
6396      (unsigned int)objc_class.instance_size);
6397
6398      if(get_ivar_list(objc_class.ivars, &objc_ivar_list,
6399       &ivar_list, &ivar_list_left, &trunc,
6400       objc_sections, nobjc_sections, host_byte_sex,
6401       swapped) == TRUE){
6402   printf("\t\t    ivars 0x%08x\n",
6403          (unsigned int)objc_class.ivars);
6404   if(trunc == TRUE)
6405       printf("\t\t objc_ivar_list extends past end "
6406       "of " "__symbol_table" " section\n");
6407   printf("\t\t       ivar_count %d\n",
6408        objc_ivar_list.ivar_count);
6409   for(j = 0;
6410       j < (uint32_t)objc_ivar_list.ivar_count;
6411       j++){
6412       if((j + 1) * sizeof(struct objc_ivar_t) >
6413          ivar_list_left){
6414    printf("\t\t remaining ivar's extend past "
6415           "the of the section\n");
6416    break;
6417       }
6418       ((__builtin_object_size (&ivar, 0) != (size_t) -1) ? __builtin___memcpy_chk (&ivar, ivar_list + j, sizeof(struct objc_ivar_t), __builtin_object_size (&ivar, 0)) : __inline_memcpy_chk (&ivar, ivar_list + j, sizeof(struct objc_ivar_t)));
6419
6420       if(swapped)
6421    swap_objc_ivar_t(&ivar, host_byte_sex);
6422
6423       printf("\t\t\tivar_name 0x%08x",
6424       (unsigned int)ivar.ivar_name);
6425       if(verbose){
6426    p = get_pointer(ivar.ivar_name, &left,
6427         objc_sections, nobjc_sections, &cstring_section);
6428    if(p != ((void *)0))
6429        printf(" %.*s\n", (int)left, p);
6430    else
6431        printf(" (not in an " "__OBJC"
6432        " section)\n");
6433       }
6434       else
6435    printf("\n");
6436       printf("\t\t\tivar_type 0x%08x",
6437       (unsigned int)ivar.ivar_type);
6438       if(verbose){
6439    p = get_pointer(ivar.ivar_type, &left,
6440         objc_sections, nobjc_sections, &cstring_section);
6441    if(p != ((void *)0))
6442        printf(" %.*s\n", (int)left, p);
6443    else
6444        printf(" (not in an " "__OBJC"
6445        " section)\n");
6446       }
6447       else
6448    printf("\n");
6449       printf("\t\t      ivar_offset 0x%08x\n",
6450       (unsigned int)ivar.ivar_offset);
6451   }
6452      }
6453      else{
6454   printf("\t\t    ivars 0x%08x (not in an " "__OBJC"
6455          " section)\n",
6456          (unsigned int)objc_class.ivars);
6457      }
6458
6459      printf("\t\t  methods 0x%08x",
6460      (unsigned int)objc_class.methodLists);
6461      if(print_method_list(objc_class.methodLists,
6462      objc_sections, nobjc_sections,
6463      &cstring_section,
6464      host_byte_sex, swapped, sorted_symbols,
6465      nsorted_symbols, verbose) == FALSE)
6466   printf(" (not in an " "__OBJC" " section)\n");
6467
6468      printf("\t\t    cache 0x%08x\n",
6469      (unsigned int)objc_class.cache);
6470
6471      printf("\t\tprotocols 0x%08x",
6472      (unsigned int)objc_class.protocols);
6473      if(print_protocol_list(16, objc_class.protocols,
6474   objc_sections, nobjc_sections, &cstring_section,
6475   host_byte_sex, swapped, verbose) == FALSE)
6476   printf(" (not in an " "__OBJC" " section)\n");
6477
6478      if(CLS_GETINFO((&objc_class), CLS_CLASS)){
6479   printf("\tMeta Class");
6480   if(get_objc_class((uint32_t)objc_class.isa,
6481        &objc_class, &trunc, objc_sections, nobjc_sections,
6482        host_byte_sex, swapped) == TRUE){
6483       goto print_objc_class;
6484   }
6485   else
6486       printf(" (not in " "__symbol_table"
6487       " section)\n");
6488      }
6489  }
6490  else
6491      printf("\tdefs[%u] 0x%08x (not in an " "__OBJC"
6492      " section)\n", i, (unsigned int)def);
6493     }
6494     if(symtab.cat_def_cnt > 0)
6495  printf("\tCategory Definitions\n");
6496     for(i = 0; i < symtab.cat_def_cnt; i++){
6497  if((i + symtab.cls_def_cnt + 1) * sizeof(uint32_t) >
6498             defs_left){
6499      printf("\t(remaining category defs entries entends "
6500      "past the end of the section)\n");
6501      break;
6502  }
6503
6504  ((__builtin_object_size (&def, 0) != (size_t) -1) ? __builtin___memcpy_chk (&def, defs + i + symtab.cls_def_cnt, sizeof(uint32_t), __builtin_object_size (&def, 0)) : __inline_memcpy_chk (&def, defs + i + symtab.cls_def_cnt, sizeof(uint32_t)));
6505  if(swapped)
6506      def = ( ((def) << 24) | (((def) << 8) & 0x00ff0000) | (((def) >> 8) & 0x0000ff00) | ((unsigned int)(def) >> 24) );
6507
6508  if(get_objc_category(def, &objc_category, &trunc,
6509     objc_sections, nobjc_sections,
6510              host_byte_sex, swapped) == TRUE){
6511      printf("\tdefs[%u] 0x%08x", i + symtab.cls_def_cnt,
6512      (unsigned int)def);
6513      if(trunc == TRUE)
6514   printf(" (entends past the end of the section)\n");
6515      else
6516   printf("\n");
6517      printf("\t       category name 0x%08x",
6518      objc_category.category_name);
6519      if(verbose){
6520   p = get_pointer(objc_category.category_name, &left,
6521     objc_sections, nobjc_sections,
6522     &cstring_section);
6523   if(p != ((void *)0))
6524       printf(" %.*s\n", (int)left, p);
6525   else
6526       printf(" (not in an " "__OBJC" " section)\n");
6527      }
6528      else
6529   printf("\n");
6530
6531      printf("\t\t  class name 0x%08x", objc_category.class_name);
6532      if(verbose){
6533   p = get_pointer(objc_category.class_name, &left,
6534     objc_sections, nobjc_sections,
6535     &cstring_section);
6536   if(p != ((void *)0))
6537       printf(" %.*s\n", (int)left, p);
6538   else
6539       printf(" (not in an " "__OBJC" " section)\n");
6540      }
6541      else
6542   printf("\n");
6543
6544      printf("\t    instance methods 0x%08x",
6545      objc_category.instance_methods);
6546      if(print_method_list(objc_category.instance_methods,
6547      objc_sections, nobjc_sections,
6548      &cstring_section,
6549      host_byte_sex, swapped,
6550      sorted_symbols, nsorted_symbols,
6551      verbose) == FALSE)
6552   printf(" (not in an " "__OBJC" " section)\n");
6553
6554      printf("\t       class methods 0x%08x",
6555      objc_category.class_methods);
6556      if(print_method_list(objc_category.class_methods,
6557   objc_sections, nobjc_sections, &cstring_section,
6558   host_byte_sex, swapped, sorted_symbols, nsorted_symbols,
6559   verbose) == FALSE)
6560   printf(" (not in an " "__OBJC" " section)\n");
6561  }
6562  else
6563      printf("\tdefs[%u] 0x%08x (not in an " "__OBJC"
6564      " section)\n", i + symtab.cls_def_cnt,
6565      (unsigned int)def);
6566     }
6567 }
6568
6569 printf("Contents of (%s,%s) section\n", "__OBJC", "__image_info");
6570 get_objc_sections(load_commands, ncmds, sizeofcmds, object_byte_sex,
6571     object_addr, object_size, &objc_sections,
6572     &nobjc_sections, "__image_info", (char **)&imageInfo,
6573     &imageInfo_addr, &imageInfo_size);
6574 ((__builtin_object_size (&info, 0) != (size_t) -1) ? __builtin___memset_chk (&info, '\0', sizeof(struct imageInfo_t), __builtin_object_size (&info, 0)) : __inline_memset_chk (&info, '\0', sizeof(struct imageInfo_t)));
6575 if(imageInfo_size < sizeof(struct imageInfo_t)){
6576     ((__builtin_object_size (&info, 0) != (size_t) -1) ? __builtin___memcpy_chk (&info, imageInfo, imageInfo_size, __builtin_object_size (&info, 0)) : __inline_memcpy_chk (&info, imageInfo, imageInfo_size));
6577     printf(" (imageInfo entends past the end of the section)\n");
6578 }
6579 else
6580     ((__builtin_object_size (&info, 0) != (size_t) -1) ? __builtin___memcpy_chk (&info, imageInfo, sizeof(struct imageInfo_t), __builtin_object_size (&info, 0)) : __inline_memcpy_chk (&info, imageInfo, sizeof(struct imageInfo_t)));
6581 if(swapped)
6582     swap_imageInfo_t(&info, host_byte_sex);
6583 printf("  version %u\n", info.version);
6584 printf("    flags 0x%x", info.flags);
6585 if(info.flags & 0x1)
6586     printf("  F&C");
6587 if(info.flags & 0x2)
6588     printf(" GC");
6589 if(info.flags & 0x4)
6590     printf(" GC-only");
6591 else
6592     printf(" RR");
6593 printf("\n");
6594 return(TRUE);
6595}
6596
6597void
6598print_objc_protocol_section(
6599struct load_command *load_commands,
6600uint32_t ncmds,
6601uint32_t sizeofcmds,
6602enum byte_sex object_byte_sex,
6603char *object_addr,
6604uint32_t object_size,
6605enum bool verbose)
6606{
6607    enum byte_sex host_byte_sex;
6608    enum bool swapped;
6609    struct section_info *objc_sections, cstring_section;
6610    uint32_t nobjc_sections;
6611    struct objc_protocol_t *protocols, *p, protocol;
6612    uint32_t protocols_addr, protocols_size;
6613    uint32_t size, left;
6614
6615 printf("Contents of (" "__OBJC" ",__protocol) section\n");
6616 get_objc_sections(load_commands, ncmds, sizeofcmds, object_byte_sex,
6617     object_addr, object_size, &objc_sections,
6618     &nobjc_sections, "__protocol", (char **)&protocols,
6619     &protocols_addr, &protocols_size);
6620
6621    if (verbose)
6622        get_cstring_section(load_commands, ncmds, sizeofcmds, object_byte_sex,
6623                            object_addr, object_size, &cstring_section);
6624
6625    host_byte_sex = get_host_byte_sex();
6626 swapped = host_byte_sex != object_byte_sex;
6627
6628 for(p = protocols; (char *)p < (char *)protocols + protocols_size; p++){
6629
6630     ((__builtin_object_size (&protocol, 0) != (size_t) -1) ? __builtin___memset_chk (&protocol, '\0', sizeof(struct objc_protocol_t), __builtin_object_size (&protocol, 0)) : __inline_memset_chk (&protocol, '\0', sizeof(struct objc_protocol_t)));
6631     left = protocols_size - (p - protocols);
6632     size = left < sizeof(struct objc_protocol_t) ?
6633     left : sizeof(struct objc_protocol_t);
6634     ((__builtin_object_size (&protocol, 0) != (size_t) -1) ? __builtin___memcpy_chk (&protocol, p, size, __builtin_object_size (&protocol, 0)) : __inline_memcpy_chk (&protocol, p, size));
6635
6636     if((char *)p + sizeof(struct objc_protocol_t) >
6637        (char *)p + protocols_size)
6638  printf("Protocol extends past end of __protocol section\n");
6639     printf("Protocol 0x%x\n", (unsigned int)
6640     (protocols_addr + (char *)p - (char *)protocols));
6641
6642     print_protocol(0, &protocol,
6643         objc_sections, nobjc_sections, &cstring_section,
6644         host_byte_sex, swapped, verbose);
6645 }
6646}
6647
6648void
6649print_objc_string_object_section(
6650char *sectname,
6651struct load_command *load_commands,
6652uint32_t ncmds,
6653uint32_t sizeofcmds,
6654enum byte_sex object_byte_sex,
6655char *object_addr,
6656uint32_t object_size,
6657enum bool verbose)
6658{
6659    enum byte_sex host_byte_sex;
6660    enum bool swapped;
6661    struct section_info *objc_sections;
6662    uint32_t nobjc_sections;
6663    struct section_info cstring_section;
6664    struct objc_string_object_t *string_objects, *s, string_object;
6665    uint32_t string_objects_addr, string_objects_size;
6666    uint32_t size, left;
6667    char *p;
6668
6669 printf("Contents of (" "__OBJC" ",%s) section\n", sectname);
6670 get_objc_sections(load_commands, ncmds, sizeofcmds, object_byte_sex,
6671     object_addr, object_size, &objc_sections,
6672     &nobjc_sections, sectname, (char **)&string_objects,
6673     &string_objects_addr, &string_objects_size);
6674
6675 get_cstring_section(load_commands, ncmds, sizeofcmds, object_byte_sex,
6676       object_addr, object_size, &cstring_section);
6677
6678 host_byte_sex = get_host_byte_sex();
6679 swapped = host_byte_sex != object_byte_sex;
6680
6681 for(s = string_objects;
6682     (char *)s < (char *)string_objects + string_objects_size;
6683     s++){
6684
6685     ((__builtin_object_size (&string_object, 0) != (size_t) -1) ? __builtin___memset_chk (&string_object, '\0', sizeof(struct objc_string_object_t), __builtin_object_size (&string_object, 0)) : __inline_memset_chk (&string_object, '\0', sizeof(struct objc_string_object_t)));
6686     left = string_objects_size - (s - string_objects);
6687     size = left < sizeof(struct objc_string_object_t) ?
6688     left : sizeof(struct objc_string_object_t);
6689     ((__builtin_object_size (&string_object, 0) != (size_t) -1) ? __builtin___memcpy_chk (&string_object, s, size, __builtin_object_size (&string_object, 0)) : __inline_memcpy_chk (&string_object, s, size));
6690
6691     if((char *)s + sizeof(struct objc_string_object_t) >
6692        (char *)s + string_objects_size)
6693  printf("String Object extends past end of %s section\n",
6694         sectname);
6695     printf("String Object 0x%x\n", (unsigned int)
6696     (string_objects_addr + (char *)s - (char *)string_objects));
6697
6698     if(swapped)
6699  swap_string_object_t(&string_object, host_byte_sex);
6700     printf("           isa 0x%x\n", string_object.isa);
6701     printf("    characters 0x%x",
6702     (unsigned int)string_object.characters);
6703     if(verbose){
6704  p = get_pointer(string_object.characters, &left,
6705           &cstring_section, 1, &cstring_section);
6706  if(p != ((void *)0))
6707      printf(" %.*s\n", (int)left, p);
6708  else
6709      printf(" (not in the (" "__TEXT" ",__cstring) section)\n");
6710     }
6711     else
6712  printf("\n");
6713     printf("       _length %u\n", string_object._length);
6714 }
6715}
6716
6717
6718
6719
6720
6721void
6722print_objc_runtime_setup_section(
6723struct load_command *load_commands,
6724uint32_t ncmds,
6725uint32_t sizeofcmds,
6726enum byte_sex object_byte_sex,
6727char *object_addr,
6728uint32_t object_size,
6729enum bool verbose)
6730{
6731
6732    enum byte_sex host_byte_sex;
6733    enum bool swapped;
6734    struct section_info *objc_sections, cstring_section;
6735    uint32_t i, nobjc_sections, left;
6736    struct _hashEntry_t **PHASH, *HASH, _hashEntry;
6737    char *sect, *p;
6738    uint32_t sect_addr, sect_size, phash;
6739
6740 printf("Contents of (" "__OBJC" ",__runtime_setup) section\n");
6741 get_objc_sections(load_commands, ncmds, sizeofcmds, object_byte_sex,
6742     object_addr, object_size, &objc_sections,
6743     &nobjc_sections, "__runtime_setup", &sect, &sect_addr,
6744     &sect_size);
6745
6746    if (verbose)
6747        get_cstring_section(load_commands, ncmds, sizeofcmds, object_byte_sex,
6748                            object_addr, object_size, &cstring_section);
6749
6750    host_byte_sex = get_host_byte_sex();
6751 swapped = host_byte_sex != object_byte_sex;
6752
6753 PHASH = (struct _hashEntry_t **)sect;
6754 for(i = 0;
6755     i < 821 && (i + 1) * sizeof(uint32_t) < sect_size;
6756     i++){
6757
6758     ((__builtin_object_size (&phash, 0) != (size_t) -1) ? __builtin___memcpy_chk (&phash, PHASH + i, sizeof(uint32_t), __builtin_object_size (&phash, 0)) : __inline_memcpy_chk (&phash, PHASH + i, sizeof(uint32_t)));
6759     if(swapped)
6760  phash = ( ((phash) << 24) | (((phash) << 8) & 0x00ff0000) | (((phash) >> 8) & 0x0000ff00) | ((unsigned int)(phash) >> 24) );
6761
6762     if(phash == 0)
6763  continue;
6764
6765     printf("PHASH[%3u] 0x%x", i, (unsigned int)phash);
6766     if(print_PHASH(4, phash,
6767      objc_sections, nobjc_sections, &cstring_section,
6768      host_byte_sex, swapped, verbose) == FALSE)
6769  printf(" (not in an " "__OBJC" " section)\n");
6770 }
6771
6772 HASH = (struct _hashEntry_t *)(PHASH + 821);
6773 for(i = 0; (char *)(HASH + i) < sect + sect_size; i++){
6774     ((__builtin_object_size ((char *)&_hashEntry, 0) != (size_t) -1) ? __builtin___memcpy_chk ((char *)&_hashEntry, HASH + i, sizeof(struct _hashEntry_t), __builtin_object_size ((char *)&_hashEntry, 0)) : __inline_memcpy_chk ((char *)&_hashEntry, HASH + i, sizeof(struct _hashEntry_t)));
6775     if(swapped)
6776  swap_hashEntry_t(&_hashEntry, host_byte_sex);
6777
6778     printf("HASH at 0x%08x\n",
6779     (unsigned int)(sect_addr + (char *)(HASH + i) - sect));
6780     printf("     sel 0x%08x", (unsigned int)_hashEntry.sel);
6781     if(verbose){
6782  p = get_pointer(_hashEntry.sel, &left, objc_sections,
6783    nobjc_sections, &cstring_section);
6784  if(p != ((void *)0))
6785      printf(" %.*s\n", (int)left, p);
6786  else
6787      printf(" (not in an " "__OBJC" " section)\n");
6788     }
6789     else
6790  printf("\n");
6791
6792     printf("    next 0x%08x", (unsigned int)_hashEntry.next);
6793     if(_hashEntry.next == 0){
6794  printf("\n");
6795     }
6796     else{
6797  if((uint32_t)_hashEntry.next < sect_addr ||
6798     (uint32_t)_hashEntry.next >= sect_addr + sect_size)
6799      printf(" (not in the (""__OBJC" ",__runtime_setup "
6800      "section)\n");
6801  else
6802      printf("\n");
6803     }
6804 }
6805}
6806
6807static
6808void
6809get_objc_sections(
6810struct load_command *load_commands,
6811uint32_t ncmds,
6812uint32_t sizeofcmds,
6813enum byte_sex object_byte_sex,
6814char *object_addr,
6815uint32_t object_size,
6816struct section_info **objc_sections,
6817uint32_t *nobjc_sections,
6818char *sectname,
6819char **sect,
6820uint32_t *sect_addr,
6821uint32_t *sect_size)
6822{
6823    enum byte_sex host_byte_sex;
6824    enum bool swapped, encrypt_found;
6825
6826    uint32_t i, j, left, size;
6827    struct load_command lcmd, *lc;
6828    char *p;
6829    struct segment_command sg;
6830    struct section s;
6831    struct encryption_info_command encrypt;
6832
6833 host_byte_sex = get_host_byte_sex();
6834 swapped = host_byte_sex != object_byte_sex;
6835
6836 *objc_sections = ((void *)0);
6837 *nobjc_sections = 0;
6838 *sect = ((void *)0);
6839 *sect_addr = 0;
6840 *sect_size = 0;
6841 encrypt_found = FALSE;
6842
6843 lc = load_commands;
6844 for(i = 0 ; i < ncmds; i++){
6845     ((__builtin_object_size ((char *)&lcmd, 0) != (size_t) -1) ? __builtin___memcpy_chk ((char *)&lcmd, (char *)lc, sizeof(struct load_command), __builtin_object_size ((char *)&lcmd, 0)) : __inline_memcpy_chk ((char *)&lcmd, (char *)lc, sizeof(struct load_command)));
6846     if(swapped)
6847  swap_load_command(&lcmd, host_byte_sex);
6848     if(lcmd.cmdsize % sizeof(int32_t) != 0)
6849  printf("load command %u size not a multiple of "
6850         "sizeof(int32_t)\n", i);
6851     if((char *)lc + lcmd.cmdsize >
6852        (char *)load_commands + sizeofcmds)
6853  printf("load command %u extends past end of load "
6854         "commands\n", i);
6855     left = sizeofcmds - ((char *)lc - (char *)load_commands);
6856
6857     switch(lcmd.cmd){
6858     case 0x1:
6859  ((__builtin_object_size ((char *)&sg, 0) != (size_t) -1) ? __builtin___memset_chk ((char *)&sg, '\0', sizeof(struct segment_command), __builtin_object_size ((char *)&sg, 0)) : __inline_memset_chk ((char *)&sg, '\0', sizeof(struct segment_command)));
6860  size = left < sizeof(struct segment_command) ?
6861         left : sizeof(struct segment_command);
6862  ((__builtin_object_size ((char *)&sg, 0) != (size_t) -1) ? __builtin___memcpy_chk ((char *)&sg, (char *)lc, size, __builtin_object_size ((char *)&sg, 0)) : __inline_memcpy_chk ((char *)&sg, (char *)lc, size));
6863  if(swapped)
6864      swap_segment_command(&sg, host_byte_sex);
6865
6866  p = (char *)lc + sizeof(struct segment_command);
6867  for(j = 0 ; j < sg.nsects ; j++){
6868      if(p + sizeof(struct section) >
6869         (char *)load_commands + sizeofcmds){
6870   printf("section structure command extends past "
6871          "end of load commands\n");
6872      }
6873      left = sizeofcmds - (p - (char *)load_commands);
6874      ((__builtin_object_size ((char *)&s, 0) != (size_t) -1) ? __builtin___memset_chk ((char *)&s, '\0', sizeof(struct section), __builtin_object_size ((char *)&s, 0)) : __inline_memset_chk ((char *)&s, '\0', sizeof(struct section)));
6875      size = left < sizeof(struct section) ?
6876      left : sizeof(struct section);
6877      ((__builtin_object_size ((char *)&s, 0) != (size_t) -1) ? __builtin___memcpy_chk ((char *)&s, p, size, __builtin_object_size ((char *)&s, 0)) : __inline_memcpy_chk ((char *)&s, p, size));
6878      if(swapped)
6879   swap_section(&s, 1, host_byte_sex);
6880
6881      if(strcmp(s.segname, "__OBJC") == 0){
6882   *objc_sections = reallocate(*objc_sections,
6883      sizeof(struct section_info) * (*nobjc_sections + 1));
6884   (*objc_sections)[*nobjc_sections].addr = s.addr;
6885   (*objc_sections)[*nobjc_sections].contents =
6886        object_addr + s.offset;
6887   (*objc_sections)[*nobjc_sections].offset = s.offset;
6888          (*objc_sections)[*nobjc_sections].zerofill =
6889     (s.flags & 0x000000ff) == 0x1 ? TRUE : FALSE;
6890   if(s.offset > object_size){
6891       printf("section contents of: (%.16s,%.16s) is past "
6892       "end of file\n", s.segname, s.sectname);
6893       (*objc_sections)[*nobjc_sections].size = 0;
6894   }
6895   else if(s.offset + s.size > object_size){
6896       printf("part of section contents of: (%.16s,%.16s) "
6897       "is past end of file\n",
6898       s.segname, s.sectname);
6899       (*objc_sections)[*nobjc_sections].size =
6900    object_size - s.offset;
6901   }
6902   else
6903       (*objc_sections)[*nobjc_sections].size = s.size;
6904
6905   if(strncmp(s.sectname, sectname, 16) == 0){
6906       if(*sect != ((void *)0))
6907    printf("more than one (" "__OBJC" ",%s) "
6908           "section\n", sectname);
6909       else{
6910    *sect = (object_addr + s.offset);
6911    *sect_size = s.size;
6912    *sect_addr = s.addr;
6913       }
6914   }
6915   if(sg.flags & 0x8)
6916       (*objc_sections)[*nobjc_sections].protected = TRUE;
6917   else
6918       (*objc_sections)[*nobjc_sections].protected = FALSE;
6919   (*nobjc_sections)++;
6920      }
6921
6922      if(p + sizeof(struct section) >
6923         (char *)load_commands + sizeofcmds)
6924   break;
6925      p += size;
6926  }
6927  break;
6928     case 0x21:
6929  ((__builtin_object_size ((char *)&encrypt, 0) != (size_t) -1) ? __builtin___memset_chk ((char *)&encrypt, '\0', sizeof(struct encryption_info_command), __builtin_object_size ((char *)&encrypt, 0)) : __inline_memset_chk ((char *)&encrypt, '\0', sizeof(struct encryption_info_command)));
6930
6931  size = left < sizeof(struct encryption_info_command) ?
6932         left : sizeof(struct encryption_info_command);
6933  ((__builtin_object_size ((char *)&encrypt, 0) != (size_t) -1) ? __builtin___memcpy_chk ((char *)&encrypt, (char *)lc, size, __builtin_object_size ((char *)&encrypt, 0)) : __inline_memcpy_chk ((char *)&encrypt, (char *)lc, size));
6934  if(swapped)
6935      swap_encryption_command(&encrypt, host_byte_sex);
6936  encrypt_found = TRUE;
6937  break;
6938     }
6939     if(lcmd.cmdsize == 0){
6940  printf("load command %u size zero (can't advance to other "
6941         "load commands)\n", i);
6942  break;
6943     }
6944     lc = (struct load_command *)((char *)lc + lcmd.cmdsize);
6945     if((char *)lc > (char *)load_commands + sizeofcmds)
6946  break;
6947 }
6948
6949 if(encrypt_found == TRUE && encrypt.cryptid != 0){
6950     for(i = 0; i < *nobjc_sections; i++){
6951  if((*objc_sections)[i].size > 0 &&
6952     (*objc_sections)[i].zerofill == FALSE){
6953      if((*objc_sections)[i].offset >
6954         encrypt.cryptoff + encrypt.cryptsize){
6955                                             ;
6956      }
6957      else if((*objc_sections)[i].offset +
6958       (*objc_sections)[i].size < encrypt.cryptoff){
6959                                             ;
6960      }
6961      else{
6962
6963   (*objc_sections)[i].protected = TRUE;
6964      }
6965  }
6966     }
6967 }
6968}
6969
6970static
6971void
6972get_cstring_section(
6973struct load_command *load_commands,
6974uint32_t ncmds,
6975uint32_t sizeofcmds,
6976enum byte_sex object_byte_sex,
6977char *object_addr,
6978uint32_t object_size,
6979struct section_info *cstring_section)
6980{
6981    enum byte_sex host_byte_sex;
6982    enum bool swapped;
6983
6984    uint32_t i, j, left, size;
6985    struct load_command lcmd, *lc;
6986    char *p;
6987    struct segment_command sg;
6988    struct section s;
6989
6990 host_byte_sex = get_host_byte_sex();
6991 swapped = host_byte_sex != object_byte_sex;
6992
6993 ((__builtin_object_size (cstring_section, 0) != (size_t) -1) ? __builtin___memset_chk (cstring_section, '\0', sizeof(struct section_info), __builtin_object_size (cstring_section, 0)) : __inline_memset_chk (cstring_section, '\0', sizeof(struct section_info)));
6994
6995 lc = load_commands;
6996 for(i = 0 ; i < ncmds; i++){
6997     ((__builtin_object_size ((char *)&lcmd, 0) != (size_t) -1) ? __builtin___memcpy_chk ((char *)&lcmd, (char *)lc, sizeof(struct load_command), __builtin_object_size ((char *)&lcmd, 0)) : __inline_memcpy_chk ((char *)&lcmd, (char *)lc, sizeof(struct load_command)));
6998     if(swapped)
6999  swap_load_command(&lcmd, host_byte_sex);
7000     if(lcmd.cmdsize % sizeof(int32_t) != 0)
7001  printf("load command %u size not a multiple of "
7002         "sizeof(int32_t)\n", i);
7003     if((char *)lc + lcmd.cmdsize >
7004        (char *)load_commands + sizeofcmds)
7005  printf("load command %u extends past end of load "
7006         "commands\n", i);
7007     left = sizeofcmds - ((char *)lc - (char *)load_commands);
7008
7009     switch(lcmd.cmd){
7010     case 0x1:
7011  ((__builtin_object_size ((char *)&sg, 0) != (size_t) -1) ? __builtin___memset_chk ((char *)&sg, '\0', sizeof(struct segment_command), __builtin_object_size ((char *)&sg, 0)) : __inline_memset_chk ((char *)&sg, '\0', sizeof(struct segment_command)));
7012  size = left < sizeof(struct segment_command) ?
7013         left : sizeof(struct segment_command);
7014  ((__builtin_object_size ((char *)&sg, 0) != (size_t) -1) ? __builtin___memcpy_chk ((char *)&sg, (char *)lc, size, __builtin_object_size ((char *)&sg, 0)) : __inline_memcpy_chk ((char *)&sg, (char *)lc, size));
7015  if(swapped)
7016      swap_segment_command(&sg, host_byte_sex);
7017
7018  p = (char *)lc + sizeof(struct segment_command);
7019  for(j = 0 ; j < sg.nsects ; j++){
7020      if(p + sizeof(struct section) >
7021         (char *)load_commands + sizeofcmds){
7022   printf("section structure command extends past "
7023          "end of load commands\n");
7024      }
7025      left = sizeofcmds - (p - (char *)load_commands);
7026      ((__builtin_object_size ((char *)&s, 0) != (size_t) -1) ? __builtin___memset_chk ((char *)&s, '\0', sizeof(struct section), __builtin_object_size ((char *)&s, 0)) : __inline_memset_chk ((char *)&s, '\0', sizeof(struct section)));
7027      size = left < sizeof(struct section) ?
7028      left : sizeof(struct section);
7029      ((__builtin_object_size ((char *)&s, 0) != (size_t) -1) ? __builtin___memcpy_chk ((char *)&s, p, size, __builtin_object_size ((char *)&s, 0)) : __inline_memcpy_chk ((char *)&s, p, size));
7030      if(swapped)
7031   swap_section(&s, 1, host_byte_sex);
7032
7033      if(strcmp(s.segname, "__TEXT") == 0 &&
7034         strcmp(s.sectname, "__cstring") == 0){
7035   cstring_section->addr = s.addr;
7036   cstring_section->contents = object_addr + s.offset;
7037   if(s.offset > object_size){
7038       printf("section contents of: (%.16s,%.16s) is past "
7039       "end of file\n", s.segname, s.sectname);
7040       cstring_section->size = 0;
7041   }
7042   else if(s.offset + s.size > object_size){
7043       printf("part of section contents of: (%.16s,%.16s) "
7044       "is past end of file\n",
7045       s.segname, s.sectname);
7046       cstring_section->size = object_size - s.offset;
7047   }
7048   else
7049       cstring_section->size = s.size;
7050   if(sg.flags & 0x8)
7051       cstring_section->protected = TRUE;
7052   else
7053       cstring_section->protected = FALSE;
7054   return;
7055      }
7056
7057      if(p + sizeof(struct section) >
7058         (char *)load_commands + sizeofcmds)
7059   break;
7060      p += size;
7061  }
7062  break;
7063     }
7064     if(lcmd.cmdsize == 0){
7065  printf("load command %u size zero (can't advance to other "
7066         "load commands)\n", i);
7067  break;
7068     }
7069     lc = (struct load_command *)((char *)lc + lcmd.cmdsize);
7070     if((char *)lc > (char *)load_commands + sizeofcmds)
7071  break;
7072 }
7073}
7074
7075static
7076enum bool
7077print_method_list(
7078uint32_t addr,
7079struct section_info *objc_sections,
7080uint32_t nobjc_sections,
7081struct section_info *cstring_section_ptr,
7082enum byte_sex host_byte_sex,
7083enum bool swapped,
7084struct symbol *sorted_symbols,
7085uint32_t nsorted_symbols,
7086enum bool verbose)
7087{
7088    struct objc_method_t *methods, method;
7089    struct objc_method_list_t method_list;
7090    enum bool trunc;
7091    uint32_t i, methods_left, left;
7092    char *p;
7093
7094 if(get_method_list(addr, &method_list, &methods, &methods_left, &trunc,
7095      objc_sections, nobjc_sections,
7096      host_byte_sex, swapped) == FALSE)
7097     return(FALSE);
7098
7099 printf("\n");
7100 if(trunc == TRUE)
7101     printf("\t\t objc_method_list extends past end of the section\n");
7102
7103 printf("\t\t         obsolete 0x%08x\n",
7104        (unsigned int)method_list.obsolete);
7105 printf("\t\t     method_count %d\n",
7106        method_list.method_count);
7107
7108 for(i = 0; i < (uint32_t)method_list.method_count; i++){
7109     if((i + 1) * sizeof(struct objc_method_t) > methods_left){
7110  printf("\t\t remaining method's extend past the of the "
7111         "section\n");
7112  break;
7113     }
7114     ((__builtin_object_size (&method, 0) != (size_t) -1) ? __builtin___memcpy_chk (&method, methods + i, sizeof(struct objc_method_t), __builtin_object_size (&method, 0)) : __inline_memcpy_chk (&method, methods + i, sizeof(struct objc_method_t)));
7115     if(swapped)
7116  swap_objc_method_t(&method, host_byte_sex);
7117
7118     printf("\t\t      method_name 0x%08x", method.method_name);
7119     if(verbose){
7120  p = get_pointer(method.method_name, &left, objc_sections,
7121    nobjc_sections, cstring_section_ptr);
7122  if(p != ((void *)0))
7123      printf(" %.*s\n", (int)left, p);
7124  else
7125      printf(" (not in an " "__OBJC" " section)\n");
7126     }
7127     else
7128  printf("\n");
7129
7130     printf("\t\t     method_types 0x%08x", method.method_types);
7131     if(verbose){
7132  p = get_pointer(method.method_types, &left, objc_sections,
7133    nobjc_sections, cstring_section_ptr);
7134  if(p != ((void *)0))
7135      printf(" %.*s\n", (int)left, p);
7136  else
7137      printf(" (not in an " "__OBJC" " section)\n");
7138     }
7139     else
7140  printf("\n");
7141     printf("\t\t       method_imp 0x%08x ", method.method_imp);
7142     if(verbose)
7143  print_label(method.method_imp, FALSE, sorted_symbols,
7144       nsorted_symbols);
7145     printf("\n");
7146 }
7147 return(TRUE);
7148}
7149
7150static
7151enum bool
7152print_protocol_list(
7153uint32_t indent,
7154uint32_t addr,
7155struct section_info *objc_sections,
7156uint32_t nobjc_sections,
7157struct section_info *cstring_section_ptr,
7158enum byte_sex host_byte_sex,
7159enum bool swapped,
7160enum bool verbose)
7161{
7162    uint32_t *list;
7163    struct objc_protocol_t protocol;
7164    struct objc_protocol_list_t protocol_list;
7165    enum bool trunc;
7166    uint32_t l, i, list_left;
7167
7168 if(get_protocol_list(addr, &protocol_list, &list, &list_left, &trunc,
7169        objc_sections, nobjc_sections,
7170        host_byte_sex, swapped) == FALSE)
7171     return(FALSE);
7172
7173 printf("\n");
7174 if(trunc == TRUE){
7175     print_indent(indent);
7176     printf(" objc_protocol_list extends past end of the section\n");
7177 }
7178
7179 print_indent(indent);
7180 printf("         next 0x%08x\n",
7181        (unsigned int)protocol_list.next);
7182 print_indent(indent);
7183 printf("        count %u\n", protocol_list.count);
7184
7185 for(i = 0; i < protocol_list.count; i++){
7186     if((i + 1) * sizeof(uint32_t) > list_left){
7187  print_indent(indent);
7188  printf(" remaining list entries extend past the of the "
7189         "section\n");
7190  break;
7191     }
7192     ((__builtin_object_size (&l, 0) != (size_t) -1) ? __builtin___memcpy_chk (&l, list + i, sizeof(uint32_t), __builtin_object_size (&l, 0)) : __inline_memcpy_chk (&l, list + i, sizeof(uint32_t)));
7193     if(swapped)
7194  l = ( ((l) << 24) | (((l) << 8) & 0x00ff0000) | (((l) >> 8) & 0x0000ff00) | ((unsigned int)(l) >> 24) );
7195
7196     print_indent(indent);
7197     printf("      list[%u] 0x%08x", i, l);
7198     if(get_protocol(l, &protocol, &trunc, objc_sections, nobjc_sections,
7199   host_byte_sex, swapped) == FALSE){
7200  printf(" (not in an " "__OBJC" " section)\n");
7201  continue;
7202     }
7203     printf("\n");
7204     if(trunc == TRUE){
7205  print_indent(indent);
7206  printf("            Protocol extends past end of the "
7207   "section\n");
7208     }
7209     print_protocol(indent, &protocol,
7210      objc_sections, nobjc_sections, cstring_section_ptr,
7211      host_byte_sex, swapped, verbose);
7212 }
7213 return(TRUE);
7214}
7215
7216static
7217void
7218print_protocol(
7219uint32_t indent,
7220struct objc_protocol_t *protocol,
7221struct section_info *objc_sections,
7222uint32_t nobjc_sections,
7223struct section_info *cstring_section_ptr,
7224enum byte_sex host_byte_sex,
7225enum bool swapped,
7226enum bool verbose)
7227{
7228    uint32_t left;
7229    char *p;
7230
7231 print_indent(indent);
7232 printf("              isa 0x%08x\n",
7233  (unsigned int)protocol->isa);
7234 print_indent(indent);
7235 printf("    protocol_name 0x%08x",
7236  (unsigned int)protocol->protocol_name);
7237 if(verbose){
7238     p = get_pointer(protocol->protocol_name, &left,
7239      objc_sections, nobjc_sections, cstring_section_ptr);
7240     if(p != ((void *)0))
7241  printf(" %.*s\n", (int)left, p);
7242     else
7243  printf(" (not in an " "__OBJC" " section)\n");
7244 }
7245 else
7246     printf("\n");
7247 print_indent(indent);
7248 printf("    protocol_list 0x%08x",
7249  (unsigned int)protocol->protocol_list);
7250 if(print_protocol_list(indent + 4, protocol->protocol_list,
7251      objc_sections, nobjc_sections, cstring_section_ptr,
7252      host_byte_sex, swapped, verbose) == FALSE)
7253     printf(" (not in an " "__OBJC" " section)\n");
7254
7255 print_indent(indent);
7256 printf(" instance_methods 0x%08x",
7257  (unsigned int)protocol->instance_methods);
7258 if(print_method_description_list(indent, protocol->instance_methods,
7259      objc_sections, nobjc_sections, cstring_section_ptr,
7260      host_byte_sex, swapped, verbose) == FALSE)
7261     printf(" (not in an " "__OBJC" " section)\n");
7262
7263 print_indent(indent);
7264 printf("    class_methods 0x%08x",
7265  (unsigned int)protocol->class_methods);
7266 if(print_method_description_list(indent, protocol->class_methods,
7267      objc_sections, nobjc_sections, cstring_section_ptr,
7268      host_byte_sex, swapped, verbose) == FALSE)
7269     printf(" (not in an " "__OBJC" " section)\n");
7270}
7271
7272static
7273enum bool
7274print_method_description_list(
7275 uint32_t indent,
7276 uint32_t addr,
7277 struct section_info *objc_sections,
7278 uint32_t nobjc_sections,
7279 struct section_info *cstring_section_ptr,
7280 enum byte_sex host_byte_sex,
7281 enum bool swapped,
7282 enum bool verbose)
7283{
7284    struct objc_method_description_list_t mdl;
7285    struct objc_method_description_t *list, md;
7286    enum bool trunc;
7287    uint32_t i, list_left, left;
7288    char *p;
7289
7290    if(get_method_description_list(addr, &mdl, &list, &list_left,
7291  &trunc, objc_sections, nobjc_sections,
7292  host_byte_sex, swapped) == FALSE)
7293 return(FALSE);
7294
7295    printf("\n");
7296    if(trunc == TRUE){
7297 print_indent(indent);
7298 printf(" objc_method_description_list extends past end of the "
7299  "section\n");
7300    }
7301
7302    print_indent(indent);
7303    printf("        count %d\n", mdl.count);
7304
7305    for(i = 0; i < (uint32_t)mdl.count; i++){
7306 if((i + 1) * sizeof(struct objc_method_description_t) > list_left){
7307  print_indent(indent);
7308  printf(" remaining list entries extend past the of the "
7309         "section\n");
7310  break;
7311     }
7312     print_indent(indent);
7313     printf("        list[%u]\n", i);
7314     ((__builtin_object_size (&md, 0) != (size_t) -1) ? __builtin___memcpy_chk (&md, list + i, sizeof(struct objc_method_description_t), __builtin_object_size (&md, 0)) : __inline_memcpy_chk (&md, list + i, sizeof(struct objc_method_description_t)));
7315     if(swapped)
7316  swap_objc_method_description_t(&md, host_byte_sex);
7317
7318     print_indent(indent);
7319     printf("             name 0x%08x", (unsigned int)md.name);
7320     if(verbose){
7321  p = get_pointer(md.name, &left,
7322      objc_sections, nobjc_sections, cstring_section_ptr);
7323  if(p != ((void *)0))
7324      printf(" %.*s\n", (int)left, p);
7325  else
7326      printf(" (not in an " "__OBJC" " section)\n");
7327     }
7328     else
7329  printf("\n");
7330
7331     print_indent(indent);
7332     printf("            types 0x%08x", (unsigned int)md.types);
7333     if(verbose){
7334  p = get_pointer(md.types, &left,
7335      objc_sections, nobjc_sections, cstring_section_ptr);
7336  if(p != ((void *)0))
7337      printf(" %.*s\n", (int)left, p);
7338  else
7339      printf(" (not in an " "__OBJC" " section)\n");
7340     }
7341     else
7342  printf("\n");
7343 }
7344 return(TRUE);
7345}
7346
7347static enum bool
7348print_PHASH(
7349uint32_t indent,
7350uint32_t addr,
7351struct section_info *objc_sections,
7352uint32_t nobjc_sections,
7353struct section_info *cstring_section_ptr,
7354enum byte_sex host_byte_sex,
7355enum bool swapped,
7356enum bool verbose)
7357{
7358    struct _hashEntry_t _hashEntry;
7359    enum bool trunc;
7360    uint32_t left;
7361    char *p;
7362
7363 if(get_hashEntry(addr, &_hashEntry, &trunc, objc_sections,
7364     nobjc_sections, host_byte_sex, swapped) == FALSE)
7365     return(FALSE);
7366
7367 printf("\n");
7368 if(trunc == TRUE){
7369     print_indent(indent);
7370     printf("_hashEntry extends past end of the section\n");
7371 }
7372
7373 print_indent(indent);
7374 printf(" sel 0x%08x", (unsigned int)_hashEntry.sel);
7375 if(verbose){
7376     p = get_pointer(_hashEntry.sel, &left,
7377         objc_sections, nobjc_sections, cstring_section_ptr);
7378     if(p != ((void *)0))
7379  printf(" %.*s\n", (int)left, p);
7380     else
7381  printf(" (not in an " "__OBJC" " section)\n");
7382 }
7383 else
7384     printf("\n");
7385
7386 print_indent(indent);
7387 printf("next 0x%08x", (unsigned int)_hashEntry.next);
7388 if(_hashEntry.next == 0){
7389     printf("\n");
7390     return(TRUE);
7391 }
7392 if(print_PHASH(indent+4, _hashEntry.next,
7393     objc_sections, nobjc_sections, cstring_section_ptr,
7394     host_byte_sex, swapped, verbose) == FALSE)
7395     printf(" (not in an " "__OBJC" " section)\n");
7396 return(TRUE);
7397}
7398
7399static
7400void
7401print_indent(
7402uint32_t indent)
7403{
7404     uint32_t i;
7405
7406 for(i = 0; i < indent; ){
7407     if(indent - i >= 8){
7408  printf("\t");
7409  i += 8;
7410     }
7411     else{
7412  printf("%.*s", (int)(indent - i), "        ");
7413  return;
7414     }
7415 }
7416}
7417
7418static
7419void *
7420get_pointer(
7421uint32_t addr,
7422uint32_t *left,
7423struct section_info *objc_sections,
7424uint32_t nobjc_sections,
7425struct section_info *cstring_section_ptr)
7426{
7427    void* returnValue = ((void *)0);
7428    uint32_t i;
7429
7430 if(addr >= cstring_section_ptr->addr &&
7431    addr < cstring_section_ptr->addr + cstring_section_ptr->size){
7432     *left = cstring_section_ptr->size -
7433     (addr - cstring_section_ptr->addr);
7434     if(cstring_section_ptr->protected == TRUE)
7435  returnValue = "some string from a protected section";
7436     else
7437  returnValue = (cstring_section_ptr->contents +
7438          (addr - cstring_section_ptr->addr));
7439 }
7440 for(i = 0; returnValue != ((void *)0) && i < nobjc_sections; i++){
7441     if(addr >= objc_sections[i].addr &&
7442        addr < objc_sections[i].addr + objc_sections[i].size){
7443  *left = objc_sections[i].size -
7444          (addr - objc_sections[i].addr);
7445  returnValue = (objc_sections[i].contents +
7446         (addr - objc_sections[i].addr));
7447     }
7448 }
7449 return(returnValue);
7450}
7451
7452static
7453enum bool
7454get_symtab(
7455uint32_t addr,
7456struct objc_symtab_t *symtab,
7457uint32_t **defs,
7458uint32_t *left,
7459enum bool *trunc,
7460struct section_info *objc_sections,
7461uint32_t nobjc_sections,
7462enum byte_sex host_byte_sex,
7463enum bool swapped)
7464{
7465    uint32_t i;
7466
7467 ((__builtin_object_size (symtab, 0) != (size_t) -1) ? __builtin___memset_chk (symtab, '\0', sizeof(struct objc_symtab_t), __builtin_object_size (symtab, 0)) : __inline_memset_chk (symtab, '\0', sizeof(struct objc_symtab_t)));
7468 if(addr == 0)
7469     return(0);
7470 for(i = 0; i < nobjc_sections; i++){
7471     if(addr >= objc_sections[i].addr &&
7472        addr < objc_sections[i].addr + objc_sections[i].size){
7473
7474  *left = objc_sections[i].size -
7475          (addr - objc_sections[i].addr);
7476  if(*left >= sizeof(struct objc_symtab_t) - sizeof(uint32_t)){
7477      ((__builtin_object_size (symtab, 0) != (size_t) -1) ? __builtin___memcpy_chk (symtab, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct objc_symtab_t) - sizeof(uint32_t), __builtin_object_size (symtab, 0)) : __inline_memcpy_chk (symtab, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct objc_symtab_t) - sizeof(uint32_t)));
7478
7479
7480
7481      *left -= sizeof(struct objc_symtab_t) - sizeof(uint32_t);
7482      *defs = (uint32_t *)(objc_sections[i].contents +
7483         (addr - objc_sections[i].addr) +
7484            sizeof(struct objc_symtab_t) -
7485         sizeof(uint32_t));
7486      *trunc = FALSE;
7487  }
7488  else{
7489      ((__builtin_object_size (symtab, 0) != (size_t) -1) ? __builtin___memcpy_chk (symtab, objc_sections[i].contents + (addr - objc_sections[i].addr), *left, __builtin_object_size (symtab, 0)) : __inline_memcpy_chk (symtab, objc_sections[i].contents + (addr - objc_sections[i].addr), *left));
7490
7491
7492
7493      *left = 0;
7494      *defs = ((void *)0);
7495      *trunc = TRUE;
7496  }
7497  if(swapped)
7498      swap_objc_symtab_t(symtab, host_byte_sex);
7499  return(TRUE);
7500     }
7501 }
7502 return(FALSE);
7503}
7504
7505static
7506enum bool
7507get_objc_class(
7508uint32_t addr,
7509struct objc_class_t *objc_class,
7510enum bool *trunc,
7511struct section_info *objc_sections,
7512uint32_t nobjc_sections,
7513enum byte_sex host_byte_sex,
7514enum bool swapped)
7515{
7516    uint32_t left, i;
7517
7518 ((__builtin_object_size (objc_class, 0) != (size_t) -1) ? __builtin___memset_chk (objc_class, '\0', sizeof(struct objc_class_t), __builtin_object_size (objc_class, 0)) : __inline_memset_chk (objc_class, '\0', sizeof(struct objc_class_t)));
7519 if(addr == 0)
7520     return(FALSE);
7521 for(i = 0; i < nobjc_sections; i++){
7522     if(addr >= objc_sections[i].addr &&
7523        addr < objc_sections[i].addr + objc_sections[i].size){
7524
7525  left = objc_sections[i].size -
7526          (addr - objc_sections[i].addr);
7527  if(left >= sizeof(struct objc_class_t)){
7528      ((__builtin_object_size (objc_class, 0) != (size_t) -1) ? __builtin___memcpy_chk (objc_class, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct objc_class_t), __builtin_object_size (objc_class, 0)) : __inline_memcpy_chk (objc_class, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct objc_class_t)));
7529
7530
7531
7532      *trunc = FALSE;
7533  }
7534  else{
7535      ((__builtin_object_size (objc_class, 0) != (size_t) -1) ? __builtin___memcpy_chk (objc_class, objc_sections[i].contents + (addr - objc_sections[i].addr), left, __builtin_object_size (objc_class, 0)) : __inline_memcpy_chk (objc_class, objc_sections[i].contents + (addr - objc_sections[i].addr), left));
7536
7537
7538
7539      *trunc = TRUE;
7540  }
7541  if(swapped)
7542      swap_objc_class_t(objc_class, host_byte_sex);
7543  return(TRUE);
7544     }
7545 }
7546 return(FALSE);
7547}
7548
7549static
7550enum bool
7551get_objc_category(
7552uint32_t addr,
7553struct objc_category_t *objc_category,
7554enum bool *trunc,
7555struct section_info *objc_sections,
7556uint32_t nobjc_sections,
7557enum byte_sex host_byte_sex,
7558enum bool swapped)
7559{
7560    uint32_t left, i;
7561
7562 ((__builtin_object_size (objc_category, 0) != (size_t) -1) ? __builtin___memset_chk (objc_category, '\0', sizeof(struct objc_category_t), __builtin_object_size (objc_category, 0)) : __inline_memset_chk (objc_category, '\0', sizeof(struct objc_category_t)));
7563 if(addr == 0)
7564     return(FALSE);
7565 for(i = 0; i < nobjc_sections; i++){
7566     if(addr >= objc_sections[i].addr &&
7567        addr < objc_sections[i].addr + objc_sections[i].size){
7568
7569  left = objc_sections[i].size -
7570          (addr - objc_sections[i].addr);
7571  if(left >= sizeof(struct objc_category_t)){
7572      ((__builtin_object_size (objc_category, 0) != (size_t) -1) ? __builtin___memcpy_chk (objc_category, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct objc_category_t), __builtin_object_size (objc_category, 0)) : __inline_memcpy_chk (objc_category, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct objc_category_t)));
7573
7574
7575
7576      *trunc = FALSE;
7577  }
7578  else{
7579      ((__builtin_object_size (objc_category, 0) != (size_t) -1) ? __builtin___memcpy_chk (objc_category, objc_sections[i].contents + (addr - objc_sections[i].addr), left, __builtin_object_size (objc_category, 0)) : __inline_memcpy_chk (objc_category, objc_sections[i].contents + (addr - objc_sections[i].addr), left));
7580
7581
7582
7583      *trunc = TRUE;
7584  }
7585  if(swapped)
7586      swap_objc_category_t(objc_category, host_byte_sex);
7587  return(TRUE);
7588     }
7589 }
7590 return(FALSE);
7591}
7592
7593static
7594enum bool
7595get_ivar_list(
7596uint32_t addr,
7597struct objc_ivar_list_t *objc_ivar_list,
7598struct objc_ivar_t **ivar_list,
7599uint32_t *left,
7600enum bool *trunc,
7601struct section_info *objc_sections,
7602uint32_t nobjc_sections,
7603enum byte_sex host_byte_sex,
7604enum bool swapped)
7605{
7606    uint32_t i;
7607
7608 ((__builtin_object_size (objc_ivar_list, 0) != (size_t) -1) ? __builtin___memset_chk (objc_ivar_list, '\0', sizeof(struct objc_ivar_list_t), __builtin_object_size (objc_ivar_list, 0)) : __inline_memset_chk (objc_ivar_list, '\0', sizeof(struct objc_ivar_list_t)));
7609 if(addr == 0)
7610     return(FALSE);
7611 for(i = 0; i < nobjc_sections; i++){
7612     if(addr >= objc_sections[i].addr &&
7613        addr < objc_sections[i].addr + objc_sections[i].size){
7614
7615  *left = objc_sections[i].size -
7616          (addr - objc_sections[i].addr);
7617  if(*left >= sizeof(struct objc_ivar_list_t) -
7618       sizeof(struct objc_ivar_t)){
7619      ((__builtin_object_size (objc_ivar_list, 0) != (size_t) -1) ? __builtin___memcpy_chk (objc_ivar_list, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct objc_ivar_list_t) - sizeof(struct objc_ivar_t), __builtin_object_size (objc_ivar_list, 0)) : __inline_memcpy_chk (objc_ivar_list, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct objc_ivar_list_t) - sizeof(struct objc_ivar_t)));
7620
7621
7622
7623
7624      *left -= sizeof(struct objc_ivar_list_t) -
7625        sizeof(struct objc_ivar_t);
7626      *ivar_list = (struct objc_ivar_t *)
7627     (objc_sections[i].contents +
7628         (addr - objc_sections[i].addr) +
7629      sizeof(struct objc_ivar_list_t) -
7630          sizeof(struct objc_ivar_t));
7631      *trunc = FALSE;
7632  }
7633  else{
7634      ((__builtin_object_size (objc_ivar_list, 0) != (size_t) -1) ? __builtin___memcpy_chk (objc_ivar_list, objc_sections[i].contents + (addr - objc_sections[i].addr), *left, __builtin_object_size (objc_ivar_list, 0)) : __inline_memcpy_chk (objc_ivar_list, objc_sections[i].contents + (addr - objc_sections[i].addr), *left));
7635
7636
7637
7638      *left = 0;
7639      *ivar_list = ((void *)0);
7640      *trunc = TRUE;
7641  }
7642  if(swapped)
7643      swap_objc_ivar_list_t(objc_ivar_list, host_byte_sex);
7644  return(TRUE);
7645     }
7646 }
7647 return(FALSE);
7648}
7649
7650static
7651enum bool
7652get_method_list(
7653uint32_t addr,
7654struct objc_method_list_t *method_list,
7655struct objc_method_t **methods,
7656uint32_t *left,
7657enum bool *trunc,
7658struct section_info *objc_sections,
7659uint32_t nobjc_sections,
7660enum byte_sex host_byte_sex,
7661enum bool swapped)
7662{
7663    uint32_t i;
7664
7665 ((__builtin_object_size (method_list, 0) != (size_t) -1) ? __builtin___memset_chk (method_list, '\0', sizeof(struct objc_method_list_t), __builtin_object_size (method_list, 0)) : __inline_memset_chk (method_list, '\0', sizeof(struct objc_method_list_t)));
7666 if(addr == 0)
7667     return(FALSE);
7668 for(i = 0; i < nobjc_sections; i++){
7669     if(addr >= objc_sections[i].addr &&
7670        addr < objc_sections[i].addr + objc_sections[i].size){
7671
7672  *left = objc_sections[i].size -
7673          (addr - objc_sections[i].addr);
7674  if(*left >= sizeof(struct objc_method_list_t) -
7675       sizeof(struct objc_method_t)){
7676      ((__builtin_object_size (method_list, 0) != (size_t) -1) ? __builtin___memcpy_chk (method_list, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct objc_method_list_t) - sizeof(struct objc_method_t), __builtin_object_size (method_list, 0)) : __inline_memcpy_chk (method_list, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct objc_method_list_t) - sizeof(struct objc_method_t)));
7677
7678
7679
7680
7681      *left -= sizeof(struct objc_method_list_t) -
7682        sizeof(struct objc_method_t);
7683      *methods = (struct objc_method_t *)
7684     (objc_sections[i].contents +
7685         (addr - objc_sections[i].addr) +
7686      sizeof(struct objc_method_list_t) -
7687          sizeof(struct objc_method_t));
7688      *trunc = FALSE;
7689  }
7690  else{
7691      ((__builtin_object_size (method_list, 0) != (size_t) -1) ? __builtin___memcpy_chk (method_list, objc_sections[i].contents + (addr - objc_sections[i].addr), *left, __builtin_object_size (method_list, 0)) : __inline_memcpy_chk (method_list, objc_sections[i].contents + (addr - objc_sections[i].addr), *left));
7692
7693
7694
7695      *left = 0;
7696      *methods = ((void *)0);
7697      *trunc = TRUE;
7698  }
7699  if(swapped)
7700      swap_objc_method_list_t(method_list, host_byte_sex);
7701  return(TRUE);
7702     }
7703 }
7704 return(FALSE);
7705}
7706
7707static
7708enum bool
7709get_protocol_list(
7710uint32_t addr,
7711struct objc_protocol_list_t *protocol_list,
7712uint32_t **list,
7713uint32_t *left,
7714enum bool *trunc,
7715struct section_info *objc_sections,
7716uint32_t nobjc_sections,
7717enum byte_sex host_byte_sex,
7718enum bool swapped)
7719{
7720    uint32_t i;
7721
7722 ((__builtin_object_size (protocol_list, 0) != (size_t) -1) ? __builtin___memset_chk (protocol_list, '\0', sizeof(struct objc_protocol_list_t), __builtin_object_size (protocol_list, 0)) : __inline_memset_chk (protocol_list, '\0', sizeof(struct objc_protocol_list_t)));
7723 if(addr == 0)
7724     return(FALSE);
7725 for(i = 0; i < nobjc_sections; i++){
7726     if(addr >= objc_sections[i].addr &&
7727        addr < objc_sections[i].addr + objc_sections[i].size){
7728
7729  *left = objc_sections[i].size -
7730          (addr - objc_sections[i].addr);
7731  if(*left >= sizeof(struct objc_protocol_list_t) -
7732       sizeof(uint32_t)){
7733      ((__builtin_object_size (protocol_list, 0) != (size_t) -1) ? __builtin___memcpy_chk (protocol_list, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct objc_protocol_list_t) - sizeof(uint32_t), __builtin_object_size (protocol_list, 0)) : __inline_memcpy_chk (protocol_list, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct objc_protocol_list_t) - sizeof(uint32_t)));
7734
7735
7736
7737
7738      *left -= sizeof(struct objc_protocol_list_t) -
7739        sizeof(uint32_t);
7740      *list = (uint32_t *)
7741     (objc_sections[i].contents +
7742         (addr - objc_sections[i].addr) +
7743      sizeof(struct objc_protocol_list_t) -
7744          sizeof(uint32_t));
7745      *trunc = FALSE;
7746  }
7747  else{
7748      ((__builtin_object_size (protocol_list, 0) != (size_t) -1) ? __builtin___memcpy_chk (protocol_list, objc_sections[i].contents + (addr - objc_sections[i].addr), *left, __builtin_object_size (protocol_list, 0)) : __inline_memcpy_chk (protocol_list, objc_sections[i].contents + (addr - objc_sections[i].addr), *left));
7749
7750
7751
7752      *left = 0;
7753      *list = ((void *)0);
7754      *trunc = TRUE;
7755  }
7756  if(swapped)
7757      swap_objc_protocol_list_t(protocol_list, host_byte_sex);
7758  return(TRUE);
7759     }
7760 }
7761 return(FALSE);
7762}
7763
7764static
7765enum bool
7766get_protocol(
7767uint32_t addr,
7768struct objc_protocol_t *protocol,
7769enum bool *trunc,
7770struct section_info *objc_sections,
7771uint32_t nobjc_sections,
7772enum byte_sex host_byte_sex,
7773enum bool swapped)
7774{
7775    uint32_t left, i;
7776
7777 ((__builtin_object_size (protocol, 0) != (size_t) -1) ? __builtin___memset_chk (protocol, '\0', sizeof(struct objc_protocol_t), __builtin_object_size (protocol, 0)) : __inline_memset_chk (protocol, '\0', sizeof(struct objc_protocol_t)));
7778 if(addr == 0)
7779     return(FALSE);
7780 for(i = 0; i < nobjc_sections; i++){
7781     if(addr >= objc_sections[i].addr &&
7782        addr < objc_sections[i].addr + objc_sections[i].size){
7783
7784  left = objc_sections[i].size -
7785          (addr - objc_sections[i].addr);
7786  if(left >= sizeof(struct objc_protocol_t)){
7787      ((__builtin_object_size (protocol, 0) != (size_t) -1) ? __builtin___memcpy_chk (protocol, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct objc_protocol_t), __builtin_object_size (protocol, 0)) : __inline_memcpy_chk (protocol, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct objc_protocol_t)));
7788
7789
7790
7791      *trunc = FALSE;
7792  }
7793  else{
7794      ((__builtin_object_size (protocol, 0) != (size_t) -1) ? __builtin___memcpy_chk (protocol, objc_sections[i].contents + (addr - objc_sections[i].addr), left, __builtin_object_size (protocol, 0)) : __inline_memcpy_chk (protocol, objc_sections[i].contents + (addr - objc_sections[i].addr), left));
7795
7796
7797
7798      *trunc = TRUE;
7799  }
7800  if(swapped)
7801      swap_objc_protocol_t(protocol, host_byte_sex);
7802  return(TRUE);
7803     }
7804 }
7805 return(FALSE);
7806}
7807
7808static
7809enum bool
7810get_method_description_list(
7811uint32_t addr,
7812struct objc_method_description_list_t *mdl,
7813struct objc_method_description_t **list,
7814uint32_t *left,
7815enum bool *trunc,
7816struct section_info *objc_sections,
7817uint32_t nobjc_sections,
7818enum byte_sex host_byte_sex,
7819enum bool swapped)
7820{
7821    uint32_t i;
7822
7823 ((__builtin_object_size (mdl, 0) != (size_t) -1) ? __builtin___memset_chk (mdl, '\0', sizeof(struct objc_method_description_list_t), __builtin_object_size (mdl, 0)) : __inline_memset_chk (mdl, '\0', sizeof(struct objc_method_description_list_t)));
7824 if(addr == 0)
7825     return(FALSE);
7826 for(i = 0; i < nobjc_sections; i++){
7827     if(addr >= objc_sections[i].addr &&
7828        addr < objc_sections[i].addr + objc_sections[i].size){
7829
7830  *left = objc_sections[i].size -
7831          (addr - objc_sections[i].addr);
7832  if(*left >= sizeof(struct objc_method_description_list_t) -
7833       sizeof(struct objc_method_description_t)){
7834      ((__builtin_object_size (mdl, 0) != (size_t) -1) ? __builtin___memcpy_chk (mdl, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct objc_method_description_list_t) - sizeof(struct objc_method_description_t), __builtin_object_size (mdl, 0)) : __inline_memcpy_chk (mdl, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct objc_method_description_list_t) - sizeof(struct objc_method_description_t)));
7835
7836
7837
7838
7839      *left -= sizeof(struct objc_method_description_list_t) -
7840        sizeof(struct objc_method_description_t);
7841      *list = (struct objc_method_description_t *)
7842     (objc_sections[i].contents +
7843         (addr - objc_sections[i].addr) +
7844     sizeof(struct objc_method_description_list_t) -
7845          sizeof(struct objc_method_description_t));
7846      *trunc = FALSE;
7847  }
7848  else{
7849      ((__builtin_object_size (mdl, 0) != (size_t) -1) ? __builtin___memcpy_chk (mdl, objc_sections[i].contents + (addr - objc_sections[i].addr), *left, __builtin_object_size (mdl, 0)) : __inline_memcpy_chk (mdl, objc_sections[i].contents + (addr - objc_sections[i].addr), *left));
7850
7851
7852
7853      *left = 0;
7854      *list = ((void *)0);
7855      *trunc = TRUE;
7856  }
7857  if(swapped)
7858      swap_objc_method_description_list_t(mdl, host_byte_sex);
7859  return(TRUE);
7860     }
7861 }
7862 return(FALSE);
7863}
7864
7865static
7866enum bool
7867get_hashEntry(
7868uint32_t addr,
7869struct _hashEntry_t *_hashEntry,
7870enum bool *trunc,
7871struct section_info *objc_sections,
7872uint32_t nobjc_sections,
7873enum byte_sex host_byte_sex,
7874enum bool swapped)
7875{
7876    uint32_t left, i;
7877
7878 ((__builtin_object_size (_hashEntry, 0) != (size_t) -1) ? __builtin___memset_chk (_hashEntry, '\0', sizeof(struct _hashEntry_t), __builtin_object_size (_hashEntry, 0)) : __inline_memset_chk (_hashEntry, '\0', sizeof(struct _hashEntry_t)));
7879 if(addr == 0)
7880     return(FALSE);
7881 for(i = 0; i < nobjc_sections; i++){
7882     if(addr >= objc_sections[i].addr &&
7883        addr < objc_sections[i].addr + objc_sections[i].size){
7884
7885  left = objc_sections[i].size -
7886          (addr - objc_sections[i].addr);
7887  if(left >= sizeof(struct _hashEntry_t)){
7888      ((__builtin_object_size (_hashEntry, 0) != (size_t) -1) ? __builtin___memcpy_chk (_hashEntry, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct _hashEntry_t), __builtin_object_size (_hashEntry, 0)) : __inline_memcpy_chk (_hashEntry, objc_sections[i].contents + (addr - objc_sections[i].addr), sizeof(struct _hashEntry_t)));
7889
7890
7891
7892      *trunc = FALSE;
7893  }
7894  else{
7895      ((__builtin_object_size (_hashEntry, 0) != (size_t) -1) ? __builtin___memcpy_chk (_hashEntry, objc_sections[i].contents + (addr - objc_sections[i].addr), left, __builtin_object_size (_hashEntry, 0)) : __inline_memcpy_chk (_hashEntry, objc_sections[i].contents + (addr - objc_sections[i].addr), left));
7896
7897
7898
7899      *trunc = TRUE;
7900  }
7901  if(swapped)
7902      swap_hashEntry_t(_hashEntry, host_byte_sex);
7903  return(TRUE);
7904     }
7905 }
7906 return(FALSE);
7907}