Skip to content

Instantly share code, notes, and snippets.

@LuxoftAKutsan
Created January 4, 2017 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LuxoftAKutsan/b2497d41b4c3fa5cc8d70a0a5c57cd9e to your computer and use it in GitHub Desktop.
Save LuxoftAKutsan/b2497d41b4c3fa5cc8d70a0a5c57cd9e to your computer and use it in GitHub Desktop.
#!/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