Skip to content

Instantly share code, notes, and snippets.

@sgviking
Last active October 15, 2016 17:50
Show Gist options
  • Save sgviking/27e9d6e915bff50541322351c3f1f599 to your computer and use it in GitHub Desktop.
Save sgviking/27e9d6e915bff50541322351c3f1f599 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# 0B E5
# 4D E2
quack = b""
with open('newflag', 'rb') as f:
while True:
oldpos = f.tell()
byte = f.read(1)
newpos = f.tell()
if oldpos == newpos:
break
if byte == b'\x0B' or byte == b'\x4D':
byte = f.read(1)
if byte == b'\xE5' or byte == b'\xE2':
byte = f.read(1)
quack += byte
with open('quack.bin', 'wb') as f:
f.write(quack)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment