Merge branch 'master' of git://github.com/erikcharlebois/factor
commit
3be3fdeb46
|
@ -0,0 +1 @@
|
||||||
|
Erik Charlebois
|
|
@ -0,0 +1,7 @@
|
||||||
|
! Copyright (C) 2010 Erik Charlebois.
|
||||||
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
USING: images.testing ;
|
||||||
|
IN: images.pbm.tests
|
||||||
|
|
||||||
|
"vocab:images/testing/pbm/test.binary.pbm" decode-test
|
||||||
|
"vocab:images/testing/pbm/test.ascii.pbm" decode-test
|
|
@ -0,0 +1,86 @@
|
||||||
|
! Copyright (C) 2010 Erik Charlebois.
|
||||||
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
USING: accessors arrays ascii bit-arrays byte-arrays combinators
|
||||||
|
continuations grouping images images.loader io io.encodings.ascii
|
||||||
|
io.encodings.string kernel locals make math math.functions math.parser
|
||||||
|
sequences ;
|
||||||
|
IN: images.pbm
|
||||||
|
|
||||||
|
SINGLETON: pbm-image
|
||||||
|
"pbm" pbm-image register-image-class
|
||||||
|
|
||||||
|
<PRIVATE
|
||||||
|
: read-token ( -- token )
|
||||||
|
[
|
||||||
|
read1 dup blank?
|
||||||
|
[ t ]
|
||||||
|
[
|
||||||
|
dup CHAR: # =
|
||||||
|
[ "\n" read-until 2drop t ]
|
||||||
|
[ f ] if
|
||||||
|
] if
|
||||||
|
] [ drop ] while
|
||||||
|
" \n\r\t" read-until drop swap
|
||||||
|
prefix ascii decode ;
|
||||||
|
|
||||||
|
: read-number ( -- number )
|
||||||
|
read-token string>number ;
|
||||||
|
|
||||||
|
: read-ascii-bits ( -- )
|
||||||
|
read1 {
|
||||||
|
{ CHAR: 1 [ 0 , read-ascii-bits ] }
|
||||||
|
{ CHAR: 0 [ 255 , read-ascii-bits ] }
|
||||||
|
{ f [ ] }
|
||||||
|
[ drop read-ascii-bits ]
|
||||||
|
} case ;
|
||||||
|
|
||||||
|
:: read-binary-bits ( width height -- )
|
||||||
|
width 8 align 8 / height * read
|
||||||
|
width 8 align 8 / <groups> [| row |
|
||||||
|
width iota [| n |
|
||||||
|
n 8 / floor row nth
|
||||||
|
n 8 mod 7 swap - bit?
|
||||||
|
[ 0 ] [ 255 ] if ,
|
||||||
|
] each
|
||||||
|
] each ;
|
||||||
|
|
||||||
|
:: write-binary-bits ( bitmap width -- )
|
||||||
|
bitmap width <groups> [
|
||||||
|
width 8 align 255 pad-tail
|
||||||
|
8 <groups> [
|
||||||
|
[ 255 = [ f ] [ t ] if ] { } map-as
|
||||||
|
>bit-array reverse bit-array>integer
|
||||||
|
1array >byte-array write
|
||||||
|
] each
|
||||||
|
] each ;
|
||||||
|
|
||||||
|
:: read-pbm ( -- image )
|
||||||
|
read-token :> type
|
||||||
|
read-number :> width
|
||||||
|
read-number :> height
|
||||||
|
width height * :> npixels
|
||||||
|
width 8 mod :> leftover
|
||||||
|
|
||||||
|
type {
|
||||||
|
{ "P1" [ [ [ read-ascii-bits ] ignore-errors ] B{ } make ] }
|
||||||
|
{ "P4" [ [ width height read-binary-bits ] B{ } make ] }
|
||||||
|
} case :> data
|
||||||
|
|
||||||
|
image new
|
||||||
|
L >>component-order
|
||||||
|
{ width height } >>dim
|
||||||
|
f >>upside-down?
|
||||||
|
data >>bitmap
|
||||||
|
ubyte-components >>component-type ;
|
||||||
|
PRIVATE>
|
||||||
|
|
||||||
|
M: pbm-image stream>image
|
||||||
|
drop [ read-pbm ] with-input-stream ;
|
||||||
|
|
||||||
|
M: pbm-image image>stream
|
||||||
|
drop {
|
||||||
|
[ drop "P4\n" ascii encode write ]
|
||||||
|
[ dim>> first number>string " " append ascii encode write ]
|
||||||
|
[ dim>> second number>string "\n" append ascii encode write ]
|
||||||
|
[ [ bitmap>> ] [ dim>> first ] bi write-binary-bits ]
|
||||||
|
} cleave ;
|
|
@ -0,0 +1 @@
|
||||||
|
Image loading for PBM image files.
|
Binary file not shown.
|
@ -0,0 +1,369 @@
|
||||||
|
P1
|
||||||
|
# CREATOR: GIMP PNM Filter Version 1.1
|
||||||
|
160 160
|
||||||
|
1111111100000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000111111111111111100000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000011111111111111111000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000111111111111111111
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0111111111111111111000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000111111111111111110000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000001111111111111111100000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000011111111
|
||||||
|
1111111110000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000111111101111110000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000001011111001010000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000101000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000001111
|
||||||
|
1111111111111111111111010000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000011111111111111111111111111111111000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000001111111111111111111111111111111111100
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000111111111111111111
|
||||||
|
1111111111111111111000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0111111111111111111111111111111111111111000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000001111111111111111111111111111111111111110000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000011111111111111111111111111111
|
||||||
|
1111111111000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000001111111111
|
||||||
|
1111111111111111111111111111110000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000111111111111111111111111111111111111111100000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000011111111111111111111111111111111111111111
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000111111111111111111111
|
||||||
|
1111111111111111111100000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000001
|
||||||
|
1111111111111111111111111111111111111111000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000111111111111000000000000000001111111111110000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000001111111111110000000000000000011
|
||||||
|
1111111111000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000011111111111
|
||||||
|
1000000000000000001111111111110000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000001111111111110000000000000000011111111111100000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000011111111111100000000000000000111111111111
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000111111111111000000000
|
||||||
|
0000000011111111111100000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000001
|
||||||
|
1111111111100000000000000000111111111111000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000111111111111000000000000000001111111111110000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000001111111111110000000000000000011
|
||||||
|
1111111111000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000011110100000000000000000000000000000000000000000011111111111
|
||||||
|
1000000000000000001111111111110000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000111111111110000000000000000000000000000000
|
||||||
|
0000000001111111111110000000000000000011111111111100000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000111111111111110000000000
|
||||||
|
0000000000000000000000000000011111111111100000000000000000111111111111
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000001111111
|
||||||
|
1111111111100000000000000000000000000000000000000111111111111000000000
|
||||||
|
0000000111111111111100000000000000000000000000000000000000000000000000
|
||||||
|
0000000000111111111111111111111100000000000000000000000000000000000001
|
||||||
|
1111111111100000000000000001111111111110000000000000000000000000000000
|
||||||
|
0000000000000000000000000000011111111111111111111111000000000000000000
|
||||||
|
0000000000000000001111111111111000000000000000011111111111100000000000
|
||||||
|
0000000000000000000000000000000000000000000000011111111111111111111111
|
||||||
|
1110000000000000000000000000000000000001111111111100000000000000000111
|
||||||
|
1111111110000000000000000000000000000000000000000000000000000000001111
|
||||||
|
1111111111111111111111100000000000000000000000000000000000111111111111
|
||||||
|
0000000000000000011111111111100000000000000000000000000000000000000000
|
||||||
|
0000000000000011111111111111111111111111111000000000000000000000000000
|
||||||
|
0000000011111111111100000000000000000111111111110000000000000000000000
|
||||||
|
0000000000000000000000000000000011111111111111111111111111111110000000
|
||||||
|
0000000000000000000000000000111111111111000000000000000011111111111100
|
||||||
|
0000000000000000000000000000000000000000000000000001111111111111111111
|
||||||
|
1111111111111000000000000000000000000000000000001111111111110000000000
|
||||||
|
0000001111111111110000000000000000000000000000000000000000000000000000
|
||||||
|
1111111111111111111111111111111110000000000000000000000000000000000011
|
||||||
|
1111111111000000000000000011111111111100000000000000000000000000000000
|
||||||
|
0000000000000000000111111111111111111111111111111111110000000000000000
|
||||||
|
0000000000000000001111111111110000000000000000111111111111000000000000
|
||||||
|
0000000000000000000000000000000000000001111111111111111111111011111111
|
||||||
|
1111000000000000000000000000000000000111111111111100000000000000001111
|
||||||
|
1111111100000000000000000000000000000000000000000000000000011111111111
|
||||||
|
1111110000001111111111110000000000000000000000000000000011111111111110
|
||||||
|
0000000000000000111111111111000000000000000000000000000000000000000000
|
||||||
|
0000000011111111111111111000000011111111111110000000000000000000000000
|
||||||
|
0000011111111111111000000000000000001111111111110000000000000000000000
|
||||||
|
0000000000000000000000000000111111111111111000000000011111111111000000
|
||||||
|
0000000000000000000000000111111111111110000000000000000011111111111100
|
||||||
|
0000000000000000000000000000000000000000000000001111111111111100000000
|
||||||
|
0001111111111110000000000000000000000000000011111111111111000000000000
|
||||||
|
0000001111111111110000000000000000000000000000000000000000000000000011
|
||||||
|
1111111111000000000000011111111111100000000000000000000000000011111111
|
||||||
|
1111111100000000000000000011111111111100000000000000000000000000000000
|
||||||
|
0000000000000000001111111111100000000000000111111111111000000000000000
|
||||||
|
0000000000001111111111111110000000000000000000111111111111000000000000
|
||||||
|
0000000000000000000000000000000000000111111111111000000000000001111111
|
||||||
|
1111100000000000000000000000000111111111111111000000000000000000001111
|
||||||
|
1111111100000000000000000000000000000000000000000000000001111111111110
|
||||||
|
0000000000000111111111111000000000000000000000000011111111111111110000
|
||||||
|
0000000000000000111111111111000000000000000000000000000000000000000000
|
||||||
|
0000000111111111111000000000000001111111111110000000000000000000000001
|
||||||
|
1111111111111110000000000000000000001111111111110000000000000000000000
|
||||||
|
0000000000000000000000000001111111111110000000000000011111111111110000
|
||||||
|
0000000000000000000111111111111111000000000000000000000011111111111100
|
||||||
|
0000000000000000000000000000000000000000000000011111111111100000000000
|
||||||
|
0000111111111111000000000000000000000111111111111111100000000000000000
|
||||||
|
0000001111111111110000000000000000000000000000000000000000000000000111
|
||||||
|
1111111110000000000000001111111111110000000000000000000011111111111111
|
||||||
|
1100000000000000000000000011111111111100000000000000000000000000000000
|
||||||
|
0000000000000000011111111111100000000000000011111111111110000000000000
|
||||||
|
0000011111111111111110000000000000000000000000111111111111000000000000
|
||||||
|
0000000000000000000000000000000000000111111111111000000000000000011111
|
||||||
|
1111111000000000000000000111111111111111100000000000000000000000001111
|
||||||
|
1111111100000000000000000000000000000000000000000000000001111111111110
|
||||||
|
0000000000000001111111111110000000000000000111111111111111100000000000
|
||||||
|
0000000000000000111111111110000000000000000000000000000000000000000000
|
||||||
|
0000000111111111111000000000000000011111111111100000000000000001111111
|
||||||
|
1111111110000000000000000000000000011111111111110000000000000000000000
|
||||||
|
0000000000000000000000000001111111111110000000000000000111111111111000
|
||||||
|
0000000000001111111111111111000000000000000000000000000111111111111000
|
||||||
|
0000000000000000000000000000000000000000000000011111111111100000000000
|
||||||
|
0000011111111111110000000000000111111111111111100000000000000000000000
|
||||||
|
0000011111111111100000000000000000000000000000000000000000000000000111
|
||||||
|
1111111110000000000000000011111111111100000000000011111111111111110000
|
||||||
|
0000000000000000000000000111111111111000000000000000000000000000000000
|
||||||
|
0000000000000000011111111111100000000000000000111111111111000000000001
|
||||||
|
1111111111111100000000000000000000000000000001111111111110000000000000
|
||||||
|
0000000000000000000000000000000000000111111111111000000000000000001111
|
||||||
|
1111111110000000001111111111111111000000000000000000000000000000011111
|
||||||
|
1111111000000000000000000000000000000000000000000000000001111111111110
|
||||||
|
0000000000000000011111111111100000000111111111111111100000000000000000
|
||||||
|
0000000000000001111111111110000000000000000000000000000000000000000000
|
||||||
|
0000000111111111111000000000000000000111111111111000000111111111111111
|
||||||
|
1100000000000000000000000000000000011111111111100000000000000000000000
|
||||||
|
0000000000000000000000000001111111111110000000000000000001111111111110
|
||||||
|
0000011111111111111110000000000000000000000000000000000111111111111000
|
||||||
|
0000000000000000000000000000000000000000000000011111111111100000000000
|
||||||
|
0000000111111111111000011111111111111111000000000000000000000000000000
|
||||||
|
0000011111111111100000000000000000000000000000000000000000000000000111
|
||||||
|
1111111110000000000000000000111111111111001111111111111111110000000000
|
||||||
|
0000000000000000000000000111111111111000000000000000000000000000000000
|
||||||
|
0000000000000000011111111111100000000000000000001111111111110111111111
|
||||||
|
1111111100000000000000000000000000000000000001111111111110000000000000
|
||||||
|
0000000000000000000000000000000000000111111111111000000000000000000011
|
||||||
|
1111111111111111111111111111000000000000000000000000000000000000011111
|
||||||
|
1111111000000000000000000000000000000000000000000000000001111111111110
|
||||||
|
0000000000000000001111111111111111111111111111000000000000000000000000
|
||||||
|
0000000000000001111111111110000000000000000000000000000000000000000000
|
||||||
|
0000000111111111111000000000000000000001111111111111111111111111100000
|
||||||
|
0000000000000000000000000000000000011111111111100000000000000000000000
|
||||||
|
0000000000000000000000000001111111111110000000000000000000011111111111
|
||||||
|
1111111111111100000000000000000000000000000000000000001111111111110000
|
||||||
|
0000000000000000000000000000000000000000000000011111111111100000000000
|
||||||
|
0000000001111111111111111111111110000000000000000000000000000000000000
|
||||||
|
0000111111111111000000000000000000000000000000000000000000000000000111
|
||||||
|
1111111110000000000000000000011111111111111111111111000000000000000000
|
||||||
|
0000000000000000000000001111111111110000000000000000000000000000000000
|
||||||
|
0000000000000000011111111111100000000000000000000111111111111111111111
|
||||||
|
0000000000000000000000000000000000000000000011111111111100000000000000
|
||||||
|
0000000000000000000000000000000000000111111111111000000000000000000001
|
||||||
|
1111111111111111111000000000000000000000000000000000000000000000111111
|
||||||
|
1111110000000000000000000000000000000000000000000000000001111111111110
|
||||||
|
0000000000000000000111111111111111111100000000000000000000000000000000
|
||||||
|
0000000000000011111111111100000000000000000000000000000000000000000000
|
||||||
|
0000000111111111111000000000000000000000111111111111111110000000000000
|
||||||
|
0000000000000000000000000000000000111111111111000000000000000000000000
|
||||||
|
0000000000000000000000000001111111111110000000000000000000001111111111
|
||||||
|
1111111000000000000000000000000000000000000000000000001111111111110000
|
||||||
|
0000000000000000000000000000000000000000000000011111111111100000000000
|
||||||
|
0000000000111111111111111000000000000000000000000000000000000000000000
|
||||||
|
0000111111111111000000000000000000000000000000000000000000000000000111
|
||||||
|
1111111110000000000000000000001111111111111000000000000000000000000000
|
||||||
|
0000000000000000000000001111111111110000000000000000000000000000000000
|
||||||
|
0000000000000000011111111111100000000000000000000001111111111110000000
|
||||||
|
0000000000000000000000000000000000000000000011111111111100000000000000
|
||||||
|
0000000000000000000000000000000000000111111111111000000000000000000000
|
||||||
|
0011111111110000000000000000000000000000000000000000000000000000111111
|
||||||
|
1111110000000000000000000000000000000000000000000000000001111111111110
|
||||||
|
0000000000000000000000011111110000001011111111111110100000000000000000
|
||||||
|
0000000000000011111111111100000000000000000000000000000000000000000000
|
||||||
|
0000000111111111111000000000000000000000000000101010111111111111111111
|
||||||
|
1111111111000000000000000000000000111111111111000000000000000000000000
|
||||||
|
0000000000000000000000000001111111111110000000000000000000000000001111
|
||||||
|
1111111111111111111111111111111100000000000000000000001111111111110000
|
||||||
|
0000000000000000000000000000000000000000000000011111111111100000000000
|
||||||
|
0000000101111111111111111111111111111111111111111111100000000000000000
|
||||||
|
0000111111111111000000000000000000000000000000000000000000000000000111
|
||||||
|
1111111110000000000000101111111111111111111111111111111111111111111111
|
||||||
|
1110000000000000000000001111111111110000000000000000000000000000000000
|
||||||
|
0000000000000000011111111111100000101111111111111111111111111111111111
|
||||||
|
1111111111111111111111110000000000000000000011111111111100000000000000
|
||||||
|
0000000000000000000000000000000000000111111111111000111111111111111111
|
||||||
|
1111111111111111111111111111111111111111111100000000000000000000111111
|
||||||
|
1111110000000000000000000000000000000000000000000000000001111111111110
|
||||||
|
0011111111111111111111111111111111111111111111111111111111111111000000
|
||||||
|
0000000000000011111111111100000000000000000000000000000000000000000000
|
||||||
|
0000000111111111111111111111111111111111111111111111111111111111111111
|
||||||
|
1111111111111100000000000000000000111111111111000000000000000000000000
|
||||||
|
0000000000000000000000000001111111111111111111111111111111111111111111
|
||||||
|
1111111111111111111111111111111110000000000000000000011111111111110000
|
||||||
|
0000000000000000000000000000000000000000000000011111111111111111111111
|
||||||
|
1111111111111111111111111111111111111111111111111111100000000000000000
|
||||||
|
0001111111111110000000000000000000000000000000000000000000000000000111
|
||||||
|
1111111111111111111111111111111111111111111111111111111111111111111111
|
||||||
|
1100000000000000000000011111111111100000000000000000000000000000000000
|
||||||
|
0000000000000000011111111111111111111111111111111111111111111111111111
|
||||||
|
1111111111111111111100000000000000000000000111111111111000000000000000
|
||||||
|
0000000000000000000000000000000000000111111111111111111111111111111111
|
||||||
|
1111111111111111111111111111111111111000000000000000000000000011111111
|
||||||
|
1111100000000000000000000000000000000000000000000000000001111111111111
|
||||||
|
1111111111111111111111111111111111111111111111111111110000000000000000
|
||||||
|
0000000000011111111111110000000000000000000000000000000000000000000000
|
||||||
|
0000000111111111111111111111111111110100000000111111111111111111111111
|
||||||
|
1100000000000000000000000000000111111111111100000000000000000000000000
|
||||||
|
0000000000000000000000000001111111111111111111111111010000000000011111
|
||||||
|
1111111111111111111000000000000000000000000000000111111111111111000000
|
||||||
|
0000000000000000000000000000000000000000000000111111111111111111111000
|
||||||
|
0000000000000111111111111111111111111000000000000000000000000000000001
|
||||||
|
1111111111111000000000000000000000000000000000000000000000000000001111
|
||||||
|
1111111111111110000000000000000111111111111111111111111000000000000000
|
||||||
|
0000000000000000011111111111111110000000000000000000000000000000000000
|
||||||
|
0000000000000000111111111111111100000000000000000111111111111111111111
|
||||||
|
1111000000000000000000000000000000011111111111111111000000000000000000
|
||||||
|
0000000000000000000000000000000000001111111111111110000000000000000011
|
||||||
|
1111111111111111111110000000000000000000000000000000001111111111111111
|
||||||
|
1000000000000000000000000000000000000000000000000000000001111111111110
|
||||||
|
0000000000000000001111111111111111111101000000000000000000000000000000
|
||||||
|
0001111111111111111110000000000000000000000000000000000000000000000000
|
||||||
|
0000000111111111110000000000000000000111111111111111111110000000000000
|
||||||
|
0000000000000000000001111111111111111111000000000000000000000000000000
|
||||||
|
0000000000000000000000000000111111111000000000000000000011111111111111
|
||||||
|
1111110000000000000000000000000000000000011111111111111111100000000000
|
||||||
|
0000000000000000000000000000000000000000000000000111111100000000000000
|
||||||
|
0000001111111111111111100000000000000000000000000000000000011111111111
|
||||||
|
1111111100000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0010100000000000000000000011111111111111110000000000000000000000000000
|
||||||
|
0000000011111111111111111110000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000111111111111111000000000
|
||||||
|
0000000000000000000000000011111111111111111110000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000001111
|
||||||
|
1111111110000000000000000000000000000000000000111111111111111111100000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000111111111111000000000000000000000000000000000000011111
|
||||||
|
1111111111110000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000001111111111110000000000000000000000
|
||||||
|
0000000000000011111111111111111000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000011111111111100
|
||||||
|
0000000000000000000000000000000001111111111111111100000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000001111111111110000000000000000000000000000000000111111111111111111
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000001111111111100000000000000000000000000000000
|
||||||
|
1111111111111111110000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000011111111111100000000000
|
||||||
|
0000000000000000000111111111111111111000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000111
|
||||||
|
1111111110000000000000000000000000000111111111111111111100000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000011111111111110000000000000000000000000011111111111111
|
||||||
|
1111000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000011111111111100000000000000000000
|
||||||
|
0000111111111111111111110000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000111111111111
|
||||||
|
1000000000000000000000011111111111111111110000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000011111111111110000000000000000000011111111111111111111000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000011111111111110000000000000000000111111111
|
||||||
|
1111111111100000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000111111111111100000000
|
||||||
|
0000000001111111111111111111100000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
1111111111110000000000000000111111111111111111110000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000011111111111110000000000000011111111111111111110000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000011111111111100000000000001111
|
||||||
|
1111111111111110000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000111111111
|
||||||
|
1111000000000001111111111111111110000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000011111111111110000000000111111111111111111000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000011111111111110000000011111111111111111
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000111111111111110000
|
||||||
|
0011111111111111111100000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0001111111111111000011111111111111111100000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000001111111111111100111111111111111110000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000011111111111111111111111111
|
||||||
|
1111100000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000011111
|
||||||
|
1111111111111111111111110000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000001111111111111111111111111111100000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000001111111111111111111111111110000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000011111111111111
|
||||||
|
1111111111110000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000111111111111111111111110000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000101000000101000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000111111111111111111111000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000011111100111111000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000111111111111111111110
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000001111111
|
||||||
|
1111111110000000000000000000000000000000000000000000000000000000000000
|
||||||
|
1111111111111111100000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000001111111111111111110000000000000000000000000000000000000000
|
||||||
|
0000000000000000000001111111111111111000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000011111111111111111100000000000000000000
|
||||||
|
0000000000000000000000000000000000000000011111111111111000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000001111111111111111111
|
||||||
|
1000000000000000000000000000000000000000000000000000000000000001111111
|
||||||
|
1111000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0111111111111111111100000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000001111101000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000111111111111111111000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00000000000000000000000000000000000000000011111111
|
Binary file not shown.
Binary file not shown.
|
@ -1,6 +1,6 @@
|
||||||
! Copyright (C) 2010 Erik Charlebois.
|
! Copyright (C) 2010 Erik Charlebois.
|
||||||
! See http:// factorcode.org/license.txt for BSD license.
|
! See http:// factorcode.org/license.txt for BSD license.
|
||||||
USING: alien.c-types alien.syntax classes.struct kernel literals math unix.types ;
|
USING: alien.c-types alien.syntax classes.struct kernel literals math ;
|
||||||
IN: macho
|
IN: macho
|
||||||
|
|
||||||
TYPEDEF: int integer_t
|
TYPEDEF: int integer_t
|
||||||
|
@ -21,26 +21,26 @@ CONSTANT: VM_PROT_WANTS_COPY HEX: 10
|
||||||
|
|
||||||
! loader.h
|
! loader.h
|
||||||
STRUCT: mach_header
|
STRUCT: mach_header
|
||||||
{ magic uint32_t }
|
{ magic uint }
|
||||||
{ cputype cpu_type_t }
|
{ cputype cpu_type_t }
|
||||||
{ cpusubtype cpu_subtype_t }
|
{ cpusubtype cpu_subtype_t }
|
||||||
{ filetype uint32_t }
|
{ filetype uint }
|
||||||
{ ncmds uint32_t }
|
{ ncmds uint }
|
||||||
{ sizeofcmds uint32_t }
|
{ sizeofcmds uint }
|
||||||
{ flags uint32_t } ;
|
{ flags uint } ;
|
||||||
|
|
||||||
CONSTANT: MH_MAGIC HEX: feedface
|
CONSTANT: MH_MAGIC HEX: feedface
|
||||||
CONSTANT: MH_CIGAM HEX: cefaedfe
|
CONSTANT: MH_CIGAM HEX: cefaedfe
|
||||||
|
|
||||||
STRUCT: mach_header_64
|
STRUCT: mach_header_64
|
||||||
{ magic uint32_t }
|
{ magic uint }
|
||||||
{ cputype cpu_type_t }
|
{ cputype cpu_type_t }
|
||||||
{ cpusubtype cpu_subtype_t }
|
{ cpusubtype cpu_subtype_t }
|
||||||
{ filetype uint32_t }
|
{ filetype uint }
|
||||||
{ ncmds uint32_t }
|
{ ncmds uint }
|
||||||
{ sizeofcmds uint32_t }
|
{ sizeofcmds uint }
|
||||||
{ flags uint32_t }
|
{ flags uint }
|
||||||
{ reserved uint32_t } ;
|
{ reserved uint } ;
|
||||||
|
|
||||||
CONSTANT: MH_MAGIC_64 HEX: feedfacf
|
CONSTANT: MH_MAGIC_64 HEX: feedfacf
|
||||||
CONSTANT: MH_CIGAM_64 HEX: cffaedfe
|
CONSTANT: MH_CIGAM_64 HEX: cffaedfe
|
||||||
|
@ -82,8 +82,8 @@ CONSTANT: MH_NO_REEXPORTED_DYLIBS HEX: 100000
|
||||||
CONSTANT: MH_PIE HEX: 200000
|
CONSTANT: MH_PIE HEX: 200000
|
||||||
|
|
||||||
STRUCT: load_command
|
STRUCT: load_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t } ;
|
{ cmdsize uint } ;
|
||||||
|
|
||||||
CONSTANT: LC_REQ_DYLD HEX: 80000000
|
CONSTANT: LC_REQ_DYLD HEX: 80000000
|
||||||
|
|
||||||
|
@ -124,34 +124,34 @@ CONSTANT: LC_DYLD_INFO HEX: 22
|
||||||
CONSTANT: LC_DYLD_INFO_ONLY HEX: 80000022
|
CONSTANT: LC_DYLD_INFO_ONLY HEX: 80000022
|
||||||
|
|
||||||
UNION-STRUCT: lc_str
|
UNION-STRUCT: lc_str
|
||||||
{ offset uint32_t }
|
{ offset uint }
|
||||||
{ ptr char* } ;
|
{ ptr char* } ;
|
||||||
|
|
||||||
STRUCT: segment_command
|
STRUCT: segment_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ segname char[16] }
|
{ segname char[16] }
|
||||||
{ vmaddr uint32_t }
|
{ vmaddr uint }
|
||||||
{ vmsize uint32_t }
|
{ vmsize uint }
|
||||||
{ fileoff uint32_t }
|
{ fileoff uint }
|
||||||
{ filesize uint32_t }
|
{ filesize uint }
|
||||||
{ maxprot vm_prot_t }
|
{ maxprot vm_prot_t }
|
||||||
{ initprot vm_prot_t }
|
{ initprot vm_prot_t }
|
||||||
{ nsects uint32_t }
|
{ nsects uint }
|
||||||
{ flags uint32_t } ;
|
{ flags uint } ;
|
||||||
|
|
||||||
STRUCT: segment_command_64
|
STRUCT: segment_command_64
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ segname char[16] }
|
{ segname char[16] }
|
||||||
{ vmaddr uint64_t }
|
{ vmaddr ulonglong }
|
||||||
{ vmsize uint64_t }
|
{ vmsize ulonglong }
|
||||||
{ fileoff uint64_t }
|
{ fileoff ulonglong }
|
||||||
{ filesize uint64_t }
|
{ filesize ulonglong }
|
||||||
{ maxprot vm_prot_t }
|
{ maxprot vm_prot_t }
|
||||||
{ initprot vm_prot_t }
|
{ initprot vm_prot_t }
|
||||||
{ nsects uint32_t }
|
{ nsects uint }
|
||||||
{ flags uint32_t } ;
|
{ flags uint } ;
|
||||||
|
|
||||||
CONSTANT: SG_HIGHVM HEX: 1
|
CONSTANT: SG_HIGHVM HEX: 1
|
||||||
CONSTANT: SG_FVMLIB HEX: 2
|
CONSTANT: SG_FVMLIB HEX: 2
|
||||||
|
@ -161,29 +161,29 @@ CONSTANT: SG_PROTECTED_VERSION_1 HEX: 8
|
||||||
STRUCT: section
|
STRUCT: section
|
||||||
{ sectname char[16] }
|
{ sectname char[16] }
|
||||||
{ segname char[16] }
|
{ segname char[16] }
|
||||||
{ addr uint32_t }
|
{ addr uint }
|
||||||
{ size uint32_t }
|
{ size uint }
|
||||||
{ offset uint32_t }
|
{ offset uint }
|
||||||
{ align uint32_t }
|
{ align uint }
|
||||||
{ reloff uint32_t }
|
{ reloff uint }
|
||||||
{ nreloc uint32_t }
|
{ nreloc uint }
|
||||||
{ flags uint32_t }
|
{ flags uint }
|
||||||
{ reserved1 uint32_t }
|
{ reserved1 uint }
|
||||||
{ reserved2 uint32_t } ;
|
{ reserved2 uint } ;
|
||||||
|
|
||||||
STRUCT: section_64
|
STRUCT: section_64
|
||||||
{ sectname char[16] }
|
{ sectname char[16] }
|
||||||
{ segname char[16] }
|
{ segname char[16] }
|
||||||
{ addr uint64_t }
|
{ addr ulonglong }
|
||||||
{ size uint64_t }
|
{ size ulonglong }
|
||||||
{ offset uint32_t }
|
{ offset uint }
|
||||||
{ align uint32_t }
|
{ align uint }
|
||||||
{ reloff uint32_t }
|
{ reloff uint }
|
||||||
{ nreloc uint32_t }
|
{ nreloc uint }
|
||||||
{ flags uint32_t }
|
{ flags uint }
|
||||||
{ reserved1 uint32_t }
|
{ reserved1 uint }
|
||||||
{ reserved2 uint32_t }
|
{ reserved2 uint }
|
||||||
{ reserved3 uint32_t } ;
|
{ reserved3 uint } ;
|
||||||
|
|
||||||
CONSTANT: SECTION_TYPE HEX: 000000ff
|
CONSTANT: SECTION_TYPE HEX: 000000ff
|
||||||
CONSTANT: SECTION_ATTRIBUTES HEX: ffffff00
|
CONSTANT: SECTION_ATTRIBUTES HEX: ffffff00
|
||||||
|
@ -242,205 +242,205 @@ CONSTANT: SEG_IMPORT "__IMPORT"
|
||||||
|
|
||||||
STRUCT: fvmlib
|
STRUCT: fvmlib
|
||||||
{ name lc_str }
|
{ name lc_str }
|
||||||
{ minor_version uint32_t }
|
{ minor_version uint }
|
||||||
{ header_addr uint32_t } ;
|
{ header_addr uint } ;
|
||||||
|
|
||||||
STRUCT: fvmlib_command
|
STRUCT: fvmlib_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ fvmlib fvmlib } ;
|
{ fvmlib fvmlib } ;
|
||||||
|
|
||||||
STRUCT: dylib
|
STRUCT: dylib
|
||||||
{ name lc_str }
|
{ name lc_str }
|
||||||
{ timestamp uint32_t }
|
{ timestamp uint }
|
||||||
{ current_version uint32_t }
|
{ current_version uint }
|
||||||
{ compatibility_version uint32_t } ;
|
{ compatibility_version uint } ;
|
||||||
|
|
||||||
STRUCT: dylib_command
|
STRUCT: dylib_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ dylib dylib } ;
|
{ dylib dylib } ;
|
||||||
|
|
||||||
STRUCT: sub_framework_command
|
STRUCT: sub_framework_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ umbrella lc_str } ;
|
{ umbrella lc_str } ;
|
||||||
|
|
||||||
STRUCT: sub_client_command
|
STRUCT: sub_client_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ client lc_str } ;
|
{ client lc_str } ;
|
||||||
|
|
||||||
STRUCT: sub_umbrella_command
|
STRUCT: sub_umbrella_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ sub_umbrella lc_str } ;
|
{ sub_umbrella lc_str } ;
|
||||||
|
|
||||||
STRUCT: sub_library_command
|
STRUCT: sub_library_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ sub_library lc_str } ;
|
{ sub_library lc_str } ;
|
||||||
|
|
||||||
STRUCT: prebound_dylib_command
|
STRUCT: prebound_dylib_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ name lc_str }
|
{ name lc_str }
|
||||||
{ nmodules uint32_t }
|
{ nmodules uint }
|
||||||
{ linked_modules lc_str } ;
|
{ linked_modules lc_str } ;
|
||||||
|
|
||||||
STRUCT: dylinker_command
|
STRUCT: dylinker_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ name lc_str } ;
|
{ name lc_str } ;
|
||||||
|
|
||||||
STRUCT: thread_command
|
STRUCT: thread_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t } ;
|
{ cmdsize uint } ;
|
||||||
|
|
||||||
STRUCT: routines_command
|
STRUCT: routines_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ init_address uint32_t }
|
{ init_address uint }
|
||||||
{ init_module uint32_t }
|
{ init_module uint }
|
||||||
{ reserved1 uint32_t }
|
{ reserved1 uint }
|
||||||
{ reserved2 uint32_t }
|
{ reserved2 uint }
|
||||||
{ reserved3 uint32_t }
|
{ reserved3 uint }
|
||||||
{ reserved4 uint32_t }
|
{ reserved4 uint }
|
||||||
{ reserved5 uint32_t }
|
{ reserved5 uint }
|
||||||
{ reserved6 uint32_t } ;
|
{ reserved6 uint } ;
|
||||||
|
|
||||||
STRUCT: routines_command_64
|
STRUCT: routines_command_64
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ init_address uint64_t }
|
{ init_address ulonglong }
|
||||||
{ init_module uint64_t }
|
{ init_module ulonglong }
|
||||||
{ reserved1 uint64_t }
|
{ reserved1 ulonglong }
|
||||||
{ reserved2 uint64_t }
|
{ reserved2 ulonglong }
|
||||||
{ reserved3 uint64_t }
|
{ reserved3 ulonglong }
|
||||||
{ reserved4 uint64_t }
|
{ reserved4 ulonglong }
|
||||||
{ reserved5 uint64_t }
|
{ reserved5 ulonglong }
|
||||||
{ reserved6 uint64_t } ;
|
{ reserved6 ulonglong } ;
|
||||||
|
|
||||||
STRUCT: symtab_command
|
STRUCT: symtab_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ symoff uint32_t }
|
{ symoff uint }
|
||||||
{ nsyms uint32_t }
|
{ nsyms uint }
|
||||||
{ stroff uint32_t }
|
{ stroff uint }
|
||||||
{ strsize uint32_t } ;
|
{ strsize uint } ;
|
||||||
|
|
||||||
STRUCT: dysymtab_command
|
STRUCT: dysymtab_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ ilocalsym uint32_t }
|
{ ilocalsym uint }
|
||||||
{ nlocalsym uint32_t }
|
{ nlocalsym uint }
|
||||||
{ iextdefsym uint32_t }
|
{ iextdefsym uint }
|
||||||
{ nextdefsym uint32_t }
|
{ nextdefsym uint }
|
||||||
{ iundefsym uint32_t }
|
{ iundefsym uint }
|
||||||
{ nundefsym uint32_t }
|
{ nundefsym uint }
|
||||||
{ tocoff uint32_t }
|
{ tocoff uint }
|
||||||
{ ntoc uint32_t }
|
{ ntoc uint }
|
||||||
{ modtaboff uint32_t }
|
{ modtaboff uint }
|
||||||
{ nmodtab uint32_t }
|
{ nmodtab uint }
|
||||||
{ extrefsymoff uint32_t }
|
{ extrefsymoff uint }
|
||||||
{ nextrefsyms uint32_t }
|
{ nextrefsyms uint }
|
||||||
{ indirectsymoff uint32_t }
|
{ indirectsymoff uint }
|
||||||
{ nindirectsyms uint32_t }
|
{ nindirectsyms uint }
|
||||||
{ extreloff uint32_t }
|
{ extreloff uint }
|
||||||
{ nextrel uint32_t }
|
{ nextrel uint }
|
||||||
{ locreloff uint32_t }
|
{ locreloff uint }
|
||||||
{ nlocrel uint32_t } ;
|
{ nlocrel uint } ;
|
||||||
|
|
||||||
CONSTANT: INDIRECT_SYMBOL_LOCAL HEX: 80000000
|
CONSTANT: INDIRECT_SYMBOL_LOCAL HEX: 80000000
|
||||||
CONSTANT: INDIRECT_SYMBOL_ABS HEX: 40000000
|
CONSTANT: INDIRECT_SYMBOL_ABS HEX: 40000000
|
||||||
|
|
||||||
STRUCT: dylib_table_of_contents
|
STRUCT: dylib_table_of_contents
|
||||||
{ symbol_index uint32_t }
|
{ symbol_index uint }
|
||||||
{ module_index uint32_t } ;
|
{ module_index uint } ;
|
||||||
|
|
||||||
STRUCT: dylib_module
|
STRUCT: dylib_module
|
||||||
{ module_name uint32_t }
|
{ module_name uint }
|
||||||
{ iextdefsym uint32_t }
|
{ iextdefsym uint }
|
||||||
{ nextdefsym uint32_t }
|
{ nextdefsym uint }
|
||||||
{ irefsym uint32_t }
|
{ irefsym uint }
|
||||||
{ nrefsym uint32_t }
|
{ nrefsym uint }
|
||||||
{ ilocalsym uint32_t }
|
{ ilocalsym uint }
|
||||||
{ nlocalsym uint32_t }
|
{ nlocalsym uint }
|
||||||
{ iextrel uint32_t }
|
{ iextrel uint }
|
||||||
{ nextrel uint32_t }
|
{ nextrel uint }
|
||||||
{ iinit_iterm uint32_t }
|
{ iinit_iterm uint }
|
||||||
{ ninit_nterm uint32_t }
|
{ ninit_nterm uint }
|
||||||
{ objc_module_info_addr uint32_t }
|
{ objc_module_info_addr uint }
|
||||||
{ objc_module_info_size uint32_t } ;
|
{ objc_module_info_size uint } ;
|
||||||
|
|
||||||
STRUCT: dylib_module_64
|
STRUCT: dylib_module_64
|
||||||
{ module_name uint32_t }
|
{ module_name uint }
|
||||||
{ iextdefsym uint32_t }
|
{ iextdefsym uint }
|
||||||
{ nextdefsym uint32_t }
|
{ nextdefsym uint }
|
||||||
{ irefsym uint32_t }
|
{ irefsym uint }
|
||||||
{ nrefsym uint32_t }
|
{ nrefsym uint }
|
||||||
{ ilocalsym uint32_t }
|
{ ilocalsym uint }
|
||||||
{ nlocalsym uint32_t }
|
{ nlocalsym uint }
|
||||||
{ iextrel uint32_t }
|
{ iextrel uint }
|
||||||
{ nextrel uint32_t }
|
{ nextrel uint }
|
||||||
{ iinit_iterm uint32_t }
|
{ iinit_iterm uint }
|
||||||
{ ninit_nterm uint32_t }
|
{ ninit_nterm uint }
|
||||||
{ objc_module_info_size uint32_t }
|
{ objc_module_info_size uint }
|
||||||
{ objc_module_info_addr uint64_t } ;
|
{ objc_module_info_addr ulonglong } ;
|
||||||
|
|
||||||
STRUCT: dylib_reference
|
STRUCT: dylib_reference
|
||||||
{ isym_flags uint32_t } ;
|
{ isym_flags uint } ;
|
||||||
|
|
||||||
STRUCT: twolevel_hints_command
|
STRUCT: twolevel_hints_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ offset uint32_t }
|
{ offset uint }
|
||||||
{ nhints uint32_t } ;
|
{ nhints uint } ;
|
||||||
|
|
||||||
STRUCT: twolevel_hint
|
STRUCT: twolevel_hint
|
||||||
{ isub_image_itoc uint32_t } ;
|
{ isub_image_itoc uint } ;
|
||||||
|
|
||||||
STRUCT: prebind_cksum_command
|
STRUCT: prebind_cksum_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ cksum uint32_t } ;
|
{ cksum uint } ;
|
||||||
|
|
||||||
STRUCT: uuid_command
|
STRUCT: uuid_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ uuid uint8_t[16] } ;
|
{ uuid uchar[16] } ;
|
||||||
|
|
||||||
STRUCT: rpath_command
|
STRUCT: rpath_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ path lc_str } ;
|
{ path lc_str } ;
|
||||||
|
|
||||||
STRUCT: linkedit_data_command
|
STRUCT: linkedit_data_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ dataoff uint32_t }
|
{ dataoff uint }
|
||||||
{ datasize uint32_t } ;
|
{ datasize uint } ;
|
||||||
|
|
||||||
STRUCT: encryption_info_command
|
STRUCT: encryption_info_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ cryptoff uint32_t }
|
{ cryptoff uint }
|
||||||
{ cryptsize uint32_t }
|
{ cryptsize uint }
|
||||||
{ cryptid uint32_t } ;
|
{ cryptid uint } ;
|
||||||
|
|
||||||
STRUCT: dyld_info_command
|
STRUCT: dyld_info_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ rebase_off uint32_t }
|
{ rebase_off uint }
|
||||||
{ rebase_size uint32_t }
|
{ rebase_size uint }
|
||||||
{ bind_off uint32_t }
|
{ bind_off uint }
|
||||||
{ bind_size uint32_t }
|
{ bind_size uint }
|
||||||
{ weak_bind_off uint32_t }
|
{ weak_bind_off uint }
|
||||||
{ weak_bind_size uint32_t }
|
{ weak_bind_size uint }
|
||||||
{ lazy_bind_off uint32_t }
|
{ lazy_bind_off uint }
|
||||||
{ lazy_bind_size uint32_t }
|
{ lazy_bind_size uint }
|
||||||
{ export_off uint32_t }
|
{ export_off uint }
|
||||||
{ export_size uint32_t } ;
|
{ export_size uint } ;
|
||||||
|
|
||||||
CONSTANT: REBASE_TYPE_POINTER 1
|
CONSTANT: REBASE_TYPE_POINTER 1
|
||||||
CONSTANT: REBASE_TYPE_TEXT_ABSOLUTE32 2
|
CONSTANT: REBASE_TYPE_TEXT_ABSOLUTE32 2
|
||||||
|
@ -493,20 +493,20 @@ CONSTANT: EXPORT_SYMBOL_FLAGS_INDIRECT_DEFINITION HEX: 08
|
||||||
CONSTANT: EXPORT_SYMBOL_FLAGS_HAS_SPECIALIZATIONS HEX: 10
|
CONSTANT: EXPORT_SYMBOL_FLAGS_HAS_SPECIALIZATIONS HEX: 10
|
||||||
|
|
||||||
STRUCT: symseg_command
|
STRUCT: symseg_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ offset uint32_t }
|
{ offset uint }
|
||||||
{ size uint32_t } ;
|
{ size uint } ;
|
||||||
|
|
||||||
STRUCT: ident_command
|
STRUCT: ident_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t } ;
|
{ cmdsize uint } ;
|
||||||
|
|
||||||
STRUCT: fvmfile_command
|
STRUCT: fvmfile_command
|
||||||
{ cmd uint32_t }
|
{ cmd uint }
|
||||||
{ cmdsize uint32_t }
|
{ cmdsize uint }
|
||||||
{ name lc_str }
|
{ name lc_str }
|
||||||
{ header_addr uint32_t } ;
|
{ header_addr uint } ;
|
||||||
|
|
||||||
! machine.h
|
! machine.h
|
||||||
CONSTANT: CPU_STATE_MAX 4
|
CONSTANT: CPU_STATE_MAX 4
|
||||||
|
@ -670,30 +670,30 @@ CONSTANT: FAT_MAGIC HEX: cafebabe
|
||||||
CONSTANT: FAT_CIGAM HEX: bebafeca
|
CONSTANT: FAT_CIGAM HEX: bebafeca
|
||||||
|
|
||||||
STRUCT: fat_header
|
STRUCT: fat_header
|
||||||
{ magic uint32_t }
|
{ magic uint }
|
||||||
{ nfat_arch uint32_t } ;
|
{ nfat_arch uint } ;
|
||||||
|
|
||||||
STRUCT: fat_arch
|
STRUCT: fat_arch
|
||||||
{ cputype cpu_type_t }
|
{ cputype cpu_type_t }
|
||||||
{ cpusubtype cpu_subtype_t }
|
{ cpusubtype cpu_subtype_t }
|
||||||
{ offset uint32_t }
|
{ offset uint }
|
||||||
{ size uint32_t }
|
{ size uint }
|
||||||
{ align uint32_t } ;
|
{ align uint } ;
|
||||||
|
|
||||||
! nlist.h
|
! nlist.h
|
||||||
STRUCT: nlist
|
STRUCT: nlist
|
||||||
{ n_strx int32_t }
|
{ n_strx int }
|
||||||
{ n_type uint8_t }
|
{ n_type uchar }
|
||||||
{ n_sect uint8_t }
|
{ n_sect uchar }
|
||||||
{ n_desc int16_t }
|
{ n_desc short }
|
||||||
{ n_value uint32_t } ;
|
{ n_value uint } ;
|
||||||
|
|
||||||
STRUCT: nlist_64
|
STRUCT: nlist_64
|
||||||
{ n_strx uint32_t }
|
{ n_strx uint }
|
||||||
{ n_type uint8_t }
|
{ n_type uchar }
|
||||||
{ n_sect uint8_t }
|
{ n_sect uchar }
|
||||||
{ n_desc uint16_t }
|
{ n_desc ushort }
|
||||||
{ n_value uint64_t } ;
|
{ n_value ulonglong } ;
|
||||||
|
|
||||||
CONSTANT: N_STAB HEX: e0
|
CONSTANT: N_STAB HEX: e0
|
||||||
CONSTANT: N_PEXT HEX: 10
|
CONSTANT: N_PEXT HEX: 10
|
||||||
|
@ -750,24 +750,24 @@ CONSTANT: SYMDEF "__.SYMDEF"
|
||||||
CONSTANT: SYMDEF_SORTED "__.SYMDEF SORTED"
|
CONSTANT: SYMDEF_SORTED "__.SYMDEF SORTED"
|
||||||
|
|
||||||
STRUCT: ranlib
|
STRUCT: ranlib
|
||||||
{ ran_strx uint32_t }
|
{ ran_strx uint }
|
||||||
{ ran_off uint32_t } ;
|
{ ran_off uint } ;
|
||||||
|
|
||||||
! reloc.h
|
! reloc.h
|
||||||
STRUCT: relocation_info
|
STRUCT: relocation_info
|
||||||
{ r_address int32_t }
|
{ r_address int }
|
||||||
{ r_symbolnum_pcrel_length_extern_type uint32_t } ;
|
{ r_symbolnum_pcrel_length_extern_type uint } ;
|
||||||
|
|
||||||
CONSTANT: R_ABS 0
|
CONSTANT: R_ABS 0
|
||||||
CONSTANT: R_SCATTERED HEX: 80000000
|
CONSTANT: R_SCATTERED HEX: 80000000
|
||||||
|
|
||||||
STRUCT: scattered_relocation_info_big_endian
|
STRUCT: scattered_relocation_info_big_endian
|
||||||
{ r_scattered_pcrel_length_type_address uint32_t }
|
{ r_scattered_pcrel_length_type_address uint }
|
||||||
{ r_value int32_t } ;
|
{ r_value int } ;
|
||||||
|
|
||||||
STRUCT: scattered_relocation_info_little_endian
|
STRUCT: scattered_relocation_info_little_endian
|
||||||
{ r_address_type_length_pcrel_scattered uint32_t }
|
{ r_address_type_length_pcrel_scattered uint }
|
||||||
{ r_value int32_t } ;
|
{ r_value int } ;
|
||||||
|
|
||||||
C-ENUM: reloc_type_generic
|
C-ENUM: reloc_type_generic
|
||||||
GENERIC_RELOC_VANILLA
|
GENERIC_RELOC_VANILLA
|
||||||
|
|
Loading…
Reference in New Issue