4 yaml2obj takes a YAML description of an object file and converts it to a binary
11 Outputs the binary to stdout.
16 Here's a sample COFF file.
21 Machine: IMAGE_FILE_MACHINE_I386 # (0x14C)
25 Characteristics: [ IMAGE_SCN_CNT_CODE
26 , IMAGE_SCN_ALIGN_16BYTES
27 , IMAGE_SCN_MEM_EXECUTE
31 "\x83\xEC\x0C\xC7\x44\x24\x08\x00\x00\x00\x00\xC7\x04\x24\x00\x00\x00\x00\xE8\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x8B\x44\x24\x08\x83\xC4\x0C\xC3" # |....D$.......$...............D$.....|
37 SimpleType: IMAGE_SYM_TYPE_NULL # (0)
38 ComplexType: IMAGE_SYM_DTYPE_NULL # (0)
39 StorageClass: IMAGE_SYM_CLASS_STATIC # (3)
42 "\x24\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00" # |$.................|
47 SimpleType: IMAGE_SYM_TYPE_NULL # (0)
48 ComplexType: IMAGE_SYM_DTYPE_NULL # (0)
49 StorageClass: IMAGE_SYM_CLASS_EXTERNAL # (2)
51 Here's a simplified Kwalify_ schema with an extension to allow alternate types.
53 .. _Kwalify: http://www.kuwata-lab.com/kwalify/ruby/users-guide.html
62 Machine: [ {type: str, enum:
63 [ IMAGE_FILE_MACHINE_UNKNOWN
64 , IMAGE_FILE_MACHINE_AM33
65 , IMAGE_FILE_MACHINE_AMD64
66 , IMAGE_FILE_MACHINE_ARM
67 , IMAGE_FILE_MACHINE_ARMNT
68 , IMAGE_FILE_MACHINE_ARM64
69 , IMAGE_FILE_MACHINE_EBC
70 , IMAGE_FILE_MACHINE_I386
71 , IMAGE_FILE_MACHINE_IA64
72 , IMAGE_FILE_MACHINE_M32R
73 , IMAGE_FILE_MACHINE_MIPS16
74 , IMAGE_FILE_MACHINE_MIPSFPU
75 , IMAGE_FILE_MACHINE_MIPSFPU16
76 , IMAGE_FILE_MACHINE_POWERPC
77 , IMAGE_FILE_MACHINE_POWERPCFP
78 , IMAGE_FILE_MACHINE_R4000
79 , IMAGE_FILE_MACHINE_SH3
80 , IMAGE_FILE_MACHINE_SH3DSP
81 , IMAGE_FILE_MACHINE_SH4
82 , IMAGE_FILE_MACHINE_SH5
83 , IMAGE_FILE_MACHINE_THUMB
84 , IMAGE_FILE_MACHINE_WCEMIPSV2
92 enum: [ IMAGE_FILE_RELOCS_STRIPPED
93 , IMAGE_FILE_EXECUTABLE_IMAGE
94 , IMAGE_FILE_LINE_NUMS_STRIPPED
95 , IMAGE_FILE_LOCAL_SYMS_STRIPPED
96 , IMAGE_FILE_AGGRESSIVE_WS_TRIM
97 , IMAGE_FILE_LARGE_ADDRESS_AWARE
98 , IMAGE_FILE_BYTES_REVERSED_LO
99 , IMAGE_FILE_32BIT_MACHINE
100 , IMAGE_FILE_DEBUG_STRIPPED
101 , IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP
102 , IMAGE_FILE_NET_RUN_FROM_SWAP
105 , IMAGE_FILE_UP_SYSTEM_ONLY
106 , IMAGE_FILE_BYTES_REVERSED_HI
119 enum: [ IMAGE_SCN_TYPE_NO_PAD
121 , IMAGE_SCN_CNT_INITIALIZED_DATA
122 , IMAGE_SCN_CNT_UNINITIALIZED_DATA
123 , IMAGE_SCN_LNK_OTHER
125 , IMAGE_SCN_LNK_REMOVE
126 , IMAGE_SCN_LNK_COMDAT
128 , IMAGE_SCN_MEM_PURGEABLE
129 , IMAGE_SCN_MEM_16BIT
130 , IMAGE_SCN_MEM_LOCKED
131 , IMAGE_SCN_MEM_PRELOAD
132 , IMAGE_SCN_ALIGN_1BYTES
133 , IMAGE_SCN_ALIGN_2BYTES
134 , IMAGE_SCN_ALIGN_4BYTES
135 , IMAGE_SCN_ALIGN_8BYTES
136 , IMAGE_SCN_ALIGN_16BYTES
137 , IMAGE_SCN_ALIGN_32BYTES
138 , IMAGE_SCN_ALIGN_64BYTES
139 , IMAGE_SCN_ALIGN_128BYTES
140 , IMAGE_SCN_ALIGN_256BYTES
141 , IMAGE_SCN_ALIGN_512BYTES
142 , IMAGE_SCN_ALIGN_1024BYTES
143 , IMAGE_SCN_ALIGN_2048BYTES
144 , IMAGE_SCN_ALIGN_4096BYTES
145 , IMAGE_SCN_ALIGN_8192BYTES
146 , IMAGE_SCN_LNK_NRELOC_OVFL
147 , IMAGE_SCN_MEM_DISCARDABLE
148 , IMAGE_SCN_MEM_NOT_CACHED
149 , IMAGE_SCN_MEM_NOT_PAGED
150 , IMAGE_SCN_MEM_SHARED
151 , IMAGE_SCN_MEM_EXECUTE
153 , IMAGE_SCN_MEM_WRITE
156 SectionData: {type: str}
164 SectionNumber: {type: int}
165 SimpleType: [ {type: str, enum: [ IMAGE_SYM_TYPE_NULL
166 , IMAGE_SYM_TYPE_VOID
167 , IMAGE_SYM_TYPE_CHAR
168 , IMAGE_SYM_TYPE_SHORT
170 , IMAGE_SYM_TYPE_LONG
171 , IMAGE_SYM_TYPE_FLOAT
172 , IMAGE_SYM_TYPE_DOUBLE
173 , IMAGE_SYM_TYPE_STRUCT
174 , IMAGE_SYM_TYPE_UNION
175 , IMAGE_SYM_TYPE_ENUM
177 , IMAGE_SYM_TYPE_BYTE
178 , IMAGE_SYM_TYPE_WORD
179 , IMAGE_SYM_TYPE_UINT
180 , IMAGE_SYM_TYPE_DWORD
184 ComplexType: [ {type: str, enum: [ IMAGE_SYM_DTYPE_NULL
185 , IMAGE_SYM_DTYPE_POINTER
186 , IMAGE_SYM_DTYPE_FUNCTION
187 , IMAGE_SYM_DTYPE_ARRAY
191 StorageClass: [ {type: str, enum:
192 [ IMAGE_SYM_CLASS_END_OF_FUNCTION
193 , IMAGE_SYM_CLASS_NULL
194 , IMAGE_SYM_CLASS_AUTOMATIC
195 , IMAGE_SYM_CLASS_EXTERNAL
196 , IMAGE_SYM_CLASS_STATIC
197 , IMAGE_SYM_CLASS_REGISTER
198 , IMAGE_SYM_CLASS_EXTERNAL_DEF
199 , IMAGE_SYM_CLASS_LABEL
200 , IMAGE_SYM_CLASS_UNDEFINED_LABEL
201 , IMAGE_SYM_CLASS_MEMBER_OF_STRUCT
202 , IMAGE_SYM_CLASS_ARGUMENT
203 , IMAGE_SYM_CLASS_STRUCT_TAG
204 , IMAGE_SYM_CLASS_MEMBER_OF_UNION
205 , IMAGE_SYM_CLASS_UNION_TAG
206 , IMAGE_SYM_CLASS_TYPE_DEFINITION
207 , IMAGE_SYM_CLASS_UNDEFINED_STATIC
208 , IMAGE_SYM_CLASS_ENUM_TAG
209 , IMAGE_SYM_CLASS_MEMBER_OF_ENUM
210 , IMAGE_SYM_CLASS_REGISTER_PARAM
211 , IMAGE_SYM_CLASS_BIT_FIELD
212 , IMAGE_SYM_CLASS_BLOCK
213 , IMAGE_SYM_CLASS_FUNCTION
214 , IMAGE_SYM_CLASS_END_OF_STRUCT
215 , IMAGE_SYM_CLASS_FILE
216 , IMAGE_SYM_CLASS_SECTION
217 , IMAGE_SYM_CLASS_WEAK_EXTERNAL
218 , IMAGE_SYM_CLASS_CLR_TOKEN