While working on a new project I needed a way to create files containing binary data which I could control, for example all bytes from 0 to 255 in order or just a block of 10 0x03's, so I wrote bin_gen. There are loads of other ways to do this, especially in Linux, but for me this is quick and easy and I don't have to think to use it.

The script lets you specify whether you want incrementing or decrementing (--reverse) bytes, the start byte (--start) and length (--length) of data. The script automatically wraps round from 0xff back to 0x00 or from 0x00 to 0xff if you are going in reverse.

If you want a fixed byte then you can specify that (--fixed-char), similarly you can specify random bytes (--random).

Output defaults to standard out but can also be sent to a file using the --file parameter.

Download bin_gen.

Support The Site

I don't get paid for any of the projects on this site so if you'd like to support my work you can do so by using the affiliate links below where I either get account credits or cash back. Usually only pennies, but they all add up.