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_EBC
69 , IMAGE_FILE_MACHINE_I386
70 , IMAGE_FILE_MACHINE_IA64
71 , IMAGE_FILE_MACHINE_M32R
72 , IMAGE_FILE_MACHINE_MIPS16
73 , IMAGE_FILE_MACHINE_MIPSFPU
74 , IMAGE_FILE_MACHINE_MIPSFPU16
75 , IMAGE_FILE_MACHINE_POWERPC
76 , IMAGE_FILE_MACHINE_POWERPCFP
77 , IMAGE_FILE_MACHINE_R4000
78 , IMAGE_FILE_MACHINE_SH3
79 , IMAGE_FILE_MACHINE_SH3DSP
80 , IMAGE_FILE_MACHINE_SH4
81 , IMAGE_FILE_MACHINE_SH5
82 , IMAGE_FILE_MACHINE_THUMB
83 , IMAGE_FILE_MACHINE_WCEMIPSV2
91 enum: [ IMAGE_FILE_RELOCS_STRIPPED
92 , IMAGE_FILE_EXECUTABLE_IMAGE
93 , IMAGE_FILE_LINE_NUMS_STRIPPED
94 , IMAGE_FILE_LOCAL_SYMS_STRIPPED
95 , IMAGE_FILE_AGGRESSIVE_WS_TRIM
96 , IMAGE_FILE_LARGE_ADDRESS_AWARE
97 , IMAGE_FILE_BYTES_REVERSED_LO
98 , IMAGE_FILE_32BIT_MACHINE
99 , IMAGE_FILE_DEBUG_STRIPPED
100 , IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP
101 , IMAGE_FILE_NET_RUN_FROM_SWAP
104 , IMAGE_FILE_UP_SYSTEM_ONLY
105 , IMAGE_FILE_BYTES_REVERSED_HI
118 enum: [ IMAGE_SCN_TYPE_NO_PAD
120 , IMAGE_SCN_CNT_INITIALIZED_DATA
121 , IMAGE_SCN_CNT_UNINITIALIZED_DATA
122 , IMAGE_SCN_LNK_OTHER
124 , IMAGE_SCN_LNK_REMOVE
125 , IMAGE_SCN_LNK_COMDAT
127 , IMAGE_SCN_MEM_PURGEABLE
128 , IMAGE_SCN_MEM_16BIT
129 , IMAGE_SCN_MEM_LOCKED
130 , IMAGE_SCN_MEM_PRELOAD
131 , IMAGE_SCN_ALIGN_1BYTES
132 , IMAGE_SCN_ALIGN_2BYTES
133 , IMAGE_SCN_ALIGN_4BYTES
134 , IMAGE_SCN_ALIGN_8BYTES
135 , IMAGE_SCN_ALIGN_16BYTES
136 , IMAGE_SCN_ALIGN_32BYTES
137 , IMAGE_SCN_ALIGN_64BYTES
138 , IMAGE_SCN_ALIGN_128BYTES
139 , IMAGE_SCN_ALIGN_256BYTES
140 , IMAGE_SCN_ALIGN_512BYTES
141 , IMAGE_SCN_ALIGN_1024BYTES
142 , IMAGE_SCN_ALIGN_2048BYTES
143 , IMAGE_SCN_ALIGN_4096BYTES
144 , IMAGE_SCN_ALIGN_8192BYTES
145 , IMAGE_SCN_LNK_NRELOC_OVFL
146 , IMAGE_SCN_MEM_DISCARDABLE
147 , IMAGE_SCN_MEM_NOT_CACHED
148 , IMAGE_SCN_MEM_NOT_PAGED
149 , IMAGE_SCN_MEM_SHARED
150 , IMAGE_SCN_MEM_EXECUTE
152 , IMAGE_SCN_MEM_WRITE
155 SectionData: {type: str}
163 SectionNumber: {type: int}
164 SimpleType: [ {type: str, enum: [ IMAGE_SYM_TYPE_NULL
165 , IMAGE_SYM_TYPE_VOID
166 , IMAGE_SYM_TYPE_CHAR
167 , IMAGE_SYM_TYPE_SHORT
169 , IMAGE_SYM_TYPE_LONG
170 , IMAGE_SYM_TYPE_FLOAT
171 , IMAGE_SYM_TYPE_DOUBLE
172 , IMAGE_SYM_TYPE_STRUCT
173 , IMAGE_SYM_TYPE_UNION
174 , IMAGE_SYM_TYPE_ENUM
176 , IMAGE_SYM_TYPE_BYTE
177 , IMAGE_SYM_TYPE_WORD
178 , IMAGE_SYM_TYPE_UINT
179 , IMAGE_SYM_TYPE_DWORD
183 ComplexType: [ {type: str, enum: [ IMAGE_SYM_DTYPE_NULL
184 , IMAGE_SYM_DTYPE_POINTER
185 , IMAGE_SYM_DTYPE_FUNCTION
186 , IMAGE_SYM_DTYPE_ARRAY
190 StorageClass: [ {type: str, enum:
191 [ IMAGE_SYM_CLASS_END_OF_FUNCTION
192 , IMAGE_SYM_CLASS_NULL
193 , IMAGE_SYM_CLASS_AUTOMATIC
194 , IMAGE_SYM_CLASS_EXTERNAL
195 , IMAGE_SYM_CLASS_STATIC
196 , IMAGE_SYM_CLASS_REGISTER
197 , IMAGE_SYM_CLASS_EXTERNAL_DEF
198 , IMAGE_SYM_CLASS_LABEL
199 , IMAGE_SYM_CLASS_UNDEFINED_LABEL
200 , IMAGE_SYM_CLASS_MEMBER_OF_STRUCT
201 , IMAGE_SYM_CLASS_ARGUMENT
202 , IMAGE_SYM_CLASS_STRUCT_TAG
203 , IMAGE_SYM_CLASS_MEMBER_OF_UNION
204 , IMAGE_SYM_CLASS_UNION_TAG
205 , IMAGE_SYM_CLASS_TYPE_DEFINITION
206 , IMAGE_SYM_CLASS_UNDEFINED_STATIC
207 , IMAGE_SYM_CLASS_ENUM_TAG
208 , IMAGE_SYM_CLASS_MEMBER_OF_ENUM
209 , IMAGE_SYM_CLASS_REGISTER_PARAM
210 , IMAGE_SYM_CLASS_BIT_FIELD
211 , IMAGE_SYM_CLASS_BLOCK
212 , IMAGE_SYM_CLASS_FUNCTION
213 , IMAGE_SYM_CLASS_END_OF_STRUCT
214 , IMAGE_SYM_CLASS_FILE
215 , IMAGE_SYM_CLASS_SECTION
216 , IMAGE_SYM_CLASS_WEAK_EXTERNAL
217 , IMAGE_SYM_CLASS_CLR_TOKEN