1 ! Copyright (C) 2010 Erik Charlebois.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: accessors alien http.download io.files.temp
4 io.streams.string kernel literals macho multiline sequences
5 system tools.test urls ;
8 STRING: validation-output
9 0000000100000f1c __stub_helper stub helpers
10 0000000100001040 __program_vars _pvars
11 0000000100001068 __data _NXArgc
12 0000000100001070 __data _NXArgv
13 0000000100001080 __data ___progname
14 0000000100000000 __mh_execute_header
15 0000000100001078 __data _environ
16 0000000100000ef8 __text _main
17 0000000100000ebc __text start
18 0000000000000000 ___gxx_personality_v0
19 0000000000000000 _exit
20 0000000000000000 _printf
21 0000000000000000 dyld_stub_binder
26 URL" https://downloads.factorcode.org/misc/a.macho"
27 "a.macho" cache-file download-to ;
29 : a2.macho ( -- path )
30 URL" https://downloads.factorcode.org/misc/a2.macho"
31 "a2.macho" cache-file download-to ;
34 { $ validation-output }
35 [ [ a.macho macho-nm ] with-string-writer ]
40 >c-ptr fat-binary-members first data>> >c-ptr macho-header 64-bit?
45 ! Throw an exception if the struct is not defined/handled
47 { } [ vm-path dylib-exports drop ] unit-test