mirror of
https://github.com/crskycode/GARbro.git
synced 2026-06-07 06:08:47 +08:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
abd6ff6b39 | ||
|
|
a5f398a2d5 | ||
|
|
337f238198 | ||
|
|
6185af55cd | ||
|
|
b1ebf89890 | ||
|
|
2f2b067272 | ||
|
|
11273de4f6 | ||
|
|
2ceafe55df | ||
|
|
0fd301d72b |
@@ -12,6 +12,7 @@
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -108,6 +109,7 @@
|
||||
<Compile Include="GameSystem\AudioADP4.cs" />
|
||||
<Compile Include="Kaas\ArcPB.cs" />
|
||||
<Compile Include="Kaas\AudioKAAS.cs" />
|
||||
<Compile Include="Kaguya\ArcAN21.cs" />
|
||||
<Compile Include="Kaguya\ArcUF.cs" />
|
||||
<Compile Include="Kurumi\ImageGRA.cs" />
|
||||
<Compile Include="Leaf\ArcPX.cs" />
|
||||
@@ -557,6 +559,7 @@
|
||||
<Compile Include="Xuse\ArcXARC.cs" />
|
||||
<Compile Include="Xuse\ArcXuse.cs" />
|
||||
<Compile Include="YaneSDK\ArcDAT.cs" />
|
||||
<Compile Include="YaneSDK\ArcHibiki.cs" />
|
||||
<Compile Include="Yatagarasu\ArcPKG.cs" />
|
||||
<Compile Include="Yatagarasu\ArcPKG2.cs" />
|
||||
<Compile Include="Youkai\ArcDAT.cs" />
|
||||
|
||||
@@ -693,6 +693,8 @@ namespace GameRes.Formats.Emote
|
||||
ReadRgba4444 (pixels, stride);
|
||||
else if ("RL" == m_info.TexType)
|
||||
ReadRle (pixels, stride);
|
||||
else if ("DXT5" == m_info.TexType)
|
||||
pixels = ReadDxt5();
|
||||
else
|
||||
throw new NotImplementedException (string.Format ("PSB texture format '{0}' not implemented", m_info.TexType));
|
||||
return ImageData.Create (m_info, PixelFormats.Bgra32, null, pixels, stride);
|
||||
@@ -799,5 +801,12 @@ namespace GameRes.Formats.Emote
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
byte[] ReadDxt5 ()
|
||||
{
|
||||
var packed = m_input.ReadBytes ((int)m_input.Length);
|
||||
var dxt = new DirectDraw.DxtDecoder (packed, m_info);
|
||||
return dxt.UnpackDXT5();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
251
ArcFormats/Kaguya/ArcAN21.cs
Normal file
251
ArcFormats/Kaguya/ArcAN21.cs
Normal file
@@ -0,0 +1,251 @@
|
||||
//! \file ArcAN21.cs
|
||||
//! \date Sun Apr 30 21:04:25 2017
|
||||
//! \brief KaGuYa script engine animation resource.
|
||||
//
|
||||
// Copyright (C) 2017 by morkt
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Composition;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace GameRes.Formats.Kaguya
|
||||
{
|
||||
class An21Entry : PackedEntry
|
||||
{
|
||||
public int FrameIndex;
|
||||
public int RleStep;
|
||||
}
|
||||
|
||||
[Export(typeof(ArchiveFormat))]
|
||||
public class An21Opener : ArchiveFormat
|
||||
{
|
||||
public override string Tag { get { return "AN21/KAGUYA"; } }
|
||||
public override string Description { get { return "KaGuYa script engine animation resource"; } }
|
||||
public override uint Signature { get { return 0x31324E41; } } // 'AN21'
|
||||
public override bool IsHierarchic { get { return false; } }
|
||||
public override bool CanWrite { get { return false; } }
|
||||
|
||||
public An21Opener ()
|
||||
{
|
||||
Extensions = new string[] { "anm" };
|
||||
}
|
||||
|
||||
public override ArcFile TryOpen (ArcView file)
|
||||
{
|
||||
int table_count = file.View.ReadUInt16 (4);
|
||||
uint current_offset = 8;
|
||||
for (int i = 0; i < table_count; ++i)
|
||||
{
|
||||
switch (file.View.ReadByte (current_offset++))
|
||||
{
|
||||
case 0: break;
|
||||
case 1: current_offset += 8; break;
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5: current_offset += 4; break;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
current_offset += 2 + file.View.ReadUInt16 (current_offset) * 8u;
|
||||
if (!file.View.AsciiEqual (current_offset, "[PIC]10"))
|
||||
return null;
|
||||
current_offset += 7;
|
||||
int frame_count = file.View.ReadInt16 (current_offset);
|
||||
if (!IsSaneCount (frame_count))
|
||||
return null;
|
||||
current_offset += 0x12;
|
||||
string base_name = Path.GetFileNameWithoutExtension (file.Name);
|
||||
var dir = new List<Entry> (frame_count);
|
||||
var info = new ImageMetaData
|
||||
{
|
||||
OffsetX = file.View.ReadInt32 (current_offset),
|
||||
OffsetY = file.View.ReadInt32 (current_offset+4),
|
||||
Width = file.View.ReadUInt32 (current_offset+8),
|
||||
Height = file.View.ReadUInt32 (current_offset+12),
|
||||
};
|
||||
int channels = file.View.ReadInt32 (current_offset+0x10);
|
||||
info.BPP = channels * 8;
|
||||
current_offset += 0x14;
|
||||
var entry = new An21Entry
|
||||
{
|
||||
FrameIndex = 0,
|
||||
Name = string.Format ("{0}#{1:D2}", base_name, 0),
|
||||
Type = "image",
|
||||
Offset = current_offset,
|
||||
Size = (uint)channels * info.Width * info.Height,
|
||||
IsPacked = false,
|
||||
};
|
||||
dir.Add (entry);
|
||||
current_offset += entry.Size;
|
||||
for (int i = 1; i < frame_count; ++i)
|
||||
{
|
||||
int step = file.View.ReadByte (current_offset++);
|
||||
if (0 == step)
|
||||
return null;
|
||||
uint packed_size = file.View.ReadUInt32 (current_offset);
|
||||
uint unpacked_size = (uint)(channels * (info.OffsetX + (int)info.Width)
|
||||
* (info.OffsetY + (int)info.Height));
|
||||
current_offset += 4;
|
||||
entry = new An21Entry
|
||||
{
|
||||
FrameIndex = i,
|
||||
Name = string.Format ("{0}#{1:D2}", base_name, i),
|
||||
Type = "image",
|
||||
Offset = current_offset,
|
||||
Size = packed_size,
|
||||
UnpackedSize = unpacked_size,
|
||||
IsPacked = true,
|
||||
RleStep = step,
|
||||
};
|
||||
dir.Add (entry);
|
||||
current_offset += packed_size;
|
||||
}
|
||||
return new An21Archive (file, this, dir, info);
|
||||
}
|
||||
|
||||
public override Stream OpenEntry (ArcFile arc, Entry entry)
|
||||
{
|
||||
var anent = entry as An21Entry;
|
||||
var input = arc.File.CreateStream (entry.Offset, entry.Size);
|
||||
if (null == anent || !anent.IsPacked)
|
||||
return input;
|
||||
using (input)
|
||||
{
|
||||
var data = DecompressRLE (input, anent.UnpackedSize, anent.RleStep);
|
||||
return new BinMemoryStream (data);
|
||||
}
|
||||
}
|
||||
|
||||
public override IImageDecoder OpenImage (ArcFile arc, Entry entry)
|
||||
{
|
||||
var anarc = (An21Archive)arc;
|
||||
var anent = (An21Entry)entry;
|
||||
var pixels = anarc.GetFrame (anent.FrameIndex);
|
||||
return new BitmapDecoder (pixels, anarc.ImageInfo);
|
||||
}
|
||||
|
||||
internal static byte[] DecompressRLE (IBinaryStream input, uint unpacked_size, int rle_step)
|
||||
{
|
||||
var output = new byte[unpacked_size];
|
||||
for (int i = 0; i < rle_step; ++i)
|
||||
{
|
||||
byte v1 = input.ReadUInt8();
|
||||
output[i] = v1;
|
||||
int dst = i + rle_step;
|
||||
while (dst < output.Length)
|
||||
{
|
||||
byte v2 = input.ReadUInt8();
|
||||
output[dst] = v2;
|
||||
dst += rle_step;
|
||||
if (v2 == v1)
|
||||
{
|
||||
int count = input.ReadUInt8();
|
||||
if (0 != (count & 0x80))
|
||||
count = input.ReadUInt8() + ((count & 0x7F) << 8) + 128;
|
||||
while (count --> 0 && dst < output.Length)
|
||||
{
|
||||
output[dst] = v2;
|
||||
dst += rle_step;
|
||||
}
|
||||
if (dst < output.Length)
|
||||
{
|
||||
v2 = input.ReadUInt8();
|
||||
output[dst] = v2;
|
||||
dst += rle_step;
|
||||
}
|
||||
}
|
||||
v1 = v2;
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
}
|
||||
|
||||
class An21Archive : AnmArchive
|
||||
{
|
||||
byte[][] Frames;
|
||||
|
||||
public An21Archive (ArcView arc, ArchiveFormat impl, ICollection<Entry> dir, ImageMetaData base_info)
|
||||
: base (arc, impl, dir, base_info)
|
||||
{
|
||||
Frames = new byte[dir.Count][];
|
||||
}
|
||||
|
||||
public byte[] GetFrame (int index)
|
||||
{
|
||||
if (index >= Frames.Length)
|
||||
throw new ArgumentException ("index");
|
||||
if (null != Frames[index])
|
||||
return Frames[index];
|
||||
|
||||
var entry = Dir.ElementAt (index);
|
||||
byte[] pixels;
|
||||
using (var stream = OpenEntry (entry))
|
||||
{
|
||||
pixels = new byte[stream.Length];
|
||||
stream.Read (pixels, 0, pixels.Length);
|
||||
}
|
||||
if (index > 0)
|
||||
{
|
||||
var prev_frame = GetFrame (index-1);
|
||||
for (int i = 0; i < pixels.Length; ++i)
|
||||
pixels[i] += prev_frame[i];
|
||||
}
|
||||
Frames[index] = pixels;
|
||||
return pixels;
|
||||
}
|
||||
}
|
||||
|
||||
class BitmapDecoder : IImageDecoder
|
||||
{
|
||||
public Stream Source { get { return null; } }
|
||||
public ImageFormat SourceFormat { get { return null; } }
|
||||
public ImageMetaData Info { get; private set; }
|
||||
public ImageData Image { get; private set; }
|
||||
|
||||
public BitmapDecoder (byte[] pixels, ImageMetaData info)
|
||||
{
|
||||
Info = info;
|
||||
int stride = (int)info.Width * info.BPP / 8;
|
||||
Image = ImageData.CreateFlipped (info, GetFormat(), null, pixels, stride);
|
||||
}
|
||||
|
||||
PixelFormat GetFormat ()
|
||||
{
|
||||
switch (Info.BPP)
|
||||
{
|
||||
case 8: return PixelFormats.Gray8;
|
||||
case 24: return PixelFormats.Bgr24;
|
||||
case 32: return PixelFormats.Bgra32;
|
||||
default: throw new InvalidFormatException();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
//! \date Fri Jan 22 18:44:56 2016
|
||||
//! \brief KaGuYa archive format.
|
||||
//
|
||||
// Copyright (C) 2016 by morkt
|
||||
// Copyright (C) 2016-2017 by morkt
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
@@ -436,13 +436,14 @@ namespace GameRes.Formats.Kaguya
|
||||
public static ParamsDeserializer Create (IBinaryStream input)
|
||||
{
|
||||
var header = input.ReadHeader (0x11);
|
||||
if (!header.AsciiEqual ("[SCR-PARAMS]"))
|
||||
return null;
|
||||
if (header.AsciiEqual (12, "v02"))
|
||||
return new ParamsV2Deserializer (input);
|
||||
else if (header.AsciiEqual (12, "v05.6"))
|
||||
return new ParamsV5Deserializer (input);
|
||||
return null;
|
||||
if (header.AsciiEqual ("[SCR-PARAMS]"))
|
||||
{
|
||||
if (header.AsciiEqual (12, "v02"))
|
||||
return new ParamsV2Deserializer (input);
|
||||
else if (header.AsciiEqual (12, "v05.5") || header.AsciiEqual (12, "v05.6"))
|
||||
return new ParamsV5Deserializer (input);
|
||||
}
|
||||
throw new UnknownEncryptionScheme();
|
||||
}
|
||||
|
||||
public virtual LinkEncryption GetEncryption ()
|
||||
@@ -642,7 +643,10 @@ namespace GameRes.Formats.Kaguya
|
||||
new Tuple<string, Decryptor> ("AP", (a, e) => DecryptImage (a, e, 0xC)),
|
||||
};
|
||||
if (anm_encrypted)
|
||||
{
|
||||
table.Add (new Tuple<string, Decryptor> ("AN00", (a, e) => DecryptAn00 (a, e)));
|
||||
table.Add (new Tuple<string, Decryptor> ("AN21", (a, e) => DecryptAn21 (a, e)));
|
||||
}
|
||||
m_type_table = table.ToArray();
|
||||
}
|
||||
|
||||
@@ -683,6 +687,34 @@ namespace GameRes.Formats.Kaguya
|
||||
return new BinMemoryStream (data, entry.Name);
|
||||
}
|
||||
|
||||
Stream DecryptAn21 (LinkArchive arc, LinkEntry entry)
|
||||
{
|
||||
var data = arc.File.View.ReadBytes (entry.Offset, entry.Size);
|
||||
int count = data.ToUInt16 (4);
|
||||
int offset = 8;
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
switch (data[offset++])
|
||||
{
|
||||
case 0: break;
|
||||
case 1: offset += 8; break;
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5: offset += 4; break;
|
||||
default: return new BinMemoryStream (data, entry.Name);
|
||||
}
|
||||
}
|
||||
count = data.ToUInt16 (offset);
|
||||
offset += 2 + count * 8 + 0x21;
|
||||
int w = data.ToInt32 (offset);
|
||||
int h = data.ToInt32 (offset+4);
|
||||
int channels = data.ToInt32 (offset+8);
|
||||
offset += 12;
|
||||
DecryptData (data, offset, channels * w * h);
|
||||
return new BinMemoryStream (data, entry.Name);
|
||||
}
|
||||
|
||||
void DecryptData (byte[] data, int index, int length)
|
||||
{
|
||||
while (length > 0)
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion ("1.2.32.1373")]
|
||||
[assembly: AssemblyFileVersion ("1.2.32.1373")]
|
||||
[assembly: AssemblyVersion ("1.2.33.1382")]
|
||||
[assembly: AssemblyFileVersion ("1.2.33.1382")]
|
||||
|
||||
Binary file not shown.
@@ -57,6 +57,7 @@ namespace GameRes.Formats.Will
|
||||
ArcOpener ()
|
||||
{
|
||||
Extensions = new string[] { "arc" };
|
||||
Signatures = new uint[] { 1, 0 };
|
||||
}
|
||||
|
||||
public override ArcFile TryOpen (ArcView file)
|
||||
|
||||
204
ArcFormats/YaneSDK/ArcHibiki.cs
Normal file
204
ArcFormats/YaneSDK/ArcHibiki.cs
Normal file
@@ -0,0 +1,204 @@
|
||||
//! \file ArcHibiki.cs
|
||||
//! \date Fri May 12 19:06:19 2017
|
||||
//! \brief Hibiki Works resource archive.
|
||||
//
|
||||
// Copyright (C) 2017 by morkt
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Composition;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using GameRes.Utility;
|
||||
|
||||
namespace GameRes.Formats.YaneSDK
|
||||
{
|
||||
[Export(typeof(ArchiveFormat))]
|
||||
public class HDatOpener : ArchiveFormat
|
||||
{
|
||||
public override string Tag { get { return "DAT/hibiki"; } }
|
||||
public override string Description { get { return "YaneSDK engine resource archive"; } }
|
||||
public override uint Signature { get { return 0; } }
|
||||
public override bool IsHierarchic { get { return false; } }
|
||||
public override bool CanWrite { get { return false; } }
|
||||
|
||||
public static readonly string SchemeFileName = "hibiki_works.dat";
|
||||
|
||||
public override ArcFile TryOpen (ArcView file)
|
||||
{
|
||||
if (!file.Name.HasExtension (".dat"))
|
||||
return null;
|
||||
int count = (short)(file.View.ReadUInt16 (0) ^ 0x8080);
|
||||
if (!IsSaneCount (count))
|
||||
return null;
|
||||
var scheme = QueryScheme (file.Name);
|
||||
if (null == scheme)
|
||||
return null;
|
||||
var dat_name = Path.GetFileName (file.Name).ToLowerInvariant();
|
||||
IList<HibikiTocRecord> toc_table = null;
|
||||
if (scheme.ArcMap != null && scheme.ArcMap.TryGetValue (dat_name, out toc_table))
|
||||
{
|
||||
if (toc_table.Count != count)
|
||||
toc_table = null;
|
||||
}
|
||||
var lst_name = Path.ChangeExtension (file.Name, ".lst");
|
||||
Stream input;
|
||||
if (VFS.FileExists (lst_name))
|
||||
input = VFS.OpenStream (lst_name);
|
||||
else
|
||||
input = file.CreateStream();
|
||||
|
||||
using (var dec = new XoredStream (input, 0x80))
|
||||
using (var index = new BinaryReader (dec))
|
||||
{
|
||||
const int name_length = 0x100;
|
||||
index.BaseStream.Position = 2;
|
||||
Func<int, Entry> read_entry;
|
||||
if (null == toc_table)
|
||||
{
|
||||
var name_buf = new byte[name_length];
|
||||
read_entry = i => {
|
||||
if (name_length != index.Read (name_buf, 0, name_length))
|
||||
return null;
|
||||
var name = Binary.GetCString (name_buf, 0);
|
||||
var entry = FormatCatalog.Instance.Create<Entry> (name);
|
||||
index.ReadUInt16();
|
||||
entry.Size = index.ReadUInt32();
|
||||
entry.Offset = index.ReadUInt32();
|
||||
return entry;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
read_entry = i => {
|
||||
index.BaseStream.Seek (name_length + 6, SeekOrigin.Current);
|
||||
index.ReadUInt32(); // throws in case of EOF
|
||||
var toc_entry = toc_table[i];
|
||||
var entry = FormatCatalog.Instance.Create<Entry> (toc_entry.Name);
|
||||
entry.Offset = toc_entry.Offset;
|
||||
entry.Size = toc_entry.Size;
|
||||
return entry;
|
||||
};
|
||||
}
|
||||
var dir = new List<Entry> (count);
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
var entry = read_entry (i);
|
||||
if (!entry.CheckPlacement (file.MaxOffset))
|
||||
return null;
|
||||
dir.Add (entry);
|
||||
}
|
||||
return new HibikiArchive (file, this, dir, scheme.ContentKey);
|
||||
}
|
||||
}
|
||||
|
||||
public override Stream OpenEntry (ArcFile arc, Entry entry)
|
||||
{
|
||||
var harc = arc as HibikiArchive;
|
||||
if (null == harc)
|
||||
return base.OpenEntry (arc, entry);
|
||||
var key = harc.Key;
|
||||
uint encrypted = Math.Min (entry.Size, (uint)key.Length);
|
||||
var header = arc.File.View.ReadBytes (entry.Offset, encrypted);
|
||||
for (int i = 0; i < header.Length; ++i)
|
||||
header[i] ^= key[i];
|
||||
if (encrypted == entry.Size)
|
||||
return new BinMemoryStream (header);
|
||||
var rest = arc.File.CreateStream (entry.Offset + encrypted, entry.Size - encrypted);
|
||||
return new PrefixStream (header, rest);
|
||||
}
|
||||
|
||||
HibikiDatScheme QueryScheme (string arc_name)
|
||||
{
|
||||
if (null == KnownSchemes)
|
||||
return null;
|
||||
// XXX add GUI widget to select scheme
|
||||
return KnownSchemes.Values.FirstOrDefault();
|
||||
}
|
||||
|
||||
static Lazy<HibikiScheme> s_Scheme = new Lazy<HibikiScheme> (DeserializeScheme);
|
||||
|
||||
internal IDictionary<string, HibikiDatScheme> KnownSchemes {
|
||||
get { return s_Scheme.Value.KnownSchemes; }
|
||||
}
|
||||
|
||||
static HibikiScheme DeserializeScheme ()
|
||||
{
|
||||
try
|
||||
{
|
||||
var dir = FormatCatalog.Instance.DataDirectory;
|
||||
var scheme_file = Path.Combine (dir, SchemeFileName);
|
||||
using (var input = File.OpenRead (scheme_file))
|
||||
{
|
||||
var bin = new BinaryFormatter();
|
||||
return (HibikiScheme)bin.Deserialize (input);
|
||||
}
|
||||
}
|
||||
catch (Exception X)
|
||||
{
|
||||
Trace.WriteLine (X.Message, "hibiki_works scheme deserialization failed");
|
||||
return new HibikiScheme();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class HibikiArchive : ArcFile
|
||||
{
|
||||
public readonly byte[] Key;
|
||||
|
||||
public HibikiArchive (ArcView arc, ArchiveFormat impl, ICollection<Entry> dir, byte[] key)
|
||||
: base (arc, impl, dir)
|
||||
{
|
||||
Key = key;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class HibikiScheme : ResourceScheme
|
||||
{
|
||||
public IDictionary<string, HibikiDatScheme> KnownSchemes;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class HibikiDatScheme
|
||||
{
|
||||
public byte[] ContentKey;
|
||||
public IDictionary<string, IList<HibikiTocRecord>> ArcMap;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class HibikiTocRecord
|
||||
{
|
||||
public string Name;
|
||||
public uint Offset;
|
||||
public uint Size;
|
||||
|
||||
public HibikiTocRecord (string name, uint offset, uint size)
|
||||
{
|
||||
Name = name;
|
||||
Offset = offset;
|
||||
Size = size;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<NuGetPackageImportStamp>9af0b529</NuGetPackageImportStamp>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -110,13 +111,6 @@
|
||||
<PreBuildEvent>perl "$(SolutionDir)inc-revision.pl" "$(ProjectPath)" $(ConfigurationName)
|
||||
exit 0</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\packages\System.Data.SQLite.Core.1.0.105.0\build\net45\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.105.0\build\net45\System.Data.SQLite.Core.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.105.0\build\net45\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.105.0\build\net45\System.Data.SQLite.Core.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
||||
@@ -51,5 +51,5 @@ using System.Windows;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion ("1.4.28.1865")]
|
||||
[assembly: AssemblyFileVersion ("1.4.28.1865")]
|
||||
[assembly: AssemblyVersion ("1.4.29.1874")]
|
||||
[assembly: AssemblyFileVersion ("1.4.29.1874")]
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion ("1.4.29.252")]
|
||||
[assembly: AssemblyFileVersion ("1.4.29.252")]
|
||||
[assembly: AssemblyVersion ("1.4.30.254")]
|
||||
[assembly: AssemblyFileVersion ("1.4.30.254")]
|
||||
|
||||
@@ -216,6 +216,7 @@ Baldr Sky DiveX<br/>
|
||||
Fossette ~Cafe au Le Ciel Bleu~<br/>
|
||||
Jinki Extend Re:Vision<br/>
|
||||
Maji de Watashi ni Koishinasai!<br/>
|
||||
Platinum<br/>
|
||||
Xross Scramble<br/>
|
||||
</td></tr>
|
||||
<tr><td>*.grp</td><td><tt>GR3</tt></td><td></td></tr>
|
||||
@@ -277,6 +278,7 @@ Akazukin to Mayoi no Mori<br/>
|
||||
Altered Pink ~Tokumu Sentai Duel Ranger~<br/>
|
||||
Amairo*Islenauts<br/>
|
||||
Aozora Gakko no Sensei-kun<br/>
|
||||
Aqua<br/>
|
||||
Bishuu ~Chigyaku no Mesu Dorei~<br/>
|
||||
Boku to Koi Suru Ponkotsu Akuma. Suggoi Ecchi!<br/>
|
||||
Cafe Sourire<br/>
|
||||
@@ -348,6 +350,7 @@ Specialite!<br/>
|
||||
Suiheisen made Nan Mile?<br/>
|
||||
Swan Song<br/>
|
||||
Teakamamire no Tenshi<br/>
|
||||
Toaru Jukujo no Hentai Choukyou<br/>
|
||||
Towazugatari ~Shoujo Ryoujoku Hishou~<br/>
|
||||
Ushinawareta Mirai o Motomete<br/>
|
||||
With Ribbon<br/>
|
||||
@@ -980,6 +983,7 @@ Moshimo Ashita ga Harenaraba<br/>
|
||||
<tr><td>*.gyu</td><td><tt>GYU\x1a</tt></td><td></td><td rowspan="2">ExHIBIT</td><td rowspan="2">
|
||||
Eve ~New Generation X~<br/>
|
||||
Fuyu no Rondo<br/>
|
||||
Imouto Paradise! 2<br/>
|
||||
Natural Another One 2nd -Belladonna-<br/>
|
||||
Oshiete Ecchi Na Recipe -Anata to Watashi no Ama~i Seikatsu!-<br/>
|
||||
</td></tr>
|
||||
@@ -1123,13 +1127,14 @@ Dokidoki Onee-san<br/>
|
||||
Harami Tama<br/>
|
||||
Mahokoi ~Ecchi na Mahou de Koi x Koi Shichau~<br/>
|
||||
Mainichi ga M!<br/>
|
||||
Meidokissa<br/>
|
||||
Ningyou no Yakata<br/>
|
||||
Osananajimi to Ama~ku Ecchi ni Sugosu Houhou<br/>
|
||||
Toshishita Gentei Nuki x2 Share-house<br/>
|
||||
</td></tr>
|
||||
<tr class="odd"><td>*.alp</td><td><tt>AP-0</tt><br/><tt>AP-2</tt></td><td></td></tr>
|
||||
<tr class="odd"><td>*.ap3</td><td><tt>\x04APS3</tt></td><td></td></tr>
|
||||
<tr class="odd last"><td>*.anm</td><td><tt>AN00</tt></td><td></td></tr>
|
||||
<tr class="odd last"><td>*.anm</td><td><tt>AN00</tt><br/><tt>AN21</tt></td><td></td></tr>
|
||||
<tr><td>*.pcs</td><td><tt>PCCS</tt></td><td></td><td>C's ware</td><td>
|
||||
Kuro to Kuro to Kuro no Saidan ~Kodoku~<br/>
|
||||
Mikan<br/>
|
||||
@@ -1171,7 +1176,6 @@ Angenehm Platz -Kleiner Garten Sie Erstellen-<br/>
|
||||
</td></tr>
|
||||
<tr class="odd"><td>*.arc</td><td><tt>ARCC</tt></td><td></td></tr>
|
||||
<tr class="odd last"><td>*.bin</td><td><tt>ODIO</tt></td><td></td></tr>
|
||||
</td></tr>
|
||||
<tr><td>*.eme</td><td><tt>RREDATA</tt></td><td></td><td>Emon Engine</td><td>
|
||||
Ase Nure Shoujo Misaki "Anata no Nioi de Icchau!"<br/>
|
||||
D-spray Biyaku de Motemote Kachou Dairi Hosa<br/>
|
||||
@@ -1584,6 +1588,9 @@ Seisai no Resonance<br/>
|
||||
Sengoku Hime 7<br/>
|
||||
</td></tr>
|
||||
<tr class="last"><td>*.ogg<br/>*.wav</td><td><tt>FSB5</tt></td><td></td></tr>
|
||||
<tr class="odd"><td>*.dat</td><td>-</td><td></td><td>YaneSDK?</td><td>
|
||||
Niizuma Lovely x Cation<br/>
|
||||
</td></tr>
|
||||
</table>
|
||||
<p><a name="note-1" class="footnote">1</a> Non-encrypted only</p>
|
||||
</body>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<GARbro>
|
||||
<Release>
|
||||
<Version>1.4.28</Version>
|
||||
<Version>1.4.29</Version>
|
||||
<Url>https://github.com/morkt/GARbro/releases/latest</Url>
|
||||
<Notes>Updated Chinese translation.
|
||||
|
||||
New formats:
|
||||
<Notes>New formats:
|
||||
- LINK6 archives variation, AN21 animation
|
||||
- DAT archives used in Niizuma Lovely x Cation
|
||||
- 'UnityFS' archives and FSB5 audio
|
||||
- GRP audio archives
|
||||
- more KiriKiri and ShiinaRio encryption schemes
|
||||
</Notes>
|
||||
</Release>
|
||||
<FormatsData>
|
||||
<FileVersion>63</FileVersion>
|
||||
<FileVersion>66</FileVersion>
|
||||
<Url>https://github.com/morkt/GARbro/raw/master/ArcFormats/Resources/Formats.dat</Url>
|
||||
<Requires>
|
||||
<Assembly Name="ArcFormats" Version="1.2.31.1367"/>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<repositories>
|
||||
<repository path="..\ArcFormats\packages.config" />
|
||||
<repository path="..\Experimental\packages.config" />
|
||||
<repository path="..\GameRes\packages.config" />
|
||||
<repository path="..\GUI\packages.config" />
|
||||
</repositories>
|
||||
Reference in New Issue
Block a user