aboutsummaryrefslogtreecommitdiffstats
path: root/test-data/sleep/empty/empty.py
blob: 2bed27de707e74e21996570b428c65c606d717e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python3

"""This script generates empty.sleep"""

# Create file in binary mode
f = open('empty.sleep', 'wb')

# Move to begining, set size
f.seek(0)
f.truncate(32)

# Write header, with 0xFF as the dat file type
f.write(b'\x05\x02\x57\xFF')

# Version 0
f.write(b'\x00')

# One-byte entry size
f.write(b'\x00\x01')

# No Algorithm name
f.write(b'\x00')
for i in range(24):
    f.write(b'\x00')

assert(f.tell() == 32)
f.close()