Files
UmaViewer/Assets/Scripts/AssetBundleDecryptor.cs
T
CroakFang d66991c2ef Add support for exporting prop, compatible with the new version, add the EnableRootMotion option (#143)
* update BillboardBuilder

* add a new enum value

* Add the EnableRootMotion option to support scenarios where the character is not within the camera view

* Add support for exporting prop

* update

* compatible with the new version 2

* update

---------

Co-authored-by: 左右看 <1918891542@qq.com>
2025-09-28 12:10:18 +02:00

28 lines
777 B
C#

using System;
using System.IO;
public static class AssetBundleDecryptor
{
public static byte[] DecryptFileToBytes(string inputFilePath, byte[] Keys)
{
if (string.IsNullOrEmpty(inputFilePath))
throw new ArgumentNullException(nameof(inputFilePath));
if (!File.Exists(inputFilePath))
throw new FileNotFoundException("Input file not found", inputFilePath);
if (Keys == null)
throw new ArgumentException("Keys must not be null or empty", nameof(Keys));
byte[] data = File.ReadAllBytes(inputFilePath);
if (data.Length <= 256)
return data;
for (int i = 256; i < data.Length; ++i)
{
data[i] ^= Keys[i % Keys.Length];
}
return data;
}
}