Alexandre Julliard (@julliard) commented about dlls/xactengine3_7/tests/gen_xwb.py:
gen_entrymetadata(), # ENTRYMETADATA
b'', # SEEKTABLES
b'', # ENTRYNAMES
b'', # ENTRYWAVEDATA
- ]
- write_xwb(fout, sections)
+def write_xwb(fout, sections):
- pos = 4 * (3 + 2 * 5)
- fout.write(struct.pack('<III', 0x444E4257, 0x2e, 0x2c)) # signature, version, header version
- for i in range(5):
fout.write(struct.pack('<II', pos, len(sections[i]))) # offset, length
pos += len(sections[i])
- for i in range(5):
fout.write(sections[i])
It looks like it would be just as easy to do this in C and generate the file at runtime. It would also be more readable since you could use the appropriate structures and defines instead of magic numbers.