Created
July 1, 2016 23:24
-
-
Save Laforeta/7bf512f802f83c0389117a89d2c1de0a to your computer and use it in GitHub Desktop.
code-decode.py
This file contains 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
# Source: http://dazzyd.org/blog/2016/03/17/kantai-collection-obfuscation-anti-obfuscation/ | |
# All rights remain with the author(s) cited | |
#!/usr/bin/env python3 | |
import sys | |
ORDER = [0, 7, 2, 5, 4, 3, 6, 1] | |
SRC = sys.argv[1] | |
DEST = sys.argv[2] | |
with open(SRC, "rb") as f: | |
org = f.read() | |
with open(DEST, "wb") as dec: | |
size = (len(org) - 128) >> 3 | |
dec.write(org[0:128]) | |
for i in ORDER: | |
dec.write(org[ i*size+128 : (i+1)*size+128 ]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment