Skip to content

Commit

Permalink
Upload
Browse files Browse the repository at this point in the history
  • Loading branch information
jianmingyong committed Aug 5, 2022
0 parents commit 65f4456
Show file tree
Hide file tree
Showing 50 changed files with 10,698 additions and 0 deletions.
662 changes: 662 additions & 0 deletions .gitignore

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions .idea/.idea.Fossil Fighters Tool/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/.idea.Fossil Fighters Tool/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/.idea.Fossil Fighters Tool/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/.idea.Fossil Fighters Tool/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions CSharp/DSDecmp.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DSDecmp", "DSDecmp\DSDecmp.csproj", "{E6F419F9-D6B5-4BE7-99BB-97C48C927FF3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GoldenSunDD", "GoldenSunDD\GoldenSunDD.csproj", "{8CE72663-0036-4A94-BD70-99AFE7CEEC0C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LuminousArc", "LuminousArc\LuminousArc.csproj", "{4BD8DF5C-E971-45D1-B170-340D22DDB351}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "Tester\Tester.csproj", "{A4FABF4B-59F2-4D4B-9012-FF177980EAB7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E6F419F9-D6B5-4BE7-99BB-97C48C927FF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E6F419F9-D6B5-4BE7-99BB-97C48C927FF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E6F419F9-D6B5-4BE7-99BB-97C48C927FF3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{E6F419F9-D6B5-4BE7-99BB-97C48C927FF3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{E6F419F9-D6B5-4BE7-99BB-97C48C927FF3}.Debug|x86.ActiveCfg = Debug|Any CPU
{E6F419F9-D6B5-4BE7-99BB-97C48C927FF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E6F419F9-D6B5-4BE7-99BB-97C48C927FF3}.Release|Any CPU.Build.0 = Release|Any CPU
{E6F419F9-D6B5-4BE7-99BB-97C48C927FF3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{E6F419F9-D6B5-4BE7-99BB-97C48C927FF3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{E6F419F9-D6B5-4BE7-99BB-97C48C927FF3}.Release|x86.ActiveCfg = Release|Any CPU
{8CE72663-0036-4A94-BD70-99AFE7CEEC0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8CE72663-0036-4A94-BD70-99AFE7CEEC0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8CE72663-0036-4A94-BD70-99AFE7CEEC0C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{8CE72663-0036-4A94-BD70-99AFE7CEEC0C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{8CE72663-0036-4A94-BD70-99AFE7CEEC0C}.Debug|x86.ActiveCfg = Debug|Any CPU
{8CE72663-0036-4A94-BD70-99AFE7CEEC0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8CE72663-0036-4A94-BD70-99AFE7CEEC0C}.Release|Any CPU.Build.0 = Release|Any CPU
{8CE72663-0036-4A94-BD70-99AFE7CEEC0C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{8CE72663-0036-4A94-BD70-99AFE7CEEC0C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{8CE72663-0036-4A94-BD70-99AFE7CEEC0C}.Release|x86.ActiveCfg = Release|Any CPU
{4BD8DF5C-E971-45D1-B170-340D22DDB351}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4BD8DF5C-E971-45D1-B170-340D22DDB351}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4BD8DF5C-E971-45D1-B170-340D22DDB351}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{4BD8DF5C-E971-45D1-B170-340D22DDB351}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{4BD8DF5C-E971-45D1-B170-340D22DDB351}.Debug|x86.ActiveCfg = Debug|Any CPU
{4BD8DF5C-E971-45D1-B170-340D22DDB351}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4BD8DF5C-E971-45D1-B170-340D22DDB351}.Release|Any CPU.Build.0 = Release|Any CPU
{4BD8DF5C-E971-45D1-B170-340D22DDB351}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{4BD8DF5C-E971-45D1-B170-340D22DDB351}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{4BD8DF5C-E971-45D1-B170-340D22DDB351}.Release|x86.ActiveCfg = Release|Any CPU
{A4FABF4B-59F2-4D4B-9012-FF177980EAB7}.Debug|Any CPU.ActiveCfg = Debug|x86
{A4FABF4B-59F2-4D4B-9012-FF177980EAB7}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{A4FABF4B-59F2-4D4B-9012-FF177980EAB7}.Debug|Mixed Platforms.Build.0 = Debug|x86
{A4FABF4B-59F2-4D4B-9012-FF177980EAB7}.Debug|x86.ActiveCfg = Debug|x86
{A4FABF4B-59F2-4D4B-9012-FF177980EAB7}.Debug|x86.Build.0 = Debug|x86
{A4FABF4B-59F2-4D4B-9012-FF177980EAB7}.Release|Any CPU.ActiveCfg = Release|x86
{A4FABF4B-59F2-4D4B-9012-FF177980EAB7}.Release|Mixed Platforms.ActiveCfg = Release|x86
{A4FABF4B-59F2-4D4B-9012-FF177980EAB7}.Release|Mixed Platforms.Build.0 = Release|x86
{A4FABF4B-59F2-4D4B-9012-FF177980EAB7}.Release|x86.ActiveCfg = Release|x86
{A4FABF4B-59F2-4D4B-9012-FF177980EAB7}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
77 changes: 77 additions & 0 deletions CSharp/DSDecmp/DSDecmp.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E6F419F9-D6B5-4BE7-99BB-97C48C927FF3}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DSDecmp</RootNamespace>
<AssemblyName>DSDecmp</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile>bin\Release\DSDecmp.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Exceptions\InputTooLargeException.cs" />
<Compile Include="Exceptions\NotEnoughDataException.cs" />
<Compile Include="Exceptions\StreamTooShortException.cs" />
<Compile Include="Exceptions\TooMuchInputException.cs" />
<Compile Include="Formats\CompressionFormat.cs" />
<Compile Include="Formats\LZOvl.cs" />
<Compile Include="Formats\CompositeFormat.cs" />
<Compile Include="Formats\Nitro\CompositeFormats.cs" />
<Compile Include="Formats\Nitro\Huffman.cs" />
<Compile Include="Formats\Nitro\LZ10.cs" />
<Compile Include="Formats\Nitro\LZ11.cs" />
<Compile Include="Formats\Nitro\NitroCFormat.cs" />
<Compile Include="Formats\Nitro\NullCompression.cs" />
<Compile Include="Formats\Nitro\RLE.cs" />
<Compile Include="NewestProgram.cs" />
<Compile Include="TestProgram.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utils\IOUtils.cs" />
<Compile Include="Utils\LZUtil.cs" />
<Compile Include="Utils\SimpleReversePrioQueue.cs" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- 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">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
20 changes: 20 additions & 0 deletions CSharp/DSDecmp/Exceptions/InputTooLargeException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace DSDecmp
{
/// <summary>
/// An exception indicating that the file cannot be compressed, because the decompressed size
/// cannot be represented in the current compression format.
/// </summary>
public class InputTooLargeException : Exception
{
/// <summary>
/// Creates a new exception that indicates that the input is too big to be compressed.
/// </summary>
public InputTooLargeException()
: base("The compression ratio is not high enough to fit the input "
+ "in a single compressed file.") { }
}
}
39 changes: 39 additions & 0 deletions CSharp/DSDecmp/Exceptions/NotEnoughDataException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace DSDecmp
{
/// <summary>
/// An exception that is thrown by the decompression functions when there
/// is not enough data available in order to properly decompress the input.
/// </summary>
public class NotEnoughDataException : IOException
{
private long currentOutSize;
private long totalOutSize;
/// <summary>
/// Gets the actual number of written bytes.
/// </summary>
public long WrittenLength { get { return this.currentOutSize; } }
/// <summary>
/// Gets the number of bytes that was supposed to be written.
/// </summary>
public long DesiredLength { get { return this.totalOutSize; } }

/// <summary>
/// Creates a new NotEnoughDataException.
/// </summary>
/// <param name="currentOutSize">The actual number of written bytes.</param>
/// <param name="totalOutSize">The desired number of written bytes.</param>
public NotEnoughDataException(long currentOutSize, long totalOutSize)
: base("Not enough data availble; 0x" + currentOutSize.ToString("X")
+ " of " + (totalOutSize < 0 ? "???" : ("0x" + totalOutSize.ToString("X")))
+ " bytes written.")
{
this.currentOutSize = currentOutSize;
this.totalOutSize = totalOutSize;
}
}
}
22 changes: 22 additions & 0 deletions CSharp/DSDecmp/Exceptions/StreamTooShortException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace DSDecmp
{
/// <summary>
/// An exception thrown by the compression or decompression function, indicating that the
/// given input length was too large for the given input stream.
/// </summary>
public class StreamTooShortException : EndOfStreamException
{
/// <summary>
/// Creates a new exception that indicates that the stream was shorter than the given input length.
/// </summary>
public StreamTooShortException()
: base("The end of the stream was reached "
+ "before the given amout of data was read.")
{ }
}
}
32 changes: 32 additions & 0 deletions CSharp/DSDecmp/Exceptions/TooMuchInputException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace DSDecmp
{
/// <summary>
/// An exception indication that the input has more data than required in order
/// to decompress it. This may indicate that more sub-files are present in the file.
/// </summary>
public class TooMuchInputException : Exception
{
/// <summary>
/// Gets the number of bytes read by the decompressed to decompress the stream.
/// </summary>
public long ReadBytes { get; private set; }

/// <summary>
/// Creates a new exception indicating that the input has more data than necessary for
/// decompressing th stream. It may indicate that other data is present after the compressed
/// stream.
/// </summary>
/// <param name="readBytes">The number of bytes read by the decompressor.</param>
/// <param name="totLength">The indicated length of the input stream.</param>
public TooMuchInputException(long readBytes, long totLength)
: base("The input contains more data than necessary. Only used 0x"
+ readBytes.ToString("X") + " of 0x" + totLength.ToString("X") + " bytes")
{
this.ReadBytes = readBytes;
}
}
}
Loading

0 comments on commit 65f4456

Please sign in to comment.