Merge pull request #1 from KuromeSan/v1.0

Add files via upload
This commit is contained in:
Bluzume 2020-07-15 03:13:02 +12:00 committed by GitHub
commit 1768ab54ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 36750 additions and 0 deletions

25
RundataTools.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30114.105
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RundataTools", "RundataTools\RundataTools.csproj", "{66BEC36F-831A-465D-A07C-1D64ECFB0FCB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{66BEC36F-831A-465D-A07C-1D64ECFB0FCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66BEC36F-831A-465D-A07C-1D64ECFB0FCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66BEC36F-831A-465D-A07C-1D64ECFB0FCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66BEC36F-831A-465D-A07C-1D64ECFB0FCB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {11EFBC76-1011-4FF8-B0A2-9B91C1A3DC86}
EndGlobalSection
EndGlobal

6
RundataTools/App.config Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

55
RundataTools/Program.cs Normal file
View File

@ -0,0 +1,55 @@
using Ionic.Zlib;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RundataTools
{
class Program
{
static int ReadInt32(Stream str)
{
byte[] intBytes = new byte[4];
str.Read(intBytes, 0, 4);
return BitConverter.ToInt32(intBytes, 0);
}
static void WriteInt32(Stream str,int i)
{
byte[] intBytes = BitConverter.GetBytes(i);
str.Write(intBytes, 0, 4);
}
static byte[] Compress(byte[] buffer)
{
MemoryStream ms = new MemoryStream();
ZlibStream str = new ZlibStream(ms, CompressionMode.Compress, CompressionLevel.Level6, true);
str.Write(buffer, 0x00, buffer.Length);
str.Close();
ms.Seek(0x00, SeekOrigin.Begin);
return ms.ToArray();
}
static void Main(string[] args)
{
if(args[0] == "-d")
{
FileStream fs = File.OpenRead(args[1]);
int BufferSz = ReadInt32(fs);
byte[] RunDataBuffer = new byte[BufferSz];
fs.Read(RunDataBuffer, 0x00, BufferSz);
byte[] RunDataUncompressed = ZlibStream.UncompressBuffer(RunDataBuffer);
File.WriteAllBytes(args[2], RunDataUncompressed);
}
if(args[0] == "-e")
{
byte[] RunDataUncompressed = File.ReadAllBytes(args[1]);
FileStream fs = File.OpenWrite(args[2]);
byte[] RunDataCompressed = Compress(RunDataUncompressed);
WriteInt32(fs, RunDataCompressed.Length);
fs.Write(RunDataCompressed, 0x00, RunDataCompressed.Length);
}
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RundataTools")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RundataTools")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("66bec36f-831a-465d-a07c-1d64ecfb0fcb")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// 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.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{66BEC36F-831A-465D-A07C-1D64ECFB0FCB}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>RundataTools</RootNamespace>
<AssemblyName>RundataTools</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="DotNetZip, Version=1.13.8.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
<HintPath>..\packages\DotNetZip.1.13.8\lib\net40\DotNetZip.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DotNetZip" version="1.13.8" targetFramework="net472" />
</packages>

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff