CNUnity update, bug fixes.
This commit is contained in:
@@ -5,10 +5,11 @@ namespace AssetStudio
|
||||
{
|
||||
public static class BlkUtils
|
||||
{
|
||||
private const int DataPos = 0x2A;
|
||||
private const int KeySize = 0x1000;
|
||||
private const int SeedBlockSize = 0x800;
|
||||
|
||||
public static CryptoStream Decrypt(FileReader reader, Blk blk)
|
||||
public static XORStream Decrypt(FileReader reader, Blk blk)
|
||||
{
|
||||
reader.Endian = EndianType.LittleEndian;
|
||||
|
||||
@@ -53,7 +54,7 @@ namespace AssetStudio
|
||||
BinaryPrimitives.WriteUInt64LittleEndian(xorpad.AsSpan(i, 8), mt64.Int64());
|
||||
}
|
||||
|
||||
return new CryptoStream(reader.BaseStream, xorpad);
|
||||
return new XORStream(reader.BaseStream, DataPos, xorpad);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ namespace AssetStudio
|
||||
{
|
||||
using var aes = Aes.Create();
|
||||
aes.Mode = CipherMode.ECB;
|
||||
aes.Key = Encoding.UTF8.GetBytes(entry.Key);
|
||||
aes.Key = entry.GenerateKey();
|
||||
|
||||
Encryptor = aes.CreateEncryptor();
|
||||
}
|
||||
@@ -140,24 +140,18 @@ namespace AssetStudio
|
||||
|
||||
public bool Validate()
|
||||
{
|
||||
try
|
||||
var bytes = GenerateKey();
|
||||
if (bytes.Length != 0x10)
|
||||
{
|
||||
var bytes = Encoding.UTF8.GetBytes(Key);
|
||||
if (bytes.Length != 0x10)
|
||||
{
|
||||
Logger.Warning($"[CNUnity] {this} has invalid key, size should be 16 bytes, skipping...");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logger.Error($"[CNUnity] Error while adding {this}: {e.Message}");
|
||||
Logger.Warning($"[CNUnity] {this} has invalid key, size should be 16 bytes, skipping...");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public byte[] GenerateKey() => Convert.FromHexString(Key);
|
||||
|
||||
public override string ToString() => $"{Name} ({Key})";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +1,70 @@
|
||||
[
|
||||
{
|
||||
"Name": "PGR GLB/KR",
|
||||
"Key": "kurokurokurokuro"
|
||||
"Key": "6B75726F6B75726F6B75726F6B75726F"
|
||||
},
|
||||
{
|
||||
"Name": "PGR CN/JP/TW",
|
||||
"Key": "y5XPvqLOrCokWRIa"
|
||||
"Key": "7935585076714C4F72436F6B57524961"
|
||||
},
|
||||
{
|
||||
"Name": "Archeland/Kalpa of Universe",
|
||||
"Key": "BlackJackProject"
|
||||
"Key": "426C61636B4A61636B50726F6A656374"
|
||||
},
|
||||
{
|
||||
"Name": "Archeland 1.1.14",
|
||||
"Key": "ProjectArcheLand"
|
||||
"Key": "50726F6A65637441726368654C616E64"
|
||||
},
|
||||
{
|
||||
"Name": "Neural Cloud",
|
||||
"Key": "1cab846f52901c9e"
|
||||
"Key": "31636162383436663532393031633965"
|
||||
},
|
||||
{
|
||||
"Name": "Higan: Eruthyll",
|
||||
"Key": "E1x2c3a4l5i6b7ur"
|
||||
"Key": "45317832633361346C35693662377572"
|
||||
},
|
||||
{
|
||||
"Name": "White Chord",
|
||||
"Key": "yulong1868gnoluy"
|
||||
"Key": "79756C6F6E6731383638676E6F6C7579"
|
||||
},
|
||||
{
|
||||
"Name": "Mecharashi",
|
||||
"Key": "38C83F132E7F7A0A"
|
||||
"Key": "33384338334631333245374637413041"
|
||||
},
|
||||
{
|
||||
"Name": "Castlevania: Moon Night Fantasy",
|
||||
"Key": "1234567812345678"
|
||||
"Key": "31323334353637383132333435363738"
|
||||
},
|
||||
{
|
||||
"Name": "Huā Yì Shān Xīn Zhī Yuè",
|
||||
"Key": "INHJnhdypqk547xd"
|
||||
"Key": "494E484A6E68647970716B3534377864"
|
||||
},
|
||||
{
|
||||
"Name": "Doula Continent",
|
||||
"Key": "52346366773339474644326661785756"
|
||||
},
|
||||
{
|
||||
"Name": "Bless Global",
|
||||
"Key": "6C6F6E67747567616D652E796A66623F"
|
||||
},
|
||||
{
|
||||
"Name": "Starside",
|
||||
"Key": "41394A3542384D4A50554D3539464B57"
|
||||
},
|
||||
{
|
||||
"Name": "Resonance Soltice",
|
||||
"Key": "5265736F6E616E63655265626F726E52"
|
||||
},
|
||||
{
|
||||
"Name": "Oblivion Override",
|
||||
"Key": "7179666D6F6F6E323331323433343532"
|
||||
},
|
||||
{
|
||||
"Name": "Dawnlands",
|
||||
"Key": "636F6465737339353237636F64657373"
|
||||
},
|
||||
{
|
||||
"Name": "BB",
|
||||
"Key": "5F6C4E3F3A3F233F3F3F3F663F1A3F3F"
|
||||
}
|
||||
]
|
||||
@@ -2,13 +2,11 @@
|
||||
|
||||
namespace AssetStudio
|
||||
{
|
||||
public class CryptoStream : BlockStream
|
||||
public class XORStream : BlockStream
|
||||
{
|
||||
private const long _dataPosition = 0x2A;
|
||||
|
||||
private readonly byte[] _xorpad;
|
||||
|
||||
public CryptoStream(Stream stream, byte[] xorpad) : base(stream, _dataPosition)
|
||||
public XORStream(Stream stream, long pos, byte[] xorpad) : base(stream, pos)
|
||||
{
|
||||
_xorpad = xorpad;
|
||||
}
|
||||
Reference in New Issue
Block a user