Last active
February 5, 2018 02:31
-
-
Save Uradamus/e351ae4a4cbcadd81e3c83e2ef1aeae9 to your computer and use it in GitHub Desktop.
Decrypt dwf files to swf.
This file contains hidden or 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
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