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$.....|
33 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
39 TimeDateStamp: {type: int}
40 MajorVersion: {type: int}
41 MinorVersion: {type: int}
42 GlobalFlagsClear: {type: int}
43 GlobalFlagsSet: {type: int}
44 CriticalSectionDefaultTimeout: {type: int}
45 DeCommitFreeBlockThreshold: {type: int}
46 DeCommitTotalFreeThreshold: {type: int}
47 LockPrefixTable: {type: int}
48 MaximumAllocationSize: {type: int}
49 VirtualMemoryThreshold: {type: int}
50 ProcessAffinityMask: {type: int}
51 ProcessHeapFlags: {type: int}
52 CSDVersion: {type: int}
53 DependentLoadFlags: {type: int}
55 SecurityCookie: {type: int}
56 SEHandlerTable: {type: int}
57 SEHandlerCount: {type: int}
58 GuardCFCheckFunction: {type: int}
59 GuardCFCheckDispatch: {type: int}
60 GuardCFFunctionTable: {type: int}
61 GuardCFFunctionCount: {type: int}
62 GuardFlags: {type: int}
66 CatalogOffset: {type: int}
67 GuardAddressTakenIatEntryTable: {type: int}
68 GuardAddressTakenIatEntryCount: {type: int}
69 GuardLongJumpTargetTable: {type: int}
70 GuardLongJumpTargetCount: {type: int}
71 DynamicValueRelocTable: {type: int}
72 CHPEMetadataPointer: {type: int}
73 GuardRFFailureRoutine: {type: int}
74 GuardRFFailureRoutineFunctionPointer: {type: int}
75 DynamicValueRelocTableOffset: {type: int}
76 DynamicValueRelocTableSection: {type: int}
77 GuardRFVerifyStackPointerFunctionPointer: {type: int}
78 HotPatchTableOffset: {type: int}
79 EnclaveConfigurationPointer: {type: int}
80 VolatileMetadataPointer: {type: int}
81 GuardEHContinuationTable: {type: int}
82 GuardEHContinuationCount: {type: int}
83 GuardXFGCheckFunctionPointer: {type: int}
84 GuardXFGDispatchFunctionPointer: {type: int}
85 GuardXFGTableDispatchFunctionPointer: {type: int}
86 CastGuardOsDeterminedFailureMode: {type: int}
92 SimpleType: IMAGE_SYM_TYPE_NULL # (0)
93 ComplexType: IMAGE_SYM_DTYPE_NULL # (0)
94 StorageClass: IMAGE_SYM_CLASS_STATIC # (3)
97 "\x24\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00" # |$.................|
102 SimpleType: IMAGE_SYM_TYPE_NULL # (0)
103 ComplexType: IMAGE_SYM_DTYPE_NULL # (0)
104 StorageClass: IMAGE_SYM_CLASS_EXTERNAL # (2)
106 Here's a simplified Kwalify_ schema with an extension to allow alternate types.
108 .. _Kwalify: http://www.kuwata-lab.com/kwalify/ruby/users-guide.html
117 Machine: [ {type: str, enum:
118 [ IMAGE_FILE_MACHINE_UNKNOWN
119 , IMAGE_FILE_MACHINE_AM33
120 , IMAGE_FILE_MACHINE_AMD64
121 , IMAGE_FILE_MACHINE_ARM
122 , IMAGE_FILE_MACHINE_ARMNT
123 , IMAGE_FILE_MACHINE_ARM64
124 , IMAGE_FILE_MACHINE_EBC
125 , IMAGE_FILE_MACHINE_I386
126 , IMAGE_FILE_MACHINE_IA64
127 , IMAGE_FILE_MACHINE_M32R
128 , IMAGE_FILE_MACHINE_MIPS16
129 , IMAGE_FILE_MACHINE_MIPSFPU
130 , IMAGE_FILE_MACHINE_MIPSFPU16
131 , IMAGE_FILE_MACHINE_POWERPC
132 , IMAGE_FILE_MACHINE_POWERPCFP
133 , IMAGE_FILE_MACHINE_R4000
134 , IMAGE_FILE_MACHINE_SH3
135 , IMAGE_FILE_MACHINE_SH3DSP
136 , IMAGE_FILE_MACHINE_SH4
137 , IMAGE_FILE_MACHINE_SH5
138 , IMAGE_FILE_MACHINE_THUMB
139 , IMAGE_FILE_MACHINE_WCEMIPSV2
147 enum: [ IMAGE_FILE_RELOCS_STRIPPED
148 , IMAGE_FILE_EXECUTABLE_IMAGE
149 , IMAGE_FILE_LINE_NUMS_STRIPPED
150 , IMAGE_FILE_LOCAL_SYMS_STRIPPED
151 , IMAGE_FILE_AGGRESSIVE_WS_TRIM
152 , IMAGE_FILE_LARGE_ADDRESS_AWARE
153 , IMAGE_FILE_BYTES_REVERSED_LO
154 , IMAGE_FILE_32BIT_MACHINE
155 , IMAGE_FILE_DEBUG_STRIPPED
156 , IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP
157 , IMAGE_FILE_NET_RUN_FROM_SWAP
160 , IMAGE_FILE_UP_SYSTEM_ONLY
161 , IMAGE_FILE_BYTES_REVERSED_HI
174 enum: [ IMAGE_SCN_TYPE_NO_PAD
176 , IMAGE_SCN_CNT_INITIALIZED_DATA
177 , IMAGE_SCN_CNT_UNINITIALIZED_DATA
178 , IMAGE_SCN_LNK_OTHER
180 , IMAGE_SCN_LNK_REMOVE
181 , IMAGE_SCN_LNK_COMDAT
183 , IMAGE_SCN_MEM_PURGEABLE
184 , IMAGE_SCN_MEM_16BIT
185 , IMAGE_SCN_MEM_LOCKED
186 , IMAGE_SCN_MEM_PRELOAD
187 , IMAGE_SCN_ALIGN_1BYTES
188 , IMAGE_SCN_ALIGN_2BYTES
189 , IMAGE_SCN_ALIGN_4BYTES
190 , IMAGE_SCN_ALIGN_8BYTES
191 , IMAGE_SCN_ALIGN_16BYTES
192 , IMAGE_SCN_ALIGN_32BYTES
193 , IMAGE_SCN_ALIGN_64BYTES
194 , IMAGE_SCN_ALIGN_128BYTES
195 , IMAGE_SCN_ALIGN_256BYTES
196 , IMAGE_SCN_ALIGN_512BYTES
197 , IMAGE_SCN_ALIGN_1024BYTES
198 , IMAGE_SCN_ALIGN_2048BYTES
199 , IMAGE_SCN_ALIGN_4096BYTES
200 , IMAGE_SCN_ALIGN_8192BYTES
201 , IMAGE_SCN_LNK_NRELOC_OVFL
202 , IMAGE_SCN_MEM_DISCARDABLE
203 , IMAGE_SCN_MEM_NOT_CACHED
204 , IMAGE_SCN_MEM_NOT_PAGED
205 , IMAGE_SCN_MEM_SHARED
206 , IMAGE_SCN_MEM_EXECUTE
208 , IMAGE_SCN_MEM_WRITE
211 SectionData: {type: str}
219 SectionNumber: {type: int}
220 SimpleType: [ {type: str, enum: [ IMAGE_SYM_TYPE_NULL
221 , IMAGE_SYM_TYPE_VOID
222 , IMAGE_SYM_TYPE_CHAR
223 , IMAGE_SYM_TYPE_SHORT
225 , IMAGE_SYM_TYPE_LONG
226 , IMAGE_SYM_TYPE_FLOAT
227 , IMAGE_SYM_TYPE_DOUBLE
228 , IMAGE_SYM_TYPE_STRUCT
229 , IMAGE_SYM_TYPE_UNION
230 , IMAGE_SYM_TYPE_ENUM
232 , IMAGE_SYM_TYPE_BYTE
233 , IMAGE_SYM_TYPE_WORD
234 , IMAGE_SYM_TYPE_UINT
235 , IMAGE_SYM_TYPE_DWORD
239 ComplexType: [ {type: str, enum: [ IMAGE_SYM_DTYPE_NULL
240 , IMAGE_SYM_DTYPE_POINTER
241 , IMAGE_SYM_DTYPE_FUNCTION
242 , IMAGE_SYM_DTYPE_ARRAY
246 StorageClass: [ {type: str, enum:
247 [ IMAGE_SYM_CLASS_END_OF_FUNCTION
248 , IMAGE_SYM_CLASS_NULL
249 , IMAGE_SYM_CLASS_AUTOMATIC
250 , IMAGE_SYM_CLASS_EXTERNAL
251 , IMAGE_SYM_CLASS_STATIC
252 , IMAGE_SYM_CLASS_REGISTER
253 , IMAGE_SYM_CLASS_EXTERNAL_DEF
254 , IMAGE_SYM_CLASS_LABEL
255 , IMAGE_SYM_CLASS_UNDEFINED_LABEL
256 , IMAGE_SYM_CLASS_MEMBER_OF_STRUCT
257 , IMAGE_SYM_CLASS_ARGUMENT
258 , IMAGE_SYM_CLASS_STRUCT_TAG
259 , IMAGE_SYM_CLASS_MEMBER_OF_UNION
260 , IMAGE_SYM_CLASS_UNION_TAG
261 , IMAGE_SYM_CLASS_TYPE_DEFINITION
262 , IMAGE_SYM_CLASS_UNDEFINED_STATIC
263 , IMAGE_SYM_CLASS_ENUM_TAG
264 , IMAGE_SYM_CLASS_MEMBER_OF_ENUM
265 , IMAGE_SYM_CLASS_REGISTER_PARAM
266 , IMAGE_SYM_CLASS_BIT_FIELD
267 , IMAGE_SYM_CLASS_BLOCK
268 , IMAGE_SYM_CLASS_FUNCTION
269 , IMAGE_SYM_CLASS_END_OF_STRUCT
270 , IMAGE_SYM_CLASS_FILE
271 , IMAGE_SYM_CLASS_SECTION
272 , IMAGE_SYM_CLASS_WEAK_EXTERNAL
273 , IMAGE_SYM_CLASS_CLR_TOKEN