Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ########################################
- # Dirge of Cerberus .at3 decryptor
- # by bnnm
- # ########################################
- import sys
- key_size = 0x60
- key = [
- 0xA3,0xDD,0x51,0x46,0x7C,0x49,0x5B,0x1C,0x81,0x25,0x81,0x55,0x9A,0x6B,0xAF,0xD5,
- 0x21,0xF2,0x88,0x3E,0x47,0xDA,0x51,0xE1,0x2F,0x9B,0x81,0xA7,0x1F,0xCB,0x00,0x01,
- 0xA5,0x47,0x00,0xAC,0xBF,0x32,0x03,0x44,0xAB,0x44,0x7B,0x9A,0xA8,0xA0,0x4E,0xDF,
- 0x06,0x73,0xD1,0x49,0x26,0xCB,0xB4,0xF4,0x0D,0x5F,0x66,0xDF,0x32,0xCA,0xB9,0x27,
- 0x98,0x91,0x4D,0x20,0x80,0x6A,0x38,0x60,0x9E,0x79,0xC4,0x8A,0x08,0x07,0xD3,0x87,
- 0x23,0xE1,0x28,0xD4,0x20,0xB5,0x52,0xAC,0x35,0x4C,0x45,0x2F,0xF8,0x60,0x8C,0x3A
- ]
- key_len = len(key)
- if len(sys.argv) != 2:
- print("Infile not specified")
- exit()
- infile_path = sys.argv[1]
- outfile_path = infile_path + '.dec'
- if infile_path.endswith('title.at3'):
- print("Infile not encrypted")
- exit()
- infile = open(infile_path, "rb")
- outfile = open(outfile_path, "wb+")
- while True:
- data = bytearray(infile.read(key_len))
- data_len = len(data)
- if data_len == 0:
- break
- # decrypt
- for i in range(0, data_len):
- # base key xor
- data[i] = data[i] ^ key[i]
- # re-xor with all the values 0x10 above
- for j in range(0, i/0x10):
- data[i] = data[i] ^ data[i - (j+1)*0x10]
- outfile.write(data)
- infile.close()
- outfile.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement