Skip to content

Instantly share code, notes, and snippets.

@Uradamus
Last active February 5, 2018 02:31
Show Gist options
  • Save Uradamus/e351ae4a4cbcadd81e3c83e2ef1aeae9 to your computer and use it in GitHub Desktop.
Save Uradamus/e351ae4a4cbcadd81e3c83e2ef1aeae9 to your computer and use it in GitHub Desktop.
Decrypt dwf files to swf.
from sys import argv
magic = 28 # Defined here in case it needs to be changed.
with open(argv[1], 'rb') as dwf:
data = bytearray(dwf.read())
count = 0
for byte in data:
if count < 100:
data[count] = (data[count] ^ count * magic) % 255
count += 1
else:
break
output = argv[1][:-3] + 'swf'
with open(output, 'wb') as swf:
swf.write(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment