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 |
---|
22 | typedef signed char __int8_t; |
---|
23 | |
---|
24 | |
---|
25 | |
---|
26 | typedef unsigned char __uint8_t; |
---|
27 | typedef short __int16_t; |
---|
28 | typedef unsigned short __uint16_t; |
---|
29 | typedef int __int32_t; |
---|
30 | typedef unsigned int __uint32_t; |
---|
31 | typedef long long __int64_t; |
---|
32 | typedef unsigned long long __uint64_t; |
---|
33 | |
---|
34 | typedef long __darwin_intptr_t; |
---|
35 | typedef unsigned int __darwin_natural_t; |
---|
36 | # 70 "/usr/include/i386/_types.h" 3 4 |
---|
37 | typedef int __darwin_ct_rune_t; |
---|
38 | |
---|
39 | |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | typedef union { |
---|
44 | char __mbstate8[128]; |
---|
45 | long long _mbstateL; |
---|
46 | } __mbstate_t; |
---|
47 | |
---|
48 | typedef __mbstate_t __darwin_mbstate_t; |
---|
49 | |
---|
50 | |
---|
51 | typedef long int __darwin_ptrdiff_t; |
---|
52 | |
---|
53 | |
---|
54 | |
---|
55 | |
---|
56 | |
---|
57 | typedef long unsigned int __darwin_size_t; |
---|
58 | |
---|
59 | |
---|
60 | |
---|
61 | |
---|
62 | |
---|
63 | typedef __builtin_va_list __darwin_va_list; |
---|
64 | |
---|
65 | |
---|
66 | |
---|
67 | |
---|
68 | |
---|
69 | typedef int __darwin_wchar_t; |
---|
70 | |
---|
71 | |
---|
72 | |
---|
73 | |
---|
74 | typedef __darwin_wchar_t __darwin_rune_t; |
---|
75 | |
---|
76 | |
---|
77 | typedef int __darwin_wint_t; |
---|
78 | |
---|
79 | |
---|
80 | |
---|
81 | |
---|
82 | typedef unsigned long __darwin_clock_t; |
---|
83 | typedef __uint32_t __darwin_socklen_t; |
---|
84 | typedef long __darwin_ssize_t; |
---|
85 | typedef 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 |
---|
89 | struct __darwin_pthread_handler_rec |
---|
90 | { |
---|
91 | void (*__routine)(void *); |
---|
92 | void *__arg; |
---|
93 | struct __darwin_pthread_handler_rec *__next; |
---|
94 | }; |
---|
95 | struct _opaque_pthread_attr_t { long __sig; char __opaque[56]; }; |
---|
96 | struct _opaque_pthread_cond_t { long __sig; char __opaque[40]; }; |
---|
97 | struct _opaque_pthread_condattr_t { long __sig; char __opaque[8]; }; |
---|
98 | struct _opaque_pthread_mutex_t { long __sig; char __opaque[56]; }; |
---|
99 | struct _opaque_pthread_mutexattr_t { long __sig; char __opaque[8]; }; |
---|
100 | struct _opaque_pthread_once_t { long __sig; char __opaque[8]; }; |
---|
101 | struct _opaque_pthread_rwlock_t { long __sig; char __opaque[192]; }; |
---|
102 | struct _opaque_pthread_rwlockattr_t { long __sig; char __opaque[16]; }; |
---|
103 | struct _opaque_pthread_t { long __sig; struct __darwin_pthread_handler_rec *__cleanup_stack; char __opaque[1168]; }; |
---|
104 | # 94 "/usr/include/sys/_types.h" 3 4 |
---|
105 | typedef __int64_t __darwin_blkcnt_t; |
---|
106 | typedef __int32_t __darwin_blksize_t; |
---|
107 | typedef __int32_t __darwin_dev_t; |
---|
108 | typedef unsigned int __darwin_fsblkcnt_t; |
---|
109 | typedef unsigned int __darwin_fsfilcnt_t; |
---|
110 | typedef __uint32_t __darwin_gid_t; |
---|
111 | typedef __uint32_t __darwin_id_t; |
---|
112 | typedef __uint64_t __darwin_ino64_t; |
---|
113 | |
---|
114 | typedef __darwin_ino64_t __darwin_ino_t; |
---|
115 | |
---|
116 | |
---|
117 | |
---|
118 | typedef __darwin_natural_t __darwin_mach_port_name_t; |
---|
119 | typedef __darwin_mach_port_name_t __darwin_mach_port_t; |
---|
120 | typedef __uint16_t __darwin_mode_t; |
---|
121 | typedef __int64_t __darwin_off_t; |
---|
122 | typedef __int32_t __darwin_pid_t; |
---|
123 | typedef struct _opaque_pthread_attr_t |
---|
124 | __darwin_pthread_attr_t; |
---|
125 | typedef struct _opaque_pthread_cond_t |
---|
126 | __darwin_pthread_cond_t; |
---|
127 | typedef struct _opaque_pthread_condattr_t |
---|
128 | __darwin_pthread_condattr_t; |
---|
129 | typedef unsigned long __darwin_pthread_key_t; |
---|
130 | typedef struct _opaque_pthread_mutex_t |
---|
131 | __darwin_pthread_mutex_t; |
---|
132 | typedef struct _opaque_pthread_mutexattr_t |
---|
133 | __darwin_pthread_mutexattr_t; |
---|
134 | typedef struct _opaque_pthread_once_t |
---|
135 | __darwin_pthread_once_t; |
---|
136 | typedef struct _opaque_pthread_rwlock_t |
---|
137 | __darwin_pthread_rwlock_t; |
---|
138 | typedef struct _opaque_pthread_rwlockattr_t |
---|
139 | __darwin_pthread_rwlockattr_t; |
---|
140 | typedef struct _opaque_pthread_t |
---|
141 | *__darwin_pthread_t; |
---|
142 | typedef __uint32_t __darwin_sigset_t; |
---|
143 | typedef __int32_t __darwin_suseconds_t; |
---|
144 | typedef __uint32_t __darwin_uid_t; |
---|
145 | typedef __uint32_t __darwin_useconds_t; |
---|
146 | typedef unsigned char __darwin_uuid_t[16]; |
---|
147 | typedef char __darwin_uuid_string_t[37]; |
---|
148 | # 28 "/usr/include/_types.h" 2 3 4 |
---|
149 | # 39 "/usr/include/_types.h" 3 4 |
---|
150 | typedef int __darwin_nl_item; |
---|
151 | typedef int __darwin_wctrans_t; |
---|
152 | |
---|
153 | typedef __uint32_t __darwin_wctype_t; |
---|
154 | # 65 "/usr/include/stdio.h" 2 3 4 |
---|
155 | |
---|
156 | |
---|
157 | |
---|
158 | |
---|
159 | |
---|
160 | typedef __darwin_va_list va_list; |
---|
161 | |
---|
162 | |
---|
163 | |
---|
164 | |
---|
165 | typedef __darwin_off_t off_t; |
---|
166 | |
---|
167 | |
---|
168 | |
---|
169 | |
---|
170 | typedef __darwin_size_t size_t; |
---|
171 | |
---|
172 | |
---|
173 | |
---|
174 | |
---|
175 | |
---|
176 | |
---|
177 | typedef __darwin_off_t fpos_t; |
---|
178 | # 98 "/usr/include/stdio.h" 3 4 |
---|
179 | struct __sbuf { |
---|
180 | unsigned char *_base; |
---|
181 | int _size; |
---|
182 | }; |
---|
183 | |
---|
184 | |
---|
185 | struct __sFILEX; |
---|
186 | # 132 "/usr/include/stdio.h" 3 4 |
---|
187 | typedef 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 | |
---|
222 | extern FILE *__stdinp; |
---|
223 | extern FILE *__stdoutp; |
---|
224 | extern FILE *__stderrp; |
---|
225 | # 249 "/usr/include/stdio.h" 3 4 |
---|
226 | void clearerr(FILE *); |
---|
227 | int fclose(FILE *); |
---|
228 | int feof(FILE *); |
---|
229 | int ferror(FILE *); |
---|
230 | int fflush(FILE *); |
---|
231 | int fgetc(FILE *); |
---|
232 | int fgetpos(FILE * restrict, fpos_t *); |
---|
233 | char *fgets(char * restrict, int, FILE *); |
---|
234 | |
---|
235 | |
---|
236 | |
---|
237 | FILE *fopen(const char * restrict, const char * restrict) __asm("_" "fopen" ); |
---|
238 | |
---|
239 | int fprintf(FILE * restrict, const char * restrict, ...) ; |
---|
240 | int fputc(int, FILE *); |
---|
241 | int fputs(const char * restrict, FILE * restrict) __asm("_" "fputs" ); |
---|
242 | size_t fread(void * restrict, size_t, size_t, FILE * restrict); |
---|
243 | FILE *freopen(const char * restrict, const char * restrict, |
---|
244 | FILE * restrict) __asm("_" "freopen" ); |
---|
245 | int fscanf(FILE * restrict, const char * restrict, ...) ; |
---|
246 | int fseek(FILE *, long, int); |
---|
247 | int fsetpos(FILE *, const fpos_t *); |
---|
248 | long ftell(FILE *); |
---|
249 | size_t fwrite(const void * restrict, size_t, size_t, FILE * restrict) __asm("_" "fwrite" ); |
---|
250 | int getc(FILE *); |
---|
251 | int getchar(void); |
---|
252 | char *gets(char *); |
---|
253 | |
---|
254 | extern const int sys_nerr; |
---|
255 | extern const char *const sys_errlist[]; |
---|
256 | |
---|
257 | void perror(const char *); |
---|
258 | int printf(const char * restrict, ...) ; |
---|
259 | int putc(int, FILE *); |
---|
260 | int putchar(int); |
---|
261 | int puts(const char *); |
---|
262 | int remove(const char *); |
---|
263 | int rename (const char *, const char *); |
---|
264 | void rewind(FILE *); |
---|
265 | int scanf(const char * restrict, ...) ; |
---|
266 | void setbuf(FILE * restrict, char * restrict); |
---|
267 | int setvbuf(FILE * restrict, char * restrict, int, size_t); |
---|
268 | int sprintf(char * restrict, const char * restrict, ...) ; |
---|
269 | int sscanf(const char * restrict, const char * restrict, ...) ; |
---|
270 | FILE *tmpfile(void); |
---|
271 | char *tmpnam(char *); |
---|
272 | int ungetc(int, FILE *); |
---|
273 | int vfprintf(FILE * restrict, const char * restrict, va_list) ; |
---|
274 | int vprintf(const char * restrict, va_list) ; |
---|
275 | int vsprintf(char * restrict, const char * restrict, va_list) ; |
---|
276 | |
---|
277 | int asprintf(char **, const char *, ...) ; |
---|
278 | int vasprintf(char **, const char *, va_list) ; |
---|
279 | # 312 "/usr/include/stdio.h" 3 4 |
---|
280 | char *ctermid(char *); |
---|
281 | |
---|
282 | char *ctermid_r(char *); |
---|
283 | |
---|
284 | |
---|
285 | |
---|
286 | |
---|
287 | FILE *fdopen(int, const char *) __asm("_" "fdopen" ); |
---|
288 | |
---|
289 | |
---|
290 | char *fgetln(FILE *, size_t *); |
---|
291 | |
---|
292 | int fileno(FILE *); |
---|
293 | void flockfile(FILE *); |
---|
294 | |
---|
295 | const char |
---|
296 | *fmtcheck(const char *, const char *); |
---|
297 | int fpurge(FILE *); |
---|
298 | |
---|
299 | int fseeko(FILE *, off_t, int); |
---|
300 | off_t ftello(FILE *); |
---|
301 | int ftrylockfile(FILE *); |
---|
302 | void funlockfile(FILE *); |
---|
303 | int getc_unlocked(FILE *); |
---|
304 | int getchar_unlocked(void); |
---|
305 | |
---|
306 | int getw(FILE *); |
---|
307 | |
---|
308 | int pclose(FILE *); |
---|
309 | |
---|
310 | |
---|
311 | |
---|
312 | FILE *popen(const char *, const char *) __asm("_" "popen" ); |
---|
313 | |
---|
314 | int putc_unlocked(int, FILE *); |
---|
315 | int putchar_unlocked(int); |
---|
316 | |
---|
317 | int putw(int, FILE *); |
---|
318 | void setbuffer(FILE *, char *, int); |
---|
319 | int setlinebuf(FILE *); |
---|
320 | |
---|
321 | int snprintf(char * restrict, size_t, const char * restrict, ...) ; |
---|
322 | char *tempnam(const char *, const char *) __asm("_" "tempnam" ); |
---|
323 | int vfscanf(FILE * restrict, const char * restrict, va_list) ; |
---|
324 | int vscanf(const char * restrict, va_list) ; |
---|
325 | int vsnprintf(char * restrict, size_t, const char * restrict, va_list) ; |
---|
326 | int vsscanf(const char * restrict, const char * restrict, va_list) ; |
---|
327 | |
---|
328 | FILE *zopen(const char *, const char *, int); |
---|
329 | # 369 "/usr/include/stdio.h" 3 4 |
---|
330 | FILE *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 |
---|
336 | int __srget(FILE *); |
---|
337 | int __svfscanf(FILE *, const char *, va_list) ; |
---|
338 | int __swbuf(int, FILE *); |
---|
339 | # 395 "/usr/include/stdio.h" 3 4 |
---|
340 | static __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 |
---|
352 | extern int __sprintf_chk (char * restrict, int, size_t, |
---|
353 | const char * restrict, ...) |
---|
354 | ; |
---|
355 | |
---|
356 | |
---|
357 | |
---|
358 | |
---|
359 | extern int __snprintf_chk (char * restrict, size_t, int, size_t, |
---|
360 | const char * restrict, ...) |
---|
361 | ; |
---|
362 | |
---|
363 | |
---|
364 | |
---|
365 | |
---|
366 | extern int __vsprintf_chk (char * restrict, int, size_t, |
---|
367 | const char * restrict, va_list) |
---|
368 | ; |
---|
369 | |
---|
370 | |
---|
371 | |
---|
372 | |
---|
373 | extern 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 |
---|
380 | typedef __darwin_ssize_t ssize_t; |
---|
381 | # 81 "/usr/include/string.h" 3 4 |
---|
382 | void *memchr(const void *, int, size_t); |
---|
383 | int memcmp(const void *, const void *, size_t); |
---|
384 | void *memcpy(void *, const void *, size_t); |
---|
385 | void *memmove(void *, const void *, size_t); |
---|
386 | void *memset(void *, int, size_t); |
---|
387 | |
---|
388 | char *stpcpy(char *, const char *); |
---|
389 | char *strcasestr(const char *, const char *); |
---|
390 | |
---|
391 | char *strcat(char *, const char *); |
---|
392 | char *strchr(const char *, int); |
---|
393 | int strcmp(const char *, const char *); |
---|
394 | int strcoll(const char *, const char *); |
---|
395 | char *strcpy(char *, const char *); |
---|
396 | size_t strcspn(const char *, const char *); |
---|
397 | char *strerror(int) __asm("_" "strerror" ); |
---|
398 | int strerror_r(int, char *, size_t); |
---|
399 | size_t strlen(const char *); |
---|
400 | char *strncat(char *, const char *, size_t); |
---|
401 | int strncmp(const char *, const char *, size_t); |
---|
402 | char *strncpy(char *, const char *, size_t); |
---|
403 | |
---|
404 | char *strnstr(const char *, const char *, size_t); |
---|
405 | |
---|
406 | char *strpbrk(const char *, const char *); |
---|
407 | char *strrchr(const char *, int); |
---|
408 | size_t strspn(const char *, const char *); |
---|
409 | char *strstr(const char *, const char *); |
---|
410 | char *strtok(char *, const char *); |
---|
411 | size_t strxfrm(char *, const char *, size_t); |
---|
412 | |
---|
413 | |
---|
414 | |
---|
415 | void *memccpy(void *, const void *, int, size_t); |
---|
416 | char *strtok_r(char *, const char *, char **); |
---|
417 | char *strdup(const char *); |
---|
418 | |
---|
419 | int bcmp(const void *, const void *, size_t); |
---|
420 | void bcopy(const void *, void *, size_t); |
---|
421 | void bzero(void *, size_t); |
---|
422 | int ffs(int); |
---|
423 | int ffsl(long); |
---|
424 | int fls(int); |
---|
425 | int flsl(long); |
---|
426 | char *index(const char *, int); |
---|
427 | void memset_pattern4(void *, const void *, size_t); |
---|
428 | void memset_pattern8(void *, const void *, size_t); |
---|
429 | void memset_pattern16(void *, const void *, size_t); |
---|
430 | char *rindex(const char *, int); |
---|
431 | int strcasecmp(const char *, const char *); |
---|
432 | size_t strlcat(char *, const char *, size_t); |
---|
433 | size_t strlcpy(char *, const char *, size_t); |
---|
434 | void strmode(int, char *); |
---|
435 | int strncasecmp(const char *, const char *, size_t); |
---|
436 | char *strsep(char **, const char *); |
---|
437 | char *strsignal(int sig); |
---|
438 | void 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 |
---|
442 | static __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 | |
---|
453 | static __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 | |
---|
464 | static __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 | |
---|
475 | static __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 | |
---|
487 | static __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 | |
---|
499 | static __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 | |
---|
511 | static __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 | |
---|
522 | static __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 |
---|
536 | typedef signed char int8_t; |
---|
537 | |
---|
538 | |
---|
539 | |
---|
540 | |
---|
541 | typedef short int16_t; |
---|
542 | |
---|
543 | |
---|
544 | |
---|
545 | |
---|
546 | typedef int int32_t; |
---|
547 | |
---|
548 | |
---|
549 | |
---|
550 | |
---|
551 | typedef long long int64_t; |
---|
552 | |
---|
553 | |
---|
554 | |
---|
555 | |
---|
556 | typedef unsigned char uint8_t; |
---|
557 | |
---|
558 | |
---|
559 | |
---|
560 | |
---|
561 | typedef unsigned short uint16_t; |
---|
562 | |
---|
563 | |
---|
564 | |
---|
565 | |
---|
566 | typedef unsigned int uint32_t; |
---|
567 | |
---|
568 | |
---|
569 | |
---|
570 | |
---|
571 | typedef unsigned long long uint64_t; |
---|
572 | |
---|
573 | |
---|
574 | |
---|
575 | typedef int8_t int_least8_t; |
---|
576 | typedef int16_t int_least16_t; |
---|
577 | typedef int32_t int_least32_t; |
---|
578 | typedef int64_t int_least64_t; |
---|
579 | typedef uint8_t uint_least8_t; |
---|
580 | typedef uint16_t uint_least16_t; |
---|
581 | typedef uint32_t uint_least32_t; |
---|
582 | typedef uint64_t uint_least64_t; |
---|
583 | |
---|
584 | |
---|
585 | |
---|
586 | typedef int8_t int_fast8_t; |
---|
587 | typedef int16_t int_fast16_t; |
---|
588 | typedef int32_t int_fast32_t; |
---|
589 | typedef int64_t int_fast64_t; |
---|
590 | typedef uint8_t uint_fast8_t; |
---|
591 | typedef uint16_t uint_fast16_t; |
---|
592 | typedef uint32_t uint_fast32_t; |
---|
593 | typedef uint64_t uint_fast64_t; |
---|
594 | |
---|
595 | |
---|
596 | |
---|
597 | |
---|
598 | |
---|
599 | |
---|
600 | typedef long intptr_t; |
---|
601 | |
---|
602 | |
---|
603 | |
---|
604 | |
---|
605 | typedef unsigned long uintptr_t; |
---|
606 | |
---|
607 | |
---|
608 | |
---|
609 | |
---|
610 | |
---|
611 | |
---|
612 | |
---|
613 | typedef long int intmax_t; |
---|
614 | # 106 "/usr/include/stdint.h" 3 4 |
---|
615 | typedef 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 |
---|
632 | typedef __darwin_natural_t natural_t; |
---|
633 | typedef int integer_t; |
---|
634 | |
---|
635 | |
---|
636 | |
---|
637 | |
---|
638 | |
---|
639 | |
---|
640 | typedef uintptr_t vm_offset_t; |
---|
641 | # 112 "/usr/include/mach/i386/vm_types.h" 3 4 |
---|
642 | typedef uintptr_t vm_size_t; |
---|
643 | # 124 "/usr/include/mach/i386/vm_types.h" 3 4 |
---|
644 | typedef uint64_t mach_vm_address_t; |
---|
645 | typedef uint64_t mach_vm_offset_t; |
---|
646 | typedef uint64_t mach_vm_size_t; |
---|
647 | |
---|
648 | typedef uint64_t vm_map_offset_t; |
---|
649 | typedef uint64_t vm_map_address_t; |
---|
650 | typedef 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 |
---|
659 | typedef 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" |
---|
664 | struct 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 | |
---|
672 | typedef struct machine_info *machine_info_t; |
---|
673 | typedef struct machine_info machine_info_data_t; |
---|
674 | |
---|
675 | typedef int cpu_type_t; |
---|
676 | typedef int cpu_subtype_t; |
---|
677 | typedef integer_t cpu_threadtype_t; |
---|
678 | |
---|
679 | |
---|
680 | |
---|
681 | |
---|
682 | |
---|
683 | |
---|
684 | |
---|
685 | struct 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 | |
---|
694 | typedef struct machine_slot *machine_slot_t; |
---|
695 | typedef 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 |
---|
704 | typedef 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 |
---|
717 | struct __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 |
---|
737 | struct __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 | }; |
---|
762 | typedef struct __darwin_fp_control __darwin_fp_control_t; |
---|
763 | # 147 "/usr/include/mach/i386/_structs.h" 3 4 |
---|
764 | struct __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 | }; |
---|
781 | typedef struct __darwin_fp_status __darwin_fp_status_t; |
---|
782 | # 191 "/usr/include/mach/i386/_structs.h" 3 4 |
---|
783 | struct __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 |
---|
789 | struct __darwin_xmm_reg |
---|
790 | { |
---|
791 | char __xmm_reg[16]; |
---|
792 | }; |
---|
793 | # 232 "/usr/include/mach/i386/_structs.h" 3 4 |
---|
794 | struct __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 |
---|
830 | struct __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 |
---|
837 | struct __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 |
---|
849 | struct __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 |
---|
874 | struct __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 |
---|
924 | struct __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 |
---|
931 | struct __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 |
---|
947 | typedef natural_t mach_port_name_t; |
---|
948 | typedef mach_port_name_t *mach_port_name_array_t; |
---|
949 | # 128 "/usr/include/mach/port.h" 3 4 |
---|
950 | typedef mach_port_name_t mach_port_t; |
---|
951 | |
---|
952 | |
---|
953 | |
---|
954 | typedef mach_port_t *mach_port_array_t; |
---|
955 | # 190 "/usr/include/mach/port.h" 3 4 |
---|
956 | typedef natural_t mach_port_right_t; |
---|
957 | # 200 "/usr/include/mach/port.h" 3 4 |
---|
958 | typedef natural_t mach_port_type_t; |
---|
959 | typedef mach_port_type_t *mach_port_type_array_t; |
---|
960 | # 233 "/usr/include/mach/port.h" 3 4 |
---|
961 | typedef natural_t mach_port_urefs_t; |
---|
962 | typedef integer_t mach_port_delta_t; |
---|
963 | |
---|
964 | |
---|
965 | |
---|
966 | typedef natural_t mach_port_seqno_t; |
---|
967 | typedef natural_t mach_port_mscount_t; |
---|
968 | typedef natural_t mach_port_msgcount_t; |
---|
969 | typedef natural_t mach_port_rights_t; |
---|
970 | |
---|
971 | |
---|
972 | |
---|
973 | |
---|
974 | |
---|
975 | |
---|
976 | typedef unsigned int mach_port_srights_t; |
---|
977 | |
---|
978 | typedef 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 |
---|
991 | typedef struct mach_port_limits { |
---|
992 | mach_port_msgcount_t mpl_qlimit; |
---|
993 | } mach_port_limits_t; |
---|
994 | |
---|
995 | typedef integer_t *mach_port_info_t; |
---|
996 | |
---|
997 | |
---|
998 | typedef int mach_port_flavor_t; |
---|
999 | # 295 "/usr/include/mach/port.h" 3 4 |
---|
1000 | typedef 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 |
---|
1014 | typedef 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 |
---|
1019 | typedef natural_t mach_msg_timeout_t; |
---|
1020 | # 172 "/usr/include/mach/message.h" 3 4 |
---|
1021 | typedef unsigned int mach_msg_bits_t; |
---|
1022 | typedef natural_t mach_msg_size_t; |
---|
1023 | typedef integer_t mach_msg_id_t; |
---|
1024 | |
---|
1025 | |
---|
1026 | |
---|
1027 | |
---|
1028 | typedef unsigned int mach_msg_type_name_t; |
---|
1029 | # 189 "/usr/include/mach/message.h" 3 4 |
---|
1030 | typedef unsigned int mach_msg_copy_options_t; |
---|
1031 | # 211 "/usr/include/mach/message.h" 3 4 |
---|
1032 | typedef unsigned int mach_msg_descriptor_type_t; |
---|
1033 | |
---|
1034 | |
---|
1035 | |
---|
1036 | |
---|
1037 | |
---|
1038 | |
---|
1039 | #pragma pack(4) |
---|
1040 | |
---|
1041 | |
---|
1042 | typedef 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 | |
---|
1050 | typedef 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 | |
---|
1062 | typedef 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 | |
---|
1072 | typedef 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 | |
---|
1082 | typedef 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 | |
---|
1100 | typedef 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 | |
---|
1110 | typedef 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 | |
---|
1120 | typedef 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 |
---|
1138 | typedef 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 | |
---|
1147 | typedef struct |
---|
1148 | { |
---|
1149 | mach_msg_size_t msgh_descriptor_count; |
---|
1150 | } mach_msg_body_t; |
---|
1151 | |
---|
1152 | |
---|
1153 | |
---|
1154 | |
---|
1155 | typedef 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 | |
---|
1167 | typedef struct |
---|
1168 | { |
---|
1169 | mach_msg_header_t header; |
---|
1170 | mach_msg_body_t body; |
---|
1171 | } mach_msg_base_t; |
---|
1172 | |
---|
1173 | typedef unsigned int mach_msg_trailer_type_t; |
---|
1174 | |
---|
1175 | |
---|
1176 | |
---|
1177 | typedef unsigned int mach_msg_trailer_size_t; |
---|
1178 | |
---|
1179 | typedef 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 | |
---|
1185 | typedef 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 | |
---|
1192 | typedef struct |
---|
1193 | { |
---|
1194 | unsigned int val[2]; |
---|
1195 | } security_token_t; |
---|
1196 | |
---|
1197 | typedef 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 |
---|
1205 | typedef struct |
---|
1206 | { |
---|
1207 | unsigned int val[8]; |
---|
1208 | } audit_token_t; |
---|
1209 | |
---|
1210 | typedef 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 | |
---|
1219 | typedef 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 | |
---|
1230 | typedef struct |
---|
1231 | { |
---|
1232 | mach_port_name_t sender; |
---|
1233 | } msg_labels_t; |
---|
1234 | |
---|
1235 | |
---|
1236 | |
---|
1237 | |
---|
1238 | |
---|
1239 | |
---|
1240 | typedef 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 |
---|
1252 | typedef mach_msg_mac_trailer_t mach_msg_max_trailer_t; |
---|
1253 | # 474 "/usr/include/mach/message.h" 3 4 |
---|
1254 | typedef mach_msg_security_trailer_t mach_msg_format_0_trailer_t; |
---|
1255 | |
---|
1256 | |
---|
1257 | |
---|
1258 | |
---|
1259 | |
---|
1260 | |
---|
1261 | |
---|
1262 | extern security_token_t KERNEL_SECURITY_TOKEN; |
---|
1263 | |
---|
1264 | |
---|
1265 | extern audit_token_t KERNEL_AUDIT_TOKEN; |
---|
1266 | |
---|
1267 | typedef integer_t mach_msg_options_t; |
---|
1268 | |
---|
1269 | typedef struct |
---|
1270 | { |
---|
1271 | mach_msg_header_t header; |
---|
1272 | } mach_msg_empty_send_t; |
---|
1273 | |
---|
1274 | typedef struct |
---|
1275 | { |
---|
1276 | mach_msg_header_t header; |
---|
1277 | mach_msg_trailer_t trailer; |
---|
1278 | } mach_msg_empty_rcv_t; |
---|
1279 | |
---|
1280 | typedef 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 |
---|
1289 | typedef natural_t mach_msg_type_size_t; |
---|
1290 | typedef natural_t mach_msg_type_number_t; |
---|
1291 | # 571 "/usr/include/mach/message.h" 3 4 |
---|
1292 | typedef integer_t mach_msg_option_t; |
---|
1293 | # 648 "/usr/include/mach/message.h" 3 4 |
---|
1294 | typedef kern_return_t mach_msg_return_t; |
---|
1295 | # 750 "/usr/include/mach/message.h" 3 4 |
---|
1296 | extern 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 |
---|
1307 | extern 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 |
---|
1318 | struct 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 |
---|
1343 | struct x86_state_hdr { |
---|
1344 | int flavor; |
---|
1345 | int count; |
---|
1346 | }; |
---|
1347 | typedef struct x86_state_hdr x86_state_hdr_t; |
---|
1348 | # 159 "/usr/include/mach/i386/thread_status.h" 3 4 |
---|
1349 | typedef struct __darwin_i386_thread_state i386_thread_state_t; |
---|
1350 | |
---|
1351 | |
---|
1352 | |
---|
1353 | typedef struct __darwin_i386_thread_state x86_thread_state32_t; |
---|
1354 | |
---|
1355 | |
---|
1356 | |
---|
1357 | |
---|
1358 | |
---|
1359 | |
---|
1360 | typedef struct __darwin_i386_float_state i386_float_state_t; |
---|
1361 | |
---|
1362 | |
---|
1363 | |
---|
1364 | typedef struct __darwin_i386_float_state x86_float_state32_t; |
---|
1365 | |
---|
1366 | |
---|
1367 | |
---|
1368 | |
---|
1369 | |
---|
1370 | |
---|
1371 | typedef struct __darwin_i386_exception_state i386_exception_state_t; |
---|
1372 | |
---|
1373 | |
---|
1374 | |
---|
1375 | typedef struct __darwin_i386_exception_state x86_exception_state32_t; |
---|
1376 | |
---|
1377 | |
---|
1378 | |
---|
1379 | |
---|
1380 | |
---|
1381 | typedef struct __darwin_x86_debug_state32 x86_debug_state32_t; |
---|
1382 | |
---|
1383 | |
---|
1384 | |
---|
1385 | |
---|
1386 | |
---|
1387 | typedef struct __darwin_x86_thread_state64 x86_thread_state64_t; |
---|
1388 | |
---|
1389 | |
---|
1390 | |
---|
1391 | typedef struct __darwin_x86_float_state64 x86_float_state64_t; |
---|
1392 | |
---|
1393 | |
---|
1394 | |
---|
1395 | typedef struct __darwin_x86_exception_state64 x86_exception_state64_t; |
---|
1396 | |
---|
1397 | |
---|
1398 | |
---|
1399 | |
---|
1400 | |
---|
1401 | typedef struct __darwin_x86_debug_state64 x86_debug_state64_t; |
---|
1402 | # 220 "/usr/include/mach/i386/thread_status.h" 3 4 |
---|
1403 | struct 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 | |
---|
1411 | struct 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 | |
---|
1419 | struct 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 | |
---|
1427 | struct 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 | |
---|
1435 | typedef struct x86_thread_state x86_thread_state_t; |
---|
1436 | |
---|
1437 | |
---|
1438 | |
---|
1439 | typedef struct x86_float_state x86_float_state_t; |
---|
1440 | |
---|
1441 | |
---|
1442 | |
---|
1443 | typedef struct x86_exception_state x86_exception_state_t; |
---|
1444 | |
---|
1445 | |
---|
1446 | |
---|
1447 | typedef struct x86_debug_state x86_debug_state_t; |
---|
1448 | # 288 "/usr/include/mach/i386/thread_status.h" 3 4 |
---|
1449 | struct 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 |
---|
1466 | static inline |
---|
1467 | __uint16_t |
---|
1468 | _OSSwapInt16( |
---|
1469 | __uint16_t _data |
---|
1470 | ) |
---|
1471 | { |
---|
1472 | return ((_data << 8) | (_data >> 8)); |
---|
1473 | } |
---|
1474 | |
---|
1475 | static 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 | |
---|
1490 | static 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 |
---|
1503 | static inline |
---|
1504 | uint16_t |
---|
1505 | OSReadSwapInt16( |
---|
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 | |
---|
1516 | static inline |
---|
1517 | uint32_t |
---|
1518 | OSReadSwapInt32( |
---|
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 | |
---|
1529 | static inline |
---|
1530 | uint64_t |
---|
1531 | OSReadSwapInt64( |
---|
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 | |
---|
1544 | static inline |
---|
1545 | void |
---|
1546 | OSWriteSwapInt16( |
---|
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 | |
---|
1555 | static inline |
---|
1556 | void |
---|
1557 | OSWriteSwapInt32( |
---|
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 | |
---|
1566 | static inline |
---|
1567 | void |
---|
1568 | OSWriteSwapInt64( |
---|
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 |
---|
1578 | enum { |
---|
1579 | OSUnknownByteOrder, |
---|
1580 | OSLittleEndian, |
---|
1581 | OSBigEndian |
---|
1582 | }; |
---|
1583 | |
---|
1584 | static inline |
---|
1585 | int32_t |
---|
1586 | OSHostByteOrder(void) { |
---|
1587 | |
---|
1588 | return OSLittleEndian; |
---|
1589 | |
---|
1590 | |
---|
1591 | |
---|
1592 | |
---|
1593 | |
---|
1594 | } |
---|
1595 | # 91 "/usr/include/libkern/OSByteOrder.h" 3 4 |
---|
1596 | static inline |
---|
1597 | uint16_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 | |
---|
1606 | static inline |
---|
1607 | uint32_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 | |
---|
1616 | static inline |
---|
1617 | uint64_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 | |
---|
1628 | static inline |
---|
1629 | void |
---|
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 | |
---|
1639 | static inline |
---|
1640 | void |
---|
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 | |
---|
1650 | static inline |
---|
1651 | void |
---|
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 | |
---|
1662 | typedef unsigned long NXSwappedFloat; |
---|
1663 | typedef unsigned long long NXSwappedDouble; |
---|
1664 | |
---|
1665 | static __inline__ __attribute__((deprecated)) |
---|
1666 | unsigned short |
---|
1667 | NXSwapShort( |
---|
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 | |
---|
1674 | static __inline__ __attribute__((deprecated)) |
---|
1675 | unsigned int |
---|
1676 | NXSwapInt( |
---|
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 | |
---|
1683 | static __inline__ __attribute__((deprecated)) |
---|
1684 | unsigned long |
---|
1685 | NXSwapLong( |
---|
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 | |
---|
1692 | static __inline__ __attribute__((deprecated)) |
---|
1693 | unsigned long long |
---|
1694 | NXSwapLongLong( |
---|
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 | |
---|
1701 | static __inline__ __attribute__((deprecated)) |
---|
1702 | NXSwappedFloat |
---|
1703 | NXConvertHostFloatToSwapped(float x) |
---|
1704 | { |
---|
1705 | union fconv { |
---|
1706 | float number; |
---|
1707 | NXSwappedFloat sf; |
---|
1708 | } u; |
---|
1709 | u.number = x; |
---|
1710 | return u.sf; |
---|
1711 | } |
---|
1712 | |
---|
1713 | static __inline__ __attribute__((deprecated)) |
---|
1714 | float |
---|
1715 | NXConvertSwappedFloatToHost(NXSwappedFloat x) |
---|
1716 | { |
---|
1717 | union fconv { |
---|
1718 | float number; |
---|
1719 | NXSwappedFloat sf; |
---|
1720 | } u; |
---|
1721 | u.sf = x; |
---|
1722 | return u.number; |
---|
1723 | } |
---|
1724 | |
---|
1725 | static __inline__ __attribute__((deprecated)) |
---|
1726 | NXSwappedDouble |
---|
1727 | NXConvertHostDoubleToSwapped(double x) |
---|
1728 | { |
---|
1729 | union dconv { |
---|
1730 | double number; |
---|
1731 | NXSwappedDouble sd; |
---|
1732 | } u; |
---|
1733 | u.number = x; |
---|
1734 | return u.sd; |
---|
1735 | } |
---|
1736 | |
---|
1737 | static __inline__ __attribute__((deprecated)) |
---|
1738 | double |
---|
1739 | NXConvertSwappedDoubleToHost(NXSwappedDouble x) |
---|
1740 | { |
---|
1741 | union dconv { |
---|
1742 | double number; |
---|
1743 | NXSwappedDouble sd; |
---|
1744 | } u; |
---|
1745 | u.sd = x; |
---|
1746 | return u.number; |
---|
1747 | } |
---|
1748 | |
---|
1749 | static __inline__ __attribute__((deprecated)) |
---|
1750 | NXSwappedFloat |
---|
1751 | NXSwapFloat(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 | |
---|
1756 | static __inline__ __attribute__((deprecated)) |
---|
1757 | NXSwappedDouble |
---|
1758 | NXSwapDouble(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 | |
---|
1768 | enum NXByteOrder { |
---|
1769 | NX_UnknownByteOrder, |
---|
1770 | NX_LittleEndian, |
---|
1771 | NX_BigEndian |
---|
1772 | }; |
---|
1773 | |
---|
1774 | static __inline__ |
---|
1775 | enum NXByteOrder |
---|
1776 | NXHostByteOrder(void) |
---|
1777 | { |
---|
1778 | |
---|
1779 | return NX_LittleEndian; |
---|
1780 | |
---|
1781 | |
---|
1782 | |
---|
1783 | |
---|
1784 | |
---|
1785 | } |
---|
1786 | |
---|
1787 | static __inline__ __attribute__((deprecated)) |
---|
1788 | unsigned short |
---|
1789 | NXSwapBigShortToHost( |
---|
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 | |
---|
1796 | static __inline__ __attribute__((deprecated)) |
---|
1797 | unsigned int |
---|
1798 | NXSwapBigIntToHost( |
---|
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 | |
---|
1805 | static __inline__ __attribute__((deprecated)) |
---|
1806 | unsigned long |
---|
1807 | NXSwapBigLongToHost( |
---|
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 | |
---|
1814 | static __inline__ __attribute__((deprecated)) |
---|
1815 | unsigned long long |
---|
1816 | NXSwapBigLongLongToHost( |
---|
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 | |
---|
1823 | static __inline__ __attribute__((deprecated)) |
---|
1824 | double |
---|
1825 | NXSwapBigDoubleToHost( |
---|
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 | |
---|
1832 | static __inline__ __attribute__((deprecated)) |
---|
1833 | float |
---|
1834 | NXSwapBigFloatToHost( |
---|
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 | |
---|
1841 | static __inline__ __attribute__((deprecated)) |
---|
1842 | unsigned short |
---|
1843 | NXSwapHostShortToBig( |
---|
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 | |
---|
1850 | static __inline__ __attribute__((deprecated)) |
---|
1851 | unsigned int |
---|
1852 | NXSwapHostIntToBig( |
---|
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 | |
---|
1859 | static __inline__ __attribute__((deprecated)) |
---|
1860 | unsigned long |
---|
1861 | NXSwapHostLongToBig( |
---|
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 | |
---|
1868 | static __inline__ __attribute__((deprecated)) |
---|
1869 | unsigned long long |
---|
1870 | NXSwapHostLongLongToBig( |
---|
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 | |
---|
1877 | static __inline__ __attribute__((deprecated)) |
---|
1878 | NXSwappedDouble |
---|
1879 | NXSwapHostDoubleToBig( |
---|
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 | |
---|
1886 | static __inline__ __attribute__((deprecated)) |
---|
1887 | NXSwappedFloat |
---|
1888 | NXSwapHostFloatToBig( |
---|
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 | |
---|
1895 | static __inline__ __attribute__((deprecated)) |
---|
1896 | unsigned short |
---|
1897 | NXSwapLittleShortToHost( |
---|
1898 | unsigned short x |
---|
1899 | ) |
---|
1900 | { |
---|
1901 | return (unsigned short)((uint16_t)((uint16_t)x)); |
---|
1902 | } |
---|
1903 | |
---|
1904 | static __inline__ __attribute__((deprecated)) |
---|
1905 | unsigned int |
---|
1906 | NXSwapLittleIntToHost( |
---|
1907 | unsigned int x |
---|
1908 | ) |
---|
1909 | { |
---|
1910 | return (unsigned int)((uint32_t)((uint32_t)x)); |
---|
1911 | } |
---|
1912 | |
---|
1913 | static __inline__ __attribute__((deprecated)) |
---|
1914 | unsigned long |
---|
1915 | NXSwapLittleLongToHost( |
---|
1916 | unsigned long x |
---|
1917 | ) |
---|
1918 | { |
---|
1919 | return (unsigned long)((uint32_t)((uint32_t)x)); |
---|
1920 | } |
---|
1921 | |
---|
1922 | static __inline__ __attribute__((deprecated)) |
---|
1923 | unsigned long long |
---|
1924 | NXSwapLittleLongLongToHost( |
---|
1925 | unsigned long long x |
---|
1926 | ) |
---|
1927 | { |
---|
1928 | return (unsigned long long)((uint64_t)((uint64_t)x)); |
---|
1929 | } |
---|
1930 | |
---|
1931 | static __inline__ __attribute__((deprecated)) |
---|
1932 | double |
---|
1933 | NXSwapLittleDoubleToHost( |
---|
1934 | NXSwappedDouble x |
---|
1935 | ) |
---|
1936 | { |
---|
1937 | return NXConvertSwappedDoubleToHost((NXSwappedDouble)((uint64_t)((uint64_t)x))); |
---|
1938 | } |
---|
1939 | |
---|
1940 | static __inline__ __attribute__((deprecated)) |
---|
1941 | float |
---|
1942 | NXSwapLittleFloatToHost( |
---|
1943 | NXSwappedFloat x |
---|
1944 | ) |
---|
1945 | { |
---|
1946 | return NXConvertSwappedFloatToHost((NXSwappedFloat)((uint32_t)((uint32_t)x))); |
---|
1947 | } |
---|
1948 | |
---|
1949 | static __inline__ __attribute__((deprecated)) |
---|
1950 | unsigned short |
---|
1951 | NXSwapHostShortToLittle( |
---|
1952 | unsigned short x |
---|
1953 | ) |
---|
1954 | { |
---|
1955 | return (unsigned short)((uint16_t)((uint16_t)x)); |
---|
1956 | } |
---|
1957 | |
---|
1958 | static __inline__ __attribute__((deprecated)) |
---|
1959 | unsigned int |
---|
1960 | NXSwapHostIntToLittle( |
---|
1961 | unsigned int x |
---|
1962 | ) |
---|
1963 | { |
---|
1964 | return (unsigned int)((uint32_t)((uint32_t)x)); |
---|
1965 | } |
---|
1966 | |
---|
1967 | static __inline__ __attribute__((deprecated)) |
---|
1968 | unsigned long |
---|
1969 | NXSwapHostLongToLittle( |
---|
1970 | unsigned long x |
---|
1971 | ) |
---|
1972 | { |
---|
1973 | return (unsigned long)((uint32_t)((uint32_t)x)); |
---|
1974 | } |
---|
1975 | |
---|
1976 | static __inline__ __attribute__((deprecated)) |
---|
1977 | unsigned long long |
---|
1978 | NXSwapHostLongLongToLittle( |
---|
1979 | unsigned long long x |
---|
1980 | ) |
---|
1981 | { |
---|
1982 | return (unsigned long long)((uint64_t)((uint64_t)x)); |
---|
1983 | } |
---|
1984 | |
---|
1985 | static __inline__ __attribute__((deprecated)) |
---|
1986 | NXSwappedDouble |
---|
1987 | NXSwapHostDoubleToLittle( |
---|
1988 | double x |
---|
1989 | ) |
---|
1990 | { |
---|
1991 | return (NXSwappedDouble)((uint64_t)((uint64_t)NXConvertHostDoubleToSwapped(x))); |
---|
1992 | } |
---|
1993 | |
---|
1994 | static __inline__ __attribute__((deprecated)) |
---|
1995 | NXSwappedFloat |
---|
1996 | NXSwapHostFloatToLittle( |
---|
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 | |
---|
2008 | struct 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" |
---|
2018 | struct 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" |
---|
2029 | struct load_command { |
---|
2030 | uint32_t cmd; |
---|
2031 | uint32_t cmdsize; |
---|
2032 | }; |
---|
2033 | # 307 "./../include/mach-o/loader.h" |
---|
2034 | union lc_str { |
---|
2035 | uint32_t offset; |
---|
2036 | |
---|
2037 | |
---|
2038 | |
---|
2039 | }; |
---|
2040 | # 326 "./../include/mach-o/loader.h" |
---|
2041 | struct 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 | |
---|
2061 | struct 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" |
---|
2075 | struct 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 | |
---|
2089 | struct 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" |
---|
2104 | struct fvmlib { |
---|
2105 | union lc_str name; |
---|
2106 | uint32_t minor_version; |
---|
2107 | uint32_t header_addr; |
---|
2108 | }; |
---|
2109 | # 618 "./../include/mach-o/loader.h" |
---|
2110 | struct fvmlib_command { |
---|
2111 | uint32_t cmd; |
---|
2112 | uint32_t cmdsize; |
---|
2113 | struct fvmlib fvmlib; |
---|
2114 | }; |
---|
2115 | # 633 "./../include/mach-o/loader.h" |
---|
2116 | struct 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" |
---|
2123 | struct dylib_command { |
---|
2124 | uint32_t cmd; |
---|
2125 | |
---|
2126 | uint32_t cmdsize; |
---|
2127 | struct dylib dylib; |
---|
2128 | }; |
---|
2129 | # 664 "./../include/mach-o/loader.h" |
---|
2130 | struct sub_framework_command { |
---|
2131 | uint32_t cmd; |
---|
2132 | uint32_t cmdsize; |
---|
2133 | union lc_str umbrella; |
---|
2134 | }; |
---|
2135 | # 679 "./../include/mach-o/loader.h" |
---|
2136 | struct sub_client_command { |
---|
2137 | uint32_t cmd; |
---|
2138 | uint32_t cmdsize; |
---|
2139 | union lc_str client; |
---|
2140 | }; |
---|
2141 | # 698 "./../include/mach-o/loader.h" |
---|
2142 | struct 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" |
---|
2148 | struct 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" |
---|
2154 | struct 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" |
---|
2162 | struct dylinker_command { |
---|
2163 | uint32_t cmd; |
---|
2164 | |
---|
2165 | uint32_t cmdsize; |
---|
2166 | union lc_str name; |
---|
2167 | }; |
---|
2168 | # 778 "./../include/mach-o/loader.h" |
---|
2169 | struct thread_command { |
---|
2170 | uint32_t cmd; |
---|
2171 | uint32_t cmdsize; |
---|
2172 | |
---|
2173 | |
---|
2174 | |
---|
2175 | |
---|
2176 | }; |
---|
2177 | # 795 "./../include/mach-o/loader.h" |
---|
2178 | struct 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 | |
---|
2195 | struct 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 | |
---|
2214 | struct 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" |
---|
2223 | struct 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" |
---|
2261 | struct dylib_table_of_contents { |
---|
2262 | uint32_t symbol_index; |
---|
2263 | |
---|
2264 | uint32_t module_index; |
---|
2265 | |
---|
2266 | }; |
---|
2267 | |
---|
2268 | |
---|
2269 | struct 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 | |
---|
2296 | struct 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" |
---|
2322 | struct dylib_reference { |
---|
2323 | uint32_t isym:24, |
---|
2324 | flags:8; |
---|
2325 | }; |
---|
2326 | |
---|
2327 | |
---|
2328 | |
---|
2329 | |
---|
2330 | |
---|
2331 | struct 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" |
---|
2338 | struct twolevel_hint { |
---|
2339 | uint32_t |
---|
2340 | isub_image:8, |
---|
2341 | itoc:24; |
---|
2342 | }; |
---|
2343 | # 1125 "./../include/mach-o/loader.h" |
---|
2344 | struct prebind_cksum_command { |
---|
2345 | uint32_t cmd; |
---|
2346 | uint32_t cmdsize; |
---|
2347 | uint32_t cksum; |
---|
2348 | }; |
---|
2349 | |
---|
2350 | |
---|
2351 | |
---|
2352 | |
---|
2353 | |
---|
2354 | struct uuid_command { |
---|
2355 | uint32_t cmd; |
---|
2356 | uint32_t cmdsize; |
---|
2357 | uint8_t uuid[16]; |
---|
2358 | }; |
---|
2359 | |
---|
2360 | |
---|
2361 | |
---|
2362 | |
---|
2363 | |
---|
2364 | struct rpath_command { |
---|
2365 | uint32_t cmd; |
---|
2366 | uint32_t cmdsize; |
---|
2367 | union lc_str path; |
---|
2368 | }; |
---|
2369 | |
---|
2370 | |
---|
2371 | |
---|
2372 | |
---|
2373 | |
---|
2374 | struct 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 | |
---|
2387 | struct 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 | |
---|
2400 | struct 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" |
---|
2408 | struct 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" |
---|
2428 | struct 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 | |
---|
2441 | struct ident_command { |
---|
2442 | uint32_t cmd; |
---|
2443 | uint32_t cmdsize; |
---|
2444 | }; |
---|
2445 | |
---|
2446 | |
---|
2447 | |
---|
2448 | |
---|
2449 | |
---|
2450 | |
---|
2451 | |
---|
2452 | struct 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" |
---|
2459 | struct 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 | |
---|
2471 | struct source_version_command { |
---|
2472 | uint32_t cmd; |
---|
2473 | uint32_t cmdsize; |
---|
2474 | uint64_t version; |
---|
2475 | }; |
---|
2476 | # 1434 "./../include/mach-o/loader.h" |
---|
2477 | struct data_in_code_entry { |
---|
2478 | uint32_t offset; |
---|
2479 | uint16_t length; |
---|
2480 | uint16_t kind; |
---|
2481 | }; |
---|
2482 | # 1451 "./../include/mach-o/loader.h" |
---|
2483 | struct 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 |
---|
2495 | typedef __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 |
---|
2503 | typedef __darwin_ct_rune_t ct_rune_t; |
---|
2504 | |
---|
2505 | |
---|
2506 | |
---|
2507 | |
---|
2508 | typedef __darwin_rune_t rune_t; |
---|
2509 | |
---|
2510 | |
---|
2511 | |
---|
2512 | |
---|
2513 | |
---|
2514 | typedef __darwin_wchar_t wchar_t; |
---|
2515 | |
---|
2516 | |
---|
2517 | |
---|
2518 | |
---|
2519 | |
---|
2520 | typedef __darwin_wint_t wint_t; |
---|
2521 | # 81 "/usr/include/runetype.h" 3 4 |
---|
2522 | typedef struct { |
---|
2523 | __darwin_rune_t __min; |
---|
2524 | __darwin_rune_t __max; |
---|
2525 | __darwin_rune_t __map; |
---|
2526 | __uint32_t *__types; |
---|
2527 | } _RuneEntry; |
---|
2528 | |
---|
2529 | typedef struct { |
---|
2530 | int __nranges; |
---|
2531 | _RuneEntry *__ranges; |
---|
2532 | } _RuneRange; |
---|
2533 | |
---|
2534 | typedef struct { |
---|
2535 | char __name[14]; |
---|
2536 | __uint32_t __mask; |
---|
2537 | } _RuneCharClass; |
---|
2538 | |
---|
2539 | typedef 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 | |
---|
2573 | extern _RuneLocale _DefaultRuneLocale; |
---|
2574 | extern _RuneLocale *_CurrentRuneLocale; |
---|
2575 | # 70 "/usr/include/ctype.h" 2 3 4 |
---|
2576 | # 146 "/usr/include/ctype.h" 3 4 |
---|
2577 | unsigned 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 | |
---|
2582 | static __inline int |
---|
2583 | isascii(int _c) |
---|
2584 | { |
---|
2585 | return ((_c & ~0x7F) == 0); |
---|
2586 | } |
---|
2587 | # 165 "/usr/include/ctype.h" 3 4 |
---|
2588 | int __maskrune(__darwin_ct_rune_t, unsigned long); |
---|
2589 | |
---|
2590 | |
---|
2591 | |
---|
2592 | static __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 | |
---|
2603 | static __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 | |
---|
2619 | static __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 | |
---|
2637 | static __inline int |
---|
2638 | isalnum(int _c) |
---|
2639 | { |
---|
2640 | return (__istype(_c, 0x00000100L|0x00000400L)); |
---|
2641 | } |
---|
2642 | |
---|
2643 | static __inline int |
---|
2644 | isalpha(int _c) |
---|
2645 | { |
---|
2646 | return (__istype(_c, 0x00000100L)); |
---|
2647 | } |
---|
2648 | |
---|
2649 | static __inline int |
---|
2650 | isblank(int _c) |
---|
2651 | { |
---|
2652 | return (__istype(_c, 0x00020000L)); |
---|
2653 | } |
---|
2654 | |
---|
2655 | static __inline int |
---|
2656 | iscntrl(int _c) |
---|
2657 | { |
---|
2658 | return (__istype(_c, 0x00000200L)); |
---|
2659 | } |
---|
2660 | |
---|
2661 | |
---|
2662 | static __inline int |
---|
2663 | isdigit(int _c) |
---|
2664 | { |
---|
2665 | return (__isctype(_c, 0x00000400L)); |
---|
2666 | } |
---|
2667 | |
---|
2668 | static __inline int |
---|
2669 | isgraph(int _c) |
---|
2670 | { |
---|
2671 | return (__istype(_c, 0x00000800L)); |
---|
2672 | } |
---|
2673 | |
---|
2674 | static __inline int |
---|
2675 | islower(int _c) |
---|
2676 | { |
---|
2677 | return (__istype(_c, 0x00001000L)); |
---|
2678 | } |
---|
2679 | |
---|
2680 | static __inline int |
---|
2681 | isprint(int _c) |
---|
2682 | { |
---|
2683 | return (__istype(_c, 0x00040000L)); |
---|
2684 | } |
---|
2685 | |
---|
2686 | static __inline int |
---|
2687 | ispunct(int _c) |
---|
2688 | { |
---|
2689 | return (__istype(_c, 0x00002000L)); |
---|
2690 | } |
---|
2691 | |
---|
2692 | static __inline int |
---|
2693 | isspace(int _c) |
---|
2694 | { |
---|
2695 | return (__istype(_c, 0x00004000L)); |
---|
2696 | } |
---|
2697 | |
---|
2698 | static __inline int |
---|
2699 | isupper(int _c) |
---|
2700 | { |
---|
2701 | return (__istype(_c, 0x00008000L)); |
---|
2702 | } |
---|
2703 | |
---|
2704 | |
---|
2705 | static __inline int |
---|
2706 | isxdigit(int _c) |
---|
2707 | { |
---|
2708 | return (__isctype(_c, 0x00010000L)); |
---|
2709 | } |
---|
2710 | |
---|
2711 | static __inline int |
---|
2712 | toascii(int _c) |
---|
2713 | { |
---|
2714 | return (_c & 0x7F); |
---|
2715 | } |
---|
2716 | |
---|
2717 | static __inline int |
---|
2718 | tolower(int _c) |
---|
2719 | { |
---|
2720 | return (__tolower(_c)); |
---|
2721 | } |
---|
2722 | |
---|
2723 | static __inline int |
---|
2724 | toupper(int _c) |
---|
2725 | { |
---|
2726 | return (__toupper(_c)); |
---|
2727 | } |
---|
2728 | |
---|
2729 | |
---|
2730 | static __inline int |
---|
2731 | digittoint(int _c) |
---|
2732 | { |
---|
2733 | return (__maskrune(_c, 0x0F)); |
---|
2734 | } |
---|
2735 | |
---|
2736 | static __inline int |
---|
2737 | ishexnumber(int _c) |
---|
2738 | { |
---|
2739 | return (__istype(_c, 0x00010000L)); |
---|
2740 | } |
---|
2741 | |
---|
2742 | static __inline int |
---|
2743 | isideogram(int _c) |
---|
2744 | { |
---|
2745 | return (__istype(_c, 0x00080000L)); |
---|
2746 | } |
---|
2747 | |
---|
2748 | static __inline int |
---|
2749 | isnumber(int _c) |
---|
2750 | { |
---|
2751 | return (__istype(_c, 0x00000400L)); |
---|
2752 | } |
---|
2753 | |
---|
2754 | static __inline int |
---|
2755 | isphonogram(int _c) |
---|
2756 | { |
---|
2757 | return (__istype(_c, 0x00200000L)); |
---|
2758 | } |
---|
2759 | |
---|
2760 | static __inline int |
---|
2761 | isrune(int _c) |
---|
2762 | { |
---|
2763 | return (__istype(_c, 0xFFFFFFF0L)); |
---|
2764 | } |
---|
2765 | |
---|
2766 | static __inline int |
---|
2767 | isspecial(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 |
---|
2775 | typedef __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 |
---|
2782 | typedef unsigned char BOOL; |
---|
2783 | # 51 "/opt/local/include/objc/objc.h" 3 4 |
---|
2784 | typedef const struct objc_selector |
---|
2785 | { |
---|
2786 | void *sel_id; |
---|
2787 | const char *sel_types; |
---|
2788 | } *SEL; |
---|
2789 | |
---|
2790 | inline static BOOL |
---|
2791 | sel_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 | |
---|
2803 | typedef struct objc_object { |
---|
2804 | struct objc_class* class_pointer; |
---|
2805 | } *id; |
---|
2806 | |
---|
2807 | |
---|
2808 | |
---|
2809 | |
---|
2810 | |
---|
2811 | typedef id (*IMP)(id, SEL, ...); |
---|
2812 | |
---|
2813 | |
---|
2814 | |
---|
2815 | |
---|
2816 | |
---|
2817 | |
---|
2818 | typedef char *STR; |
---|
2819 | # 97 "/opt/local/include/objc/objc.h" 3 4 |
---|
2820 | typedef struct objc_class *MetaClass; |
---|
2821 | typedef struct objc_class *Class; |
---|
2822 | struct 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 | |
---|
2856 | typedef 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 | |
---|
2867 | typedef void* retval_t; |
---|
2868 | typedef void(*apply_t)(void); |
---|
2869 | typedef union { |
---|
2870 | char *arg_ptr; |
---|
2871 | char arg_regs[sizeof (char*)]; |
---|
2872 | } *arglist_t; |
---|
2873 | |
---|
2874 | |
---|
2875 | IMP 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 |
---|
2884 | typedef 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 |
---|
2895 | typedef unsigned int (*hash_func_type)(void *, const void *); |
---|
2896 | # 73 "/opt/local/include/objc/hash.h" 3 4 |
---|
2897 | typedef int (*compare_func_type)(const void *, const void *); |
---|
2898 | # 82 "/opt/local/include/objc/hash.h" 3 4 |
---|
2899 | typedef 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 | |
---|
2922 | typedef cache_t *cache_ptr; |
---|
2923 | |
---|
2924 | |
---|
2925 | |
---|
2926 | extern cache_ptr module_hash_table, class_hash_table; |
---|
2927 | |
---|
2928 | |
---|
2929 | |
---|
2930 | cache_ptr hash_new (unsigned int size, |
---|
2931 | hash_func_type hash_func, |
---|
2932 | compare_func_type compare_func); |
---|
2933 | |
---|
2934 | |
---|
2935 | |
---|
2936 | void hash_delete (cache_ptr cache); |
---|
2937 | |
---|
2938 | |
---|
2939 | |
---|
2940 | |
---|
2941 | |
---|
2942 | |
---|
2943 | void hash_add (cache_ptr *cachep, const void *key, void *value); |
---|
2944 | |
---|
2945 | |
---|
2946 | |
---|
2947 | |
---|
2948 | void hash_remove (cache_ptr cache, const void *key); |
---|
2949 | # 142 "/opt/local/include/objc/hash.h" 3 4 |
---|
2950 | node_ptr hash_next (cache_ptr cache, node_ptr node); |
---|
2951 | |
---|
2952 | |
---|
2953 | |
---|
2954 | void *hash_value_for_key (cache_ptr cache, const void *key); |
---|
2955 | |
---|
2956 | |
---|
2957 | |
---|
2958 | BOOL hash_is_key_in_hash (cache_ptr cache, const void *key); |
---|
2959 | # 164 "/opt/local/include/objc/hash.h" 3 4 |
---|
2960 | static inline unsigned int |
---|
2961 | hash_ptr (cache_ptr cache, const void *key) |
---|
2962 | { |
---|
2963 | return ((size_t)key / sizeof (void *)) & cache->mask; |
---|
2964 | } |
---|
2965 | |
---|
2966 | |
---|
2967 | |
---|
2968 | |
---|
2969 | |
---|
2970 | static inline unsigned int |
---|
2971 | hash_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 | |
---|
2987 | static inline int |
---|
2988 | compare_ptrs (const void *k1, const void *k2) |
---|
2989 | { |
---|
2990 | return !(k1 - k2); |
---|
2991 | } |
---|
2992 | |
---|
2993 | |
---|
2994 | |
---|
2995 | static inline int |
---|
2996 | compare_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 |
---|
3008 | extern int __objc_thread_exit_status; |
---|
3009 | # 59 "/opt/local/include/objc/thr.h" 3 4 |
---|
3010 | typedef void * objc_thread_t; |
---|
3011 | |
---|
3012 | |
---|
3013 | struct objc_mutex |
---|
3014 | { |
---|
3015 | volatile objc_thread_t owner; |
---|
3016 | volatile int depth; |
---|
3017 | void * backend; |
---|
3018 | }; |
---|
3019 | typedef struct objc_mutex *objc_mutex_t; |
---|
3020 | |
---|
3021 | |
---|
3022 | struct objc_condition |
---|
3023 | { |
---|
3024 | void * backend; |
---|
3025 | }; |
---|
3026 | typedef struct objc_condition *objc_condition_t; |
---|
3027 | |
---|
3028 | |
---|
3029 | objc_mutex_t objc_mutex_allocate(void); |
---|
3030 | int objc_mutex_deallocate(objc_mutex_t mutex); |
---|
3031 | int objc_mutex_lock(objc_mutex_t mutex); |
---|
3032 | int objc_mutex_unlock(objc_mutex_t mutex); |
---|
3033 | int objc_mutex_trylock(objc_mutex_t mutex); |
---|
3034 | |
---|
3035 | |
---|
3036 | objc_condition_t objc_condition_allocate(void); |
---|
3037 | int objc_condition_deallocate(objc_condition_t condition); |
---|
3038 | int objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex); |
---|
3039 | int objc_condition_signal(objc_condition_t condition); |
---|
3040 | int objc_condition_broadcast(objc_condition_t condition); |
---|
3041 | |
---|
3042 | |
---|
3043 | objc_thread_t objc_thread_detach(SEL selector, id object, id argument); |
---|
3044 | void objc_thread_yield(void); |
---|
3045 | int objc_thread_exit(void); |
---|
3046 | int objc_thread_set_priority(int priority); |
---|
3047 | int objc_thread_get_priority(void); |
---|
3048 | void * objc_thread_get_data(void); |
---|
3049 | int objc_thread_set_data(void *value); |
---|
3050 | objc_thread_t objc_thread_id(void); |
---|
3051 | # 113 "/opt/local/include/objc/thr.h" 3 4 |
---|
3052 | typedef void (*objc_thread_callback)(); |
---|
3053 | objc_thread_callback objc_set_thread_callback(objc_thread_callback func); |
---|
3054 | |
---|
3055 | |
---|
3056 | int __objc_init_thread_system(void); |
---|
3057 | int __objc_fini_thread_system(void); |
---|
3058 | |
---|
3059 | |
---|
3060 | int __objc_mutex_allocate(objc_mutex_t mutex); |
---|
3061 | int __objc_mutex_deallocate(objc_mutex_t mutex); |
---|
3062 | int __objc_mutex_lock(objc_mutex_t mutex); |
---|
3063 | int __objc_mutex_trylock(objc_mutex_t mutex); |
---|
3064 | int __objc_mutex_unlock(objc_mutex_t mutex); |
---|
3065 | |
---|
3066 | |
---|
3067 | int __objc_condition_allocate(objc_condition_t condition); |
---|
3068 | int __objc_condition_deallocate(objc_condition_t condition); |
---|
3069 | int __objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex); |
---|
3070 | int __objc_condition_broadcast(objc_condition_t condition); |
---|
3071 | int __objc_condition_signal(objc_condition_t condition); |
---|
3072 | |
---|
3073 | |
---|
3074 | objc_thread_t __objc_thread_detach(void (*func)(void *arg), void *arg); |
---|
3075 | int __objc_thread_set_priority(int priority); |
---|
3076 | int __objc_thread_get_priority(void); |
---|
3077 | void __objc_thread_yield(void); |
---|
3078 | int __objc_thread_exit(void); |
---|
3079 | objc_thread_t __objc_thread_id(void); |
---|
3080 | int __objc_thread_set_data(void *value); |
---|
3081 | void * __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 |
---|
3084 | struct objc_method_description |
---|
3085 | { |
---|
3086 | SEL name; |
---|
3087 | char *types; |
---|
3088 | }; |
---|
3089 | # 106 "/opt/local/include/objc/objc-api.h" 3 4 |
---|
3090 | extern void objc_error (id object, int code, const char* fmt, ...); |
---|
3091 | extern void objc_verror (id object, int code, const char* fmt, va_list ap); |
---|
3092 | typedef BOOL (*objc_error_handler) (id, int code, const char *fmt, va_list ap); |
---|
3093 | objc_error_handler objc_set_error_handler (objc_error_handler func); |
---|
3094 | # 147 "/opt/local/include/objc/objc-api.h" 3 4 |
---|
3095 | struct objc_static_instances |
---|
3096 | { |
---|
3097 | char *class_name; |
---|
3098 | id instances[0]; |
---|
3099 | }; |
---|
3100 | # 162 "/opt/local/include/objc/objc-api.h" 3 4 |
---|
3101 | typedef 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 |
---|
3118 | typedef 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 | |
---|
3138 | typedef struct objc_ivar* Ivar_t; |
---|
3139 | typedef 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 |
---|
3160 | struct 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 | |
---|
3174 | typedef struct objc_method Method; |
---|
3175 | |
---|
3176 | typedef Method* Method_t; |
---|
3177 | typedef 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 | |
---|
3187 | struct 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 |
---|
3193 | typedef 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 | |
---|
3216 | typedef struct objc_super { |
---|
3217 | id self; |
---|
3218 | |
---|
3219 | Class class_type; |
---|
3220 | } Super, *Super_t; |
---|
3221 | |
---|
3222 | IMP objc_msg_lookup_super(Super_t super, SEL sel); |
---|
3223 | |
---|
3224 | retval_t objc_msg_sendv(id, SEL, arglist_t); |
---|
3225 | # 364 "/opt/local/include/objc/objc-api.h" 3 4 |
---|
3226 | extern Class (*_objc_lookup_class) (const char *name); |
---|
3227 | |
---|
3228 | |
---|
3229 | |
---|
3230 | |
---|
3231 | |
---|
3232 | |
---|
3233 | |
---|
3234 | extern void (*_objc_load_callback) (Class class_type, Category* category); |
---|
3235 | |
---|
3236 | |
---|
3237 | |
---|
3238 | |
---|
3239 | extern id (*_objc_object_alloc) (Class class_type); |
---|
3240 | extern id (*_objc_object_copy) (id object); |
---|
3241 | extern id (*_objc_object_dispose) (id object); |
---|
3242 | |
---|
3243 | |
---|
3244 | |
---|
3245 | |
---|
3246 | |
---|
3247 | |
---|
3248 | |
---|
3249 | void *objc_malloc (size_t size); |
---|
3250 | |
---|
3251 | void *objc_atomic_malloc (size_t size); |
---|
3252 | |
---|
3253 | void *objc_valloc (size_t size); |
---|
3254 | |
---|
3255 | void *objc_realloc (void *mem, size_t size); |
---|
3256 | |
---|
3257 | void *objc_calloc (size_t nelem, size_t size); |
---|
3258 | |
---|
3259 | void objc_free (void *mem); |
---|
3260 | # 409 "/opt/local/include/objc/objc-api.h" 3 4 |
---|
3261 | extern void *(*_objc_malloc) (size_t); |
---|
3262 | extern void *(*_objc_atomic_malloc) (size_t); |
---|
3263 | extern void *(*_objc_valloc) (size_t); |
---|
3264 | extern void *(*_objc_realloc) (void *, size_t); |
---|
3265 | extern void *(*_objc_calloc) (size_t, size_t); |
---|
3266 | extern void (*_objc_free) (void *); |
---|
3267 | |
---|
3268 | Method_t class_get_class_method (MetaClass class_type, SEL aSel); |
---|
3269 | |
---|
3270 | Method_t class_get_instance_method (Class class_type, SEL aSel); |
---|
3271 | |
---|
3272 | Class class_pose_as (Class impostor, Class superclass); |
---|
3273 | |
---|
3274 | Class objc_get_class (const char *name); |
---|
3275 | |
---|
3276 | Class objc_lookup_class (const char *name); |
---|
3277 | |
---|
3278 | Class objc_next_class (void **enum_state); |
---|
3279 | |
---|
3280 | const char *sel_get_name (SEL selector); |
---|
3281 | |
---|
3282 | const char *sel_get_type (SEL selector); |
---|
3283 | |
---|
3284 | SEL sel_get_uid (const char *name); |
---|
3285 | |
---|
3286 | SEL sel_get_any_uid (const char *name); |
---|
3287 | |
---|
3288 | SEL sel_get_any_typed_uid (const char *name); |
---|
3289 | |
---|
3290 | SEL sel_get_typed_uid (const char *name, const char*); |
---|
3291 | |
---|
3292 | SEL sel_register_name (const char *name); |
---|
3293 | |
---|
3294 | SEL sel_register_typed_name (const char *name, const char*type); |
---|
3295 | |
---|
3296 | |
---|
3297 | BOOL sel_is_mapped (SEL aSel); |
---|
3298 | |
---|
3299 | extern id class_create_instance (Class class_type); |
---|
3300 | |
---|
3301 | static inline const char * |
---|
3302 | class_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 | |
---|
3307 | static inline long |
---|
3308 | class_get_instance_size (Class class_type) |
---|
3309 | { |
---|
3310 | return ((class_type)&&((((class_type)->info) & 0x1L) == 0x1L)) ? class_type->instance_size : 0; |
---|
3311 | } |
---|
3312 | |
---|
3313 | static inline MetaClass |
---|
3314 | class_get_meta_class (Class class_type) |
---|
3315 | { |
---|
3316 | return ((class_type)&&((((class_type)->info) & 0x1L) == 0x1L)) ? class_type->class_pointer : (Class)0; |
---|
3317 | } |
---|
3318 | |
---|
3319 | static inline Class |
---|
3320 | class_get_super_class (Class class_type) |
---|
3321 | { |
---|
3322 | return ((class_type)&&((((class_type)->info) & 0x1L) == 0x1L)) ? class_type->super_class : (Class)0; |
---|
3323 | } |
---|
3324 | |
---|
3325 | static inline int |
---|
3326 | class_get_version (Class class_type) |
---|
3327 | { |
---|
3328 | return ((class_type)&&((((class_type)->info) & 0x1L) == 0x1L)) ? class_type->version : -1; |
---|
3329 | } |
---|
3330 | |
---|
3331 | static inline BOOL |
---|
3332 | class_is_class (Class class_type) |
---|
3333 | { |
---|
3334 | return ((class_type)&&((((class_type)->info) & 0x1L) == 0x1L)); |
---|
3335 | } |
---|
3336 | |
---|
3337 | static inline BOOL |
---|
3338 | class_is_meta_class (Class class_type) |
---|
3339 | { |
---|
3340 | return ((class_type)&&((((class_type)->info) & 0x2L) == 0x2L)); |
---|
3341 | } |
---|
3342 | |
---|
3343 | |
---|
3344 | static inline void |
---|
3345 | class_set_version (Class class_type, long version) |
---|
3346 | { |
---|
3347 | if (((class_type)&&((((class_type)->info) & 0x1L) == 0x1L))) |
---|
3348 | class_type->version = version; |
---|
3349 | } |
---|
3350 | |
---|
3351 | static inline void * |
---|
3352 | class_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 | |
---|
3358 | extern void class_ivar_set_gcinvisible (Class class_type, |
---|
3359 | const char* ivarname, |
---|
3360 | BOOL gcInvisible); |
---|
3361 | |
---|
3362 | static inline IMP |
---|
3363 | method_get_imp (Method_t method) |
---|
3364 | { |
---|
3365 | return (method != (Method_t)0) ? method->method_imp : (IMP) 0; |
---|
3366 | } |
---|
3367 | |
---|
3368 | IMP get_imp (Class class_type, SEL sel); |
---|
3369 | |
---|
3370 | |
---|
3371 | |
---|
3372 | |
---|
3373 | |
---|
3374 | |
---|
3375 | |
---|
3376 | id object_copy (id object); |
---|
3377 | |
---|
3378 | id object_dispose (id object); |
---|
3379 | |
---|
3380 | static inline Class |
---|
3381 | object_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 | |
---|
3392 | static inline const char * |
---|
3393 | object_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 | |
---|
3401 | static inline MetaClass |
---|
3402 | object_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 | |
---|
3412 | static inline Class |
---|
3413 | object_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 | |
---|
3423 | static inline BOOL |
---|
3424 | object_is_class (id object) |
---|
3425 | { |
---|
3426 | return (((Class) object)&&(((((Class) object)->info) & 0x1L) == 0x1L)); |
---|
3427 | } |
---|
3428 | |
---|
3429 | static inline BOOL |
---|
3430 | object_is_instance(id object) |
---|
3431 | { |
---|
3432 | return (object != (id)0) && ((object->class_pointer)&&((((object->class_pointer)->info) & 0x1L) == 0x1L)); |
---|
3433 | } |
---|
3434 | |
---|
3435 | static inline BOOL |
---|
3436 | object_is_meta_class (id object) |
---|
3437 | { |
---|
3438 | return (((Class) object)&&(((((Class) object)->info) & 0x2L) == 0x2L)); |
---|
3439 | } |
---|
3440 | |
---|
3441 | struct 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 |
---|
3449 | struct objc_list { |
---|
3450 | void *head; |
---|
3451 | struct objc_list *tail; |
---|
3452 | }; |
---|
3453 | |
---|
3454 | |
---|
3455 | |
---|
3456 | static inline struct objc_list* |
---|
3457 | list_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 | |
---|
3469 | static inline int |
---|
3470 | list_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 | |
---|
3484 | static inline void* |
---|
3485 | list_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 | |
---|
3499 | static inline void |
---|
3500 | list_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 | |
---|
3518 | static inline void |
---|
3519 | list_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 | |
---|
3530 | static inline void |
---|
3531 | list_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 | |
---|
3542 | static inline struct objc_list** |
---|
3543 | list_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 | |
---|
3556 | static void |
---|
3557 | list_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 | |
---|
3569 | extern void __objc_add_class_to_hash (Class); |
---|
3570 | extern void __objc_init_selector_tables (void); |
---|
3571 | extern void __objc_init_class_tables (void); |
---|
3572 | extern void __objc_init_dispatch_tables (void); |
---|
3573 | extern void __objc_install_premature_dtable (Class); |
---|
3574 | extern void __objc_resolve_class_links (void); |
---|
3575 | extern void __objc_register_selectors_from_class (Class); |
---|
3576 | extern void __objc_update_dispatch_table_for_class (Class); |
---|
3577 | |
---|
3578 | extern int __objc_init_thread_system (void); |
---|
3579 | extern int __objc_fini_thread_system (void); |
---|
3580 | extern void __objc_print_dtable_stats (void); |
---|
3581 | |
---|
3582 | extern void class_add_method_list (Class, MethodList_t); |
---|
3583 | |
---|
3584 | |
---|
3585 | extern void __objc_register_instance_methods_to_class (Class); |
---|
3586 | extern Method_t search_for_method_in_list(MethodList_t list, SEL op); |
---|
3587 | |
---|
3588 | |
---|
3589 | extern BOOL __objc_class_links_resolved; |
---|
3590 | |
---|
3591 | |
---|
3592 | extern int __objc_selector_max_index; |
---|
3593 | |
---|
3594 | |
---|
3595 | extern objc_mutex_t __objc_runtime_mutex; |
---|
3596 | |
---|
3597 | |
---|
3598 | extern int __objc_runtime_threads_alive; |
---|
3599 | |
---|
3600 | |
---|
3601 | |
---|
3602 | |
---|
3603 | |
---|
3604 | |
---|
3605 | |
---|
3606 | BOOL __objc_responds_to (id object, SEL sel); |
---|
3607 | SEL __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 |
---|
3612 | struct objc_super { |
---|
3613 | id receiver; |
---|
3614 | |
---|
3615 | Class class; |
---|
3616 | |
---|
3617 | |
---|
3618 | |
---|
3619 | |
---|
3620 | }; |
---|
3621 | # 53 "/usr/include/objc/message.h" 3 4 |
---|
3622 | OBJC_EXPORT id objc_msgSend(id self, SEL op, ...); |
---|
3623 | OBJC_EXPORT id objc_msgSendSuper(struct objc_super *super, SEL op, ...); |
---|
3624 | # 75 "/usr/include/objc/message.h" 3 4 |
---|
3625 | OBJC_EXPORT void objc_msgSend_stret(void * stretAddr, id self, SEL op, ...); |
---|
3626 | OBJC_EXPORT void objc_msgSendSuper_stret(void * stretAddr, struct objc_super *super, SEL op, ...); |
---|
3627 | # 99 "/usr/include/objc/message.h" 3 4 |
---|
3628 | OBJC_EXPORT long double objc_msgSend_fpret(id self, SEL op, ...); |
---|
3629 | # 114 "/usr/include/objc/message.h" 3 4 |
---|
3630 | OBJC_EXPORT id method_invoke(id receiver, Method m, ...) |
---|
3631 | AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; |
---|
3632 | OBJC_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 |
---|
3635 | OBJC_EXPORT id _objc_msgForward(id receiver, SEL sel, ...) |
---|
3636 | AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; |
---|
3637 | OBJC_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 |
---|
3640 | typedef void* marg_list; |
---|
3641 | |
---|
3642 | OBJC_EXPORT id objc_msgSendv(id self, SEL op, size_t arg_size, marg_list arg_frame) OBJC2_UNAVAILABLE; |
---|
3643 | OBJC_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" |
---|
3665 | struct fat_header { |
---|
3666 | uint32_t magic; |
---|
3667 | uint32_t nfat_arch; |
---|
3668 | }; |
---|
3669 | |
---|
3670 | struct 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" |
---|
3681 | struct 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 | |
---|
3692 | struct 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 | |
---|
3705 | struct 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" |
---|
3717 | struct __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 | |
---|
3768 | struct __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 | |
---|
3822 | struct __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 | |
---|
3835 | struct __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 | |
---|
3856 | struct __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" |
---|
3873 | struct __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" |
---|
3890 | typedef struct __darwin_ppc_thread_state ppc_thread_state_t; |
---|
3891 | |
---|
3892 | typedef struct __darwin_ppc_thread_state64 ppc_thread_state64_t; |
---|
3893 | |
---|
3894 | typedef struct __darwin_ppc_float_state ppc_float_state_t; |
---|
3895 | typedef struct __darwin_ppc_vector_state ppc_vector_state_t; |
---|
3896 | # 94 "./../include/mach/ppc/thread_status.h" |
---|
3897 | typedef struct ppc_thread_state ppc_saved_state_t; |
---|
3898 | # 115 "./../include/mach/ppc/thread_status.h" |
---|
3899 | typedef struct __darwin_ppc_exception_state ppc_exception_state_t; |
---|
3900 | |
---|
3901 | typedef 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 | |
---|
3921 | typedef 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 | |
---|
3942 | typedef 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 | |
---|
3958 | typedef 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 | |
---|
3965 | typedef 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 | |
---|
3980 | typedef 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" |
---|
3997 | typedef 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" |
---|
4037 | typedef 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 | |
---|
4076 | typedef struct _m88k_thread_state_user { |
---|
4077 | int user; |
---|
4078 | } m88k_thread_state_user_t; |
---|
4079 | # 174 "./../include/mach/m88k/thread_status.h" |
---|
4080 | typedef 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 | |
---|
4099 | typedef 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 | |
---|
4111 | typedef struct { |
---|
4112 | unsigned addr; |
---|
4113 | m88110_bp_ctrl_t ctrl; |
---|
4114 | } m88110_data_bp_t; |
---|
4115 | |
---|
4116 | |
---|
4117 | |
---|
4118 | |
---|
4119 | |
---|
4120 | |
---|
4121 | typedef 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 | |
---|
4141 | typedef 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 | |
---|
4148 | typedef 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 | |
---|
4168 | typedef 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" |
---|
4182 | struct 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" |
---|
4214 | struct 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 | |
---|
4237 | struct 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 | |
---|
4249 | typedef 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 | |
---|
4292 | typedef 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" |
---|
4331 | struct 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" |
---|
4353 | struct fpq { |
---|
4354 | unsigned int *addr; |
---|
4355 | unsigned int instr; |
---|
4356 | }; |
---|
4357 | struct fq { |
---|
4358 | union { |
---|
4359 | double whole; |
---|
4360 | struct fpq fpq; |
---|
4361 | } FQu; |
---|
4362 | }; |
---|
4363 | |
---|
4364 | |
---|
4365 | |
---|
4366 | |
---|
4367 | |
---|
4368 | struct 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" |
---|
4380 | struct rwindow { |
---|
4381 | int rw_local[8]; |
---|
4382 | int rw_in[8]; |
---|
4383 | }; |
---|
4384 | # 288 "./../include/architecture/sparc/reg.h" |
---|
4385 | struct 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 | |
---|
4405 | struct 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" |
---|
4425 | struct sparc_thread_state_regs { |
---|
4426 | struct regs regs; |
---|
4427 | }; |
---|
4428 | # 69 "./../include/mach/sparc/thread_status.h" |
---|
4429 | struct 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" |
---|
4437 | struct __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" |
---|
4444 | struct __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" |
---|
4453 | struct __darwin_arm_vfp_state |
---|
4454 | { |
---|
4455 | __uint32_t __r[64]; |
---|
4456 | __uint32_t __fpscr; |
---|
4457 | |
---|
4458 | }; |
---|
4459 | # 68 "./../include/mach/arm/_structs.h" |
---|
4460 | struct __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" |
---|
4472 | typedef struct __darwin_arm_thread_state arm_thread_state_t; |
---|
4473 | typedef struct __darwin_arm_vfp_state arm_vfp_state_t; |
---|
4474 | typedef struct __darwin_arm_exception_state arm_exception_state_t; |
---|
4475 | typedef 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" |
---|
4479 | struct 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 | |
---|
4495 | struct 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" |
---|
4505 | extern 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" |
---|
4509 | struct 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" |
---|
4520 | struct 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" |
---|
4534 | enum 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 |
---|
4559 | typedef unsigned char u_int8_t; |
---|
4560 | |
---|
4561 | |
---|
4562 | |
---|
4563 | |
---|
4564 | typedef unsigned short u_int16_t; |
---|
4565 | |
---|
4566 | |
---|
4567 | |
---|
4568 | |
---|
4569 | typedef unsigned int u_int32_t; |
---|
4570 | |
---|
4571 | |
---|
4572 | |
---|
4573 | |
---|
4574 | typedef unsigned long long u_int64_t; |
---|
4575 | |
---|
4576 | |
---|
4577 | typedef int64_t register_t; |
---|
4578 | # 114 "/usr/include/i386/types.h" 3 4 |
---|
4579 | typedef u_int64_t user_addr_t; |
---|
4580 | typedef u_int64_t user_size_t; |
---|
4581 | typedef int64_t user_ssize_t; |
---|
4582 | typedef int64_t user_long_t; |
---|
4583 | typedef u_int64_t user_ulong_t; |
---|
4584 | typedef int64_t user_time_t; |
---|
4585 | typedef int64_t user_off_t; |
---|
4586 | |
---|
4587 | |
---|
4588 | |
---|
4589 | |
---|
4590 | |
---|
4591 | |
---|
4592 | |
---|
4593 | typedef 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 | |
---|
4608 | typedef unsigned char u_char; |
---|
4609 | typedef unsigned short u_short; |
---|
4610 | typedef unsigned int u_int; |
---|
4611 | |
---|
4612 | typedef unsigned long u_long; |
---|
4613 | |
---|
4614 | |
---|
4615 | typedef unsigned short ushort; |
---|
4616 | typedef unsigned int uint; |
---|
4617 | |
---|
4618 | |
---|
4619 | typedef u_int64_t u_quad_t; |
---|
4620 | typedef int64_t quad_t; |
---|
4621 | typedef quad_t * qaddr_t; |
---|
4622 | |
---|
4623 | typedef char * caddr_t; |
---|
4624 | typedef int32_t daddr_t; |
---|
4625 | |
---|
4626 | |
---|
4627 | typedef __darwin_dev_t dev_t; |
---|
4628 | |
---|
4629 | |
---|
4630 | |
---|
4631 | typedef u_int32_t fixpt_t; |
---|
4632 | |
---|
4633 | |
---|
4634 | typedef __darwin_blkcnt_t blkcnt_t; |
---|
4635 | |
---|
4636 | |
---|
4637 | |
---|
4638 | |
---|
4639 | typedef __darwin_blksize_t blksize_t; |
---|
4640 | |
---|
4641 | |
---|
4642 | |
---|
4643 | |
---|
4644 | typedef __darwin_gid_t gid_t; |
---|
4645 | |
---|
4646 | |
---|
4647 | |
---|
4648 | |
---|
4649 | |
---|
4650 | typedef __uint32_t in_addr_t; |
---|
4651 | |
---|
4652 | |
---|
4653 | |
---|
4654 | |
---|
4655 | typedef __uint16_t in_port_t; |
---|
4656 | |
---|
4657 | |
---|
4658 | |
---|
4659 | typedef __darwin_ino_t ino_t; |
---|
4660 | |
---|
4661 | |
---|
4662 | |
---|
4663 | |
---|
4664 | |
---|
4665 | typedef __darwin_ino64_t ino64_t; |
---|
4666 | |
---|
4667 | |
---|
4668 | |
---|
4669 | |
---|
4670 | |
---|
4671 | |
---|
4672 | typedef __int32_t key_t; |
---|
4673 | |
---|
4674 | |
---|
4675 | |
---|
4676 | typedef __darwin_mode_t mode_t; |
---|
4677 | |
---|
4678 | |
---|
4679 | |
---|
4680 | |
---|
4681 | typedef __uint16_t nlink_t; |
---|
4682 | |
---|
4683 | |
---|
4684 | |
---|
4685 | |
---|
4686 | |
---|
4687 | typedef __darwin_id_t id_t; |
---|
4688 | |
---|
4689 | |
---|
4690 | |
---|
4691 | typedef __darwin_pid_t pid_t; |
---|
4692 | # 176 "/usr/include/sys/types.h" 3 4 |
---|
4693 | typedef int32_t segsz_t; |
---|
4694 | typedef int32_t swblk_t; |
---|
4695 | |
---|
4696 | |
---|
4697 | typedef __darwin_uid_t uid_t; |
---|
4698 | # 223 "/usr/include/sys/types.h" 3 4 |
---|
4699 | typedef __darwin_clock_t clock_t; |
---|
4700 | # 240 "/usr/include/sys/types.h" 3 4 |
---|
4701 | typedef __darwin_time_t time_t; |
---|
4702 | |
---|
4703 | |
---|
4704 | |
---|
4705 | |
---|
4706 | typedef __darwin_useconds_t useconds_t; |
---|
4707 | |
---|
4708 | |
---|
4709 | |
---|
4710 | |
---|
4711 | typedef __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 |
---|
4715 | typedef 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 | |
---|
4721 | static __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 | |
---|
4731 | typedef __int32_t fd_mask; |
---|
4732 | # 318 "/usr/include/sys/types.h" 3 4 |
---|
4733 | typedef __darwin_pthread_attr_t pthread_attr_t; |
---|
4734 | |
---|
4735 | |
---|
4736 | |
---|
4737 | typedef __darwin_pthread_cond_t pthread_cond_t; |
---|
4738 | |
---|
4739 | |
---|
4740 | |
---|
4741 | typedef __darwin_pthread_condattr_t pthread_condattr_t; |
---|
4742 | |
---|
4743 | |
---|
4744 | |
---|
4745 | typedef __darwin_pthread_mutex_t pthread_mutex_t; |
---|
4746 | |
---|
4747 | |
---|
4748 | |
---|
4749 | typedef __darwin_pthread_mutexattr_t pthread_mutexattr_t; |
---|
4750 | |
---|
4751 | |
---|
4752 | |
---|
4753 | typedef __darwin_pthread_once_t pthread_once_t; |
---|
4754 | |
---|
4755 | |
---|
4756 | |
---|
4757 | typedef __darwin_pthread_rwlock_t pthread_rwlock_t; |
---|
4758 | |
---|
4759 | |
---|
4760 | |
---|
4761 | typedef __darwin_pthread_rwlockattr_t pthread_rwlockattr_t; |
---|
4762 | |
---|
4763 | |
---|
4764 | |
---|
4765 | typedef __darwin_pthread_t pthread_t; |
---|
4766 | |
---|
4767 | |
---|
4768 | |
---|
4769 | |
---|
4770 | |
---|
4771 | |
---|
4772 | typedef __darwin_pthread_key_t pthread_key_t; |
---|
4773 | |
---|
4774 | |
---|
4775 | |
---|
4776 | |
---|
4777 | |
---|
4778 | typedef __darwin_fsblkcnt_t fsblkcnt_t; |
---|
4779 | |
---|
4780 | |
---|
4781 | |
---|
4782 | |
---|
4783 | typedef __darwin_fsfilcnt_t fsfilcnt_t; |
---|
4784 | # 29 "./../include/mach-o/ranlib.h" 2 |
---|
4785 | # 58 "./../include/mach-o/ranlib.h" |
---|
4786 | struct 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" |
---|
4798 | enum bool { |
---|
4799 | FALSE, |
---|
4800 | TRUE |
---|
4801 | }; |
---|
4802 | # 58 "./../include/stuff/bytesex.h" 2 |
---|
4803 | |
---|
4804 | enum 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 | |
---|
5152 | struct 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 |
---|
5163 | struct 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 | |
---|
5182 | extern 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 | |
---|
5188 | extern 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 | |
---|
5196 | extern 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 | |
---|
5209 | extern 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 | |
---|
5219 | extern 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 | |
---|
5230 | extern 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 | |
---|
5238 | extern 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 | |
---|
5253 | extern 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 | |
---|
5272 | extern 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 | |
---|
5279 | extern 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 | |
---|
5286 | void 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 | |
---|
5299 | extern 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 | |
---|
5314 | extern 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 | |
---|
5328 | extern 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 | |
---|
5343 | extern 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 | |
---|
5361 | extern void print_symtab_command( |
---|
5362 | struct symtab_command *sg, |
---|
5363 | cpu_type_t cputype, |
---|
5364 | uint32_t object_size); |
---|
5365 | |
---|
5366 | extern void print_dysymtab_command( |
---|
5367 | struct dysymtab_command *dyst, |
---|
5368 | uint32_t nsyms, |
---|
5369 | uint32_t object_size, |
---|
5370 | cpu_type_t cputype); |
---|
5371 | |
---|
5372 | extern void print_symseg_command( |
---|
5373 | struct symseg_command *ss, |
---|
5374 | uint32_t object_size); |
---|
5375 | |
---|
5376 | extern void print_fvmlib_command( |
---|
5377 | struct fvmlib_command *fl, |
---|
5378 | struct load_command *lc); |
---|
5379 | |
---|
5380 | extern void print_dylib_command( |
---|
5381 | struct dylib_command *dl, |
---|
5382 | struct load_command *lc); |
---|
5383 | |
---|
5384 | extern void print_sub_framework_command( |
---|
5385 | struct sub_framework_command *sub, |
---|
5386 | struct load_command *lc); |
---|
5387 | |
---|
5388 | extern void print_sub_umbrella_command( |
---|
5389 | struct sub_umbrella_command *usub, |
---|
5390 | struct load_command *lc); |
---|
5391 | |
---|
5392 | extern void print_sub_library_command( |
---|
5393 | struct sub_library_command *lsub, |
---|
5394 | struct load_command *lc); |
---|
5395 | |
---|
5396 | extern void print_sub_client_command( |
---|
5397 | struct sub_client_command *csub, |
---|
5398 | struct load_command *lc); |
---|
5399 | |
---|
5400 | extern void print_prebound_dylib_command( |
---|
5401 | struct prebound_dylib_command *pbdylib, |
---|
5402 | struct load_command *lc, |
---|
5403 | enum bool verbose); |
---|
5404 | |
---|
5405 | extern void print_dylinker_command( |
---|
5406 | struct dylinker_command *dyld, |
---|
5407 | struct load_command *lc); |
---|
5408 | |
---|
5409 | extern void print_fvmfile_command( |
---|
5410 | struct fvmfile_command *ff, |
---|
5411 | struct load_command *lc); |
---|
5412 | |
---|
5413 | extern void print_routines_command( |
---|
5414 | struct routines_command *rc); |
---|
5415 | |
---|
5416 | extern void print_routines_command_64( |
---|
5417 | struct routines_command_64 *rc64); |
---|
5418 | |
---|
5419 | extern void print_twolevel_hints_command( |
---|
5420 | struct twolevel_hints_command *hints, |
---|
5421 | uint32_t object_size); |
---|
5422 | |
---|
5423 | extern void print_prebind_cksum_command( |
---|
5424 | struct prebind_cksum_command *cksum); |
---|
5425 | |
---|
5426 | extern void print_uuid_command( |
---|
5427 | struct uuid_command *uuid); |
---|
5428 | |
---|
5429 | extern void print_linkedit_data_command( |
---|
5430 | struct linkedit_data_command *ld, |
---|
5431 | uint32_t object_size); |
---|
5432 | |
---|
5433 | extern void print_version_min_command( |
---|
5434 | struct version_min_command *vd); |
---|
5435 | |
---|
5436 | extern void print_source_version_command( |
---|
5437 | struct source_version_command *sv); |
---|
5438 | |
---|
5439 | extern void print_entry_point_command( |
---|
5440 | struct entry_point_command *ep); |
---|
5441 | |
---|
5442 | extern void print_rpath_command( |
---|
5443 | struct rpath_command *rpath, |
---|
5444 | struct load_command *lc); |
---|
5445 | |
---|
5446 | extern void print_encryption_info_command( |
---|
5447 | struct encryption_info_command *ec, |
---|
5448 | uint32_t object_size); |
---|
5449 | |
---|
5450 | extern void print_dyld_info_info_command( |
---|
5451 | struct dyld_info_command *dc, |
---|
5452 | uint32_t object_size); |
---|
5453 | |
---|
5454 | extern void print_thread_states( |
---|
5455 | char *begin, |
---|
5456 | char *end, |
---|
5457 | cpu_type_t cputype, |
---|
5458 | enum byte_sex thread_states_byte_sex); |
---|
5459 | |
---|
5460 | extern 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 | |
---|
5467 | extern 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 | |
---|
5474 | extern 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 | |
---|
5481 | extern 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 | |
---|
5488 | extern 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 | |
---|
5507 | extern 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 | |
---|
5517 | extern 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 | |
---|
5533 | extern 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 | |
---|
5548 | extern 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 | |
---|
5554 | extern 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 | |
---|
5568 | extern 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 | |
---|
5575 | extern 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 | |
---|
5587 | extern 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 | |
---|
5608 | extern 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 | |
---|
5628 | extern 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 | |
---|
5637 | extern 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 | |
---|
5647 | extern 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 | |
---|
5664 | extern 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 | |
---|
5673 | extern 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 | |
---|
5683 | extern void print_label( |
---|
5684 | uint64_t addr, |
---|
5685 | enum bool colon_and_newline, |
---|
5686 | struct symbol *sorted_symbols, |
---|
5687 | uint32_t nsorted_symbols); |
---|
5688 | |
---|
5689 | extern 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" |
---|
5707 | struct objc_module_t { |
---|
5708 | uint32_t version; |
---|
5709 | uint32_t size; |
---|
5710 | uint32_t name; |
---|
5711 | uint32_t symtab; |
---|
5712 | }; |
---|
5713 | |
---|
5714 | struct 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 | |
---|
5722 | struct 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 | |
---|
5735 | struct 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 | |
---|
5743 | struct objc_ivar_t { |
---|
5744 | uint32_t ivar_name; |
---|
5745 | uint32_t ivar_type; |
---|
5746 | int32_t ivar_offset; |
---|
5747 | }; |
---|
5748 | |
---|
5749 | struct objc_ivar_list_t { |
---|
5750 | int32_t ivar_count; |
---|
5751 | struct objc_ivar_t ivar_list[1]; |
---|
5752 | }; |
---|
5753 | |
---|
5754 | struct objc_method_t { |
---|
5755 | uint32_t method_name; |
---|
5756 | uint32_t method_types; |
---|
5757 | uint32_t method_imp; |
---|
5758 | |
---|
5759 | }; |
---|
5760 | |
---|
5761 | struct objc_method_list_t { |
---|
5762 | uint32_t obsolete; |
---|
5763 | int32_t method_count; |
---|
5764 | struct objc_method_t method_list[1]; |
---|
5765 | }; |
---|
5766 | |
---|
5767 | struct 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 | |
---|
5778 | struct objc_protocol_list_t { |
---|
5779 | uint32_t next; |
---|
5780 | int32_t count; |
---|
5781 | uint32_t list[1]; |
---|
5782 | |
---|
5783 | }; |
---|
5784 | |
---|
5785 | struct objc_method_description_t { |
---|
5786 | uint32_t name; |
---|
5787 | uint32_t types; |
---|
5788 | }; |
---|
5789 | |
---|
5790 | struct objc_method_description_list_t { |
---|
5791 | int32_t count; |
---|
5792 | struct objc_method_description_t list[1]; |
---|
5793 | }; |
---|
5794 | |
---|
5795 | |
---|
5796 | |
---|
5797 | |
---|
5798 | |
---|
5799 | |
---|
5800 | struct objc_string_object_t { |
---|
5801 | uint32_t isa; |
---|
5802 | uint32_t characters; |
---|
5803 | uint32_t _length; |
---|
5804 | }; |
---|
5805 | typedef struct objc_string_object_t NXConstantString; |
---|
5806 | |
---|
5807 | |
---|
5808 | struct _hashEntry_t { |
---|
5809 | uint32_t next; |
---|
5810 | uint32_t sel; |
---|
5811 | }; |
---|
5812 | |
---|
5813 | struct imageInfo_t { |
---|
5814 | uint32_t version; |
---|
5815 | uint32_t flags; |
---|
5816 | }; |
---|
5817 | |
---|
5818 | static |
---|
5819 | void |
---|
5820 | swap_imageInfo_t( |
---|
5821 | struct imageInfo_t *o, |
---|
5822 | enum 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 | |
---|
5828 | void |
---|
5829 | swap_objc_module_t( |
---|
5830 | struct objc_module_t *module, |
---|
5831 | enum 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 | |
---|
5839 | void |
---|
5840 | swap_objc_symtab_t( |
---|
5841 | struct objc_symtab_t *symtab, |
---|
5842 | enum 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 | |
---|
5850 | void |
---|
5851 | swap_objc_class_t( |
---|
5852 | struct objc_class_t *objc_class, |
---|
5853 | enum 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 | |
---|
5867 | void |
---|
5868 | swap_objc_category_t( |
---|
5869 | struct objc_category_t *objc_category, |
---|
5870 | enum 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 | |
---|
5882 | void |
---|
5883 | swap_objc_ivar_list_t( |
---|
5884 | struct objc_ivar_list_t *objc_ivar_list, |
---|
5885 | enum 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 | |
---|
5890 | void |
---|
5891 | swap_objc_ivar_t( |
---|
5892 | struct objc_ivar_t *objc_ivar, |
---|
5893 | enum 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 | |
---|
5900 | void |
---|
5901 | swap_objc_method_list_t( |
---|
5902 | struct objc_method_list_t *method_list, |
---|
5903 | enum 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 | |
---|
5909 | void |
---|
5910 | swap_objc_method_t( |
---|
5911 | struct objc_method_t *method, |
---|
5912 | enum 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 | |
---|
5919 | void |
---|
5920 | swap_objc_protocol_list_t( |
---|
5921 | struct objc_protocol_list_t *protocol_list, |
---|
5922 | enum 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 | |
---|
5928 | void |
---|
5929 | swap_objc_protocol_t( |
---|
5930 | struct objc_protocol_t *protocol, |
---|
5931 | enum 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 | |
---|
5940 | void |
---|
5941 | swap_objc_method_description_list_t( |
---|
5942 | struct objc_method_description_list_t *mdl, |
---|
5943 | enum 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 | |
---|
5948 | void |
---|
5949 | swap_objc_method_description_t( |
---|
5950 | struct objc_method_description_t *md, |
---|
5951 | enum 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 | |
---|
5957 | void |
---|
5958 | swap_string_object_t( |
---|
5959 | struct objc_string_object_t *string_object, |
---|
5960 | enum 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 | |
---|
5967 | void |
---|
5968 | swap_hashEntry_t( |
---|
5969 | struct _hashEntry_t *_hashEntry, |
---|
5970 | enum 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 | |
---|
5976 | struct 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 | |
---|
5985 | static 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 | |
---|
5999 | static 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 | |
---|
6008 | static 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 | |
---|
6019 | static 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 | |
---|
6029 | static 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 | |
---|
6039 | static 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 | |
---|
6049 | static 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 | |
---|
6059 | static void print_indent( |
---|
6060 | uint32_t indent); |
---|
6061 | |
---|
6062 | static 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 | |
---|
6069 | static 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 | |
---|
6080 | static 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 | |
---|
6089 | static 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 | |
---|
6098 | static 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 | |
---|
6109 | static 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 | |
---|
6120 | static 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 | |
---|
6131 | static 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 | |
---|
6140 | static 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 | |
---|
6151 | static 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 | |
---|
6163 | enum bool |
---|
6164 | print_objc_segment( |
---|
6165 | cpu_type_t mh_cputype, |
---|
6166 | struct load_command *load_commands, |
---|
6167 | uint32_t ncmds, |
---|
6168 | uint32_t sizeofcmds, |
---|
6169 | enum byte_sex object_byte_sex, |
---|
6170 | char *object_addr, |
---|
6171 | uint32_t object_size, |
---|
6172 | struct symbol *sorted_symbols, |
---|
6173 | uint32_t nsorted_symbols, |
---|
6174 | enum 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); |
---|
6289 | print_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 | |
---|
6546 | void |
---|
6547 | print_objc_protocol_section( |
---|
6548 | struct load_command *load_commands, |
---|
6549 | uint32_t ncmds, |
---|
6550 | uint32_t sizeofcmds, |
---|
6551 | enum byte_sex object_byte_sex, |
---|
6552 | char *object_addr, |
---|
6553 | uint32_t object_size, |
---|
6554 | enum 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 | |
---|
6597 | void |
---|
6598 | print_objc_string_object_section( |
---|
6599 | char *sectname, |
---|
6600 | struct load_command *load_commands, |
---|
6601 | uint32_t ncmds, |
---|
6602 | uint32_t sizeofcmds, |
---|
6603 | enum byte_sex object_byte_sex, |
---|
6604 | char *object_addr, |
---|
6605 | uint32_t object_size, |
---|
6606 | enum 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 | |
---|
6670 | void |
---|
6671 | print_objc_runtime_setup_section( |
---|
6672 | struct load_command *load_commands, |
---|
6673 | uint32_t ncmds, |
---|
6674 | uint32_t sizeofcmds, |
---|
6675 | enum byte_sex object_byte_sex, |
---|
6676 | char *object_addr, |
---|
6677 | uint32_t object_size, |
---|
6678 | enum 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", §, §_addr, |
---|
6693 | §_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 | |
---|
6756 | static |
---|
6757 | void |
---|
6758 | get_objc_sections( |
---|
6759 | struct load_command *load_commands, |
---|
6760 | uint32_t ncmds, |
---|
6761 | uint32_t sizeofcmds, |
---|
6762 | enum byte_sex object_byte_sex, |
---|
6763 | char *object_addr, |
---|
6764 | uint32_t object_size, |
---|
6765 | struct section_info **objc_sections, |
---|
6766 | uint32_t *nobjc_sections, |
---|
6767 | char *sectname, |
---|
6768 | char **sect, |
---|
6769 | uint32_t *sect_addr, |
---|
6770 | uint32_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 | |
---|
6919 | static |
---|
6920 | void |
---|
6921 | get_cstring_section( |
---|
6922 | struct load_command *load_commands, |
---|
6923 | uint32_t ncmds, |
---|
6924 | uint32_t sizeofcmds, |
---|
6925 | enum byte_sex object_byte_sex, |
---|
6926 | char *object_addr, |
---|
6927 | uint32_t object_size, |
---|
6928 | struct 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 | |
---|
7024 | static |
---|
7025 | enum bool |
---|
7026 | print_method_list( |
---|
7027 | uint32_t addr, |
---|
7028 | struct section_info *objc_sections, |
---|
7029 | uint32_t nobjc_sections, |
---|
7030 | struct section_info *cstring_section_ptr, |
---|
7031 | enum byte_sex host_byte_sex, |
---|
7032 | enum bool swapped, |
---|
7033 | struct symbol *sorted_symbols, |
---|
7034 | uint32_t nsorted_symbols, |
---|
7035 | enum 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 | |
---|
7099 | static |
---|
7100 | enum bool |
---|
7101 | print_protocol_list( |
---|
7102 | uint32_t indent, |
---|
7103 | uint32_t addr, |
---|
7104 | struct section_info *objc_sections, |
---|
7105 | uint32_t nobjc_sections, |
---|
7106 | struct section_info *cstring_section_ptr, |
---|
7107 | enum byte_sex host_byte_sex, |
---|
7108 | enum bool swapped, |
---|
7109 | enum 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 | |
---|
7165 | static |
---|
7166 | void |
---|
7167 | print_protocol( |
---|
7168 | uint32_t indent, |
---|
7169 | struct objc_protocol_t *protocol, |
---|
7170 | struct section_info *objc_sections, |
---|
7171 | uint32_t nobjc_sections, |
---|
7172 | struct section_info *cstring_section_ptr, |
---|
7173 | enum byte_sex host_byte_sex, |
---|
7174 | enum bool swapped, |
---|
7175 | enum 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 | |
---|
7221 | static |
---|
7222 | enum bool |
---|
7223 | print_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 | |
---|
7296 | static enum bool |
---|
7297 | print_PHASH( |
---|
7298 | uint32_t indent, |
---|
7299 | uint32_t addr, |
---|
7300 | struct section_info *objc_sections, |
---|
7301 | uint32_t nobjc_sections, |
---|
7302 | struct section_info *cstring_section_ptr, |
---|
7303 | enum byte_sex host_byte_sex, |
---|
7304 | enum bool swapped, |
---|
7305 | enum 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 | |
---|
7348 | static |
---|
7349 | void |
---|
7350 | print_indent( |
---|
7351 | uint32_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 | |
---|
7367 | static |
---|
7368 | void * |
---|
7369 | get_pointer( |
---|
7370 | uint32_t addr, |
---|
7371 | uint32_t *left, |
---|
7372 | struct section_info *objc_sections, |
---|
7373 | uint32_t nobjc_sections, |
---|
7374 | struct 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 | |
---|
7401 | static |
---|
7402 | enum bool |
---|
7403 | get_symtab( |
---|
7404 | uint32_t addr, |
---|
7405 | struct objc_symtab_t *symtab, |
---|
7406 | uint32_t **defs, |
---|
7407 | uint32_t *left, |
---|
7408 | enum bool *trunc, |
---|
7409 | struct section_info *objc_sections, |
---|
7410 | uint32_t nobjc_sections, |
---|
7411 | enum byte_sex host_byte_sex, |
---|
7412 | enum 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 | |
---|
7454 | static |
---|
7455 | enum bool |
---|
7456 | get_objc_class( |
---|
7457 | uint32_t addr, |
---|
7458 | struct objc_class_t *objc_class, |
---|
7459 | enum bool *trunc, |
---|
7460 | struct section_info *objc_sections, |
---|
7461 | uint32_t nobjc_sections, |
---|
7462 | enum byte_sex host_byte_sex, |
---|
7463 | enum 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 | |
---|
7498 | static |
---|
7499 | enum bool |
---|
7500 | get_objc_category( |
---|
7501 | uint32_t addr, |
---|
7502 | struct objc_category_t *objc_category, |
---|
7503 | enum bool *trunc, |
---|
7504 | struct section_info *objc_sections, |
---|
7505 | uint32_t nobjc_sections, |
---|
7506 | enum byte_sex host_byte_sex, |
---|
7507 | enum 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 | |
---|
7542 | static |
---|
7543 | enum bool |
---|
7544 | get_ivar_list( |
---|
7545 | uint32_t addr, |
---|
7546 | struct objc_ivar_list_t *objc_ivar_list, |
---|
7547 | struct objc_ivar_t **ivar_list, |
---|
7548 | uint32_t *left, |
---|
7549 | enum bool *trunc, |
---|
7550 | struct section_info *objc_sections, |
---|
7551 | uint32_t nobjc_sections, |
---|
7552 | enum byte_sex host_byte_sex, |
---|
7553 | enum 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 | |
---|
7599 | static |
---|
7600 | enum bool |
---|
7601 | get_method_list( |
---|
7602 | uint32_t addr, |
---|
7603 | struct objc_method_list_t *method_list, |
---|
7604 | struct objc_method_t **methods, |
---|
7605 | uint32_t *left, |
---|
7606 | enum bool *trunc, |
---|
7607 | struct section_info *objc_sections, |
---|
7608 | uint32_t nobjc_sections, |
---|
7609 | enum byte_sex host_byte_sex, |
---|
7610 | enum 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 | |
---|
7656 | static |
---|
7657 | enum bool |
---|
7658 | get_protocol_list( |
---|
7659 | uint32_t addr, |
---|
7660 | struct objc_protocol_list_t *protocol_list, |
---|
7661 | uint32_t **list, |
---|
7662 | uint32_t *left, |
---|
7663 | enum bool *trunc, |
---|
7664 | struct section_info *objc_sections, |
---|
7665 | uint32_t nobjc_sections, |
---|
7666 | enum byte_sex host_byte_sex, |
---|
7667 | enum 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 | |
---|
7713 | static |
---|
7714 | enum bool |
---|
7715 | get_protocol( |
---|
7716 | uint32_t addr, |
---|
7717 | struct objc_protocol_t *protocol, |
---|
7718 | enum bool *trunc, |
---|
7719 | struct section_info *objc_sections, |
---|
7720 | uint32_t nobjc_sections, |
---|
7721 | enum byte_sex host_byte_sex, |
---|
7722 | enum 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 | |
---|
7757 | static |
---|
7758 | enum bool |
---|
7759 | get_method_description_list( |
---|
7760 | uint32_t addr, |
---|
7761 | struct objc_method_description_list_t *mdl, |
---|
7762 | struct objc_method_description_t **list, |
---|
7763 | uint32_t *left, |
---|
7764 | enum bool *trunc, |
---|
7765 | struct section_info *objc_sections, |
---|
7766 | uint32_t nobjc_sections, |
---|
7767 | enum byte_sex host_byte_sex, |
---|
7768 | enum 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 | |
---|
7814 | static |
---|
7815 | enum bool |
---|
7816 | get_hashEntry( |
---|
7817 | uint32_t addr, |
---|
7818 | struct _hashEntry_t *_hashEntry, |
---|
7819 | enum bool *trunc, |
---|
7820 | struct section_info *objc_sections, |
---|
7821 | uint32_t nobjc_sections, |
---|
7822 | enum byte_sex host_byte_sex, |
---|
7823 | enum 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 | } |
---|