defmakeSha256Hash(text, salt = HASH_SALT, loopHashCount = HASH_COUNT): text_salt = f'{text}{salt}' b_text_salt = text_salt.encode('utf-8') for i inrange(loopHashCount): if i >= 1: b_text_salt = baxor(b_text_salt, XOR_VAL * len(b_text_salt)) b_text_salt = hashlib.sha256(b_text_salt).digest() hashRes = res = ''.join(format(x, '02x') for x in b_text_salt) return hashRes
defbaxor(ba1, ba2): returnbytes(a ^ b for a,b inzip(ba1, ba2))
defdump_filelist(manifest, output): env = UnityPy.load(manifest) for o in env.objects: data = o.read() if data.name == 'AssetBundleManifest': parsed_list = [] for key in data.type_tree['AssetBundleNames']: parsed_list.append(data.type_tree['AssetBundleNames'][key]) parsed_list.sort() withopen(output, 'w', encoding='utf-8-sig') as f: for p in parsed_list: dirname, basename = os.path.split(p) filename, fileext = os.path.splitext(basename) hashname = makeSha256Hash(filename) f.write(f'{p},{gurizaia_cdn_header}{dirname}/{hashname}{fileext}\n')