Created
January 4, 2017 14:48
-
-
Save LuxoftAKutsan/b2497d41b4c3fa5cc8d70a0a5c57cd9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# generate_png.py | |
# | |
# Copyright 2015 akutsan <akutsan@akutsan> | |
# | |
# Generate PNG file with preloaded cycled content | |
# | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--size', type=int, required=True, | |
help='Size of file to in megabytes') | |
parser.add_argument('--name', type=str, required=True, | |
help='place to store file') | |
args = parser.parse_args() | |
dead_bief = [0xD, 0xE, 0xA, 0xD, 0xB, 0xE, 0xE, 0xF] | |
size_in_bytes = args.size * 1024 * 1024 | |
dead_bief = dead_bief * (size_in_bytes/len(dead_bief)) | |
buf = ''.join(map(lambda x : chr(x), dead_bief)) | |
f = open(args.name, "wb") | |
f.write(buf) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment