Mercurial > dropbear-fuzzcorpus
annotate make_fuzzinput.py @ 26:c87782d4bd46
Make robust for latest.zip being missing
Handle newly added targets
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 14 Dec 2024 20:27:39 +0800 |
parents | ec5e2b121e57 |
children |
rev | line source |
---|---|
0 | 1 #!/usr/bin/env python3 |
2 | |
3 # A fuzz input consists of a SSH-string header followed by the SSH stream. | |
4 # This program prepends a basic prefix. | |
5 | |
6 import struct | |
7 import sys | |
8 | |
9 stream = sys.stdin.buffer.read() | |
10 | |
11 header = b'' | |
12 # uint32 wrapfd random seed | |
13 header += struct.pack(">I", 0xafaf1234) | |
14 | |
15 # prepend length | |
16 header = struct.pack(">I", len(header)) + header | |
17 sys.stdout.buffer.write(header) | |
18 sys.stdout.buffer.write(stream) |