Ticket #34232: clang_print_objc.pp.c

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

using clang v1.5

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