#!/usr/bin/env python3
import sys
import hashlib
from Crypto.Cipher import DES
from Crypto.Util import Padding
DESKEY=bytes((0x6e, 0x58, 0x61, 0x32, 0x62, 0x79, 0x75, 0x7a))
DESIV=bytes((0x0c, 0x15, 0x2b, 0x11, 0x39, 0x23, 0x43, 0x1b))
INPUTFOLDER="NoSSLSoYouCanFindThisEasily/"
OUTPUTFOLDER="pakfiles/"
for i in range(1, 0x1000):
segnum = "{0:06X}".format(i)
hashstr = hashlib.md5((segnum + "nabu").encode('utf-8')).hexdigest().upper()
hashstr = "-".join([hashstr[i:i+2] for i in range(0, len(hashstr), 2)])
try:
with open(INPUTFOLDER + hashstr + ".npak", "rb") as fh:
with open(OUTPUTFOLDER + segnum + ".pak", "wb") as outf:
cipher = DES.new(DESKEY, DES.MODE_CBC, iv=DESIV)
data = cipher.decrypt(fh.read())
data = Padding.unpad(data, 8)
print(segnum + ": " + str(len(data)) + " bytes")
outf.write(data)
except FileNotFoundError:
pass