Add files via upload

This commit is contained in:
NintenHero 2024-03-03 09:32:36 -06:00 committed by GitHub
parent 761adbc774
commit 09e74e7fe9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>PixelJunk_Extractor</RootNamespace>
</PropertyGroup>
</Project>

25
PixelJunk-Extractor.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.34407.143
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PixelJunk-Extractor", "PixelJunk-Extractor.csproj", "{B0258C13-FA28-4FD4-BF94-A440FA18F660}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B0258C13-FA28-4FD4-BF94-A440FA18F660}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0258C13-FA28-4FD4-BF94-A440FA18F660}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0258C13-FA28-4FD4-BF94-A440FA18F660}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0258C13-FA28-4FD4-BF94-A440FA18F660}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DC7C07EB-5779-46C6-A4C6-C692F5933451}
EndGlobalSection
EndGlobal

50
Program.cs Normal file
View File

@ -0,0 +1,50 @@
using System.IO;
using System.IO.Compression;
namespace PixelJunk_Extractor
{
class Program
{
static void Main(string[] args)
{
using FileStream pkiwin = File.OpenRead(args[0] + "//shooter.pkiwin");
BinaryReader br = new(pkiwin);
Directory.CreateDirectory(args[0] + "//shooter");
br.BaseStream.Position = 8;
SUBFILE[] subfiles = new SUBFILE[br.ReadInt32()];
for (int i = 0; i < subfiles.Length; i++)
{
subfiles[i].sizeUncompressed = br.ReadInt32();//unknown
subfiles[i].sizeCompressed = br.ReadInt32();
subfiles[i].offset = br.ReadInt32();
br.ReadInt32();//unknown
}
int n = 0;
using FileStream pkdwin = File.OpenRead(args[0] + "//shooter.pkdwin");
foreach (SUBFILE sub in subfiles)
{
br = new(pkdwin);
br.BaseStream.Position = sub.offset;
using FileStream FS = File.Create(args[0] + "//shooter//" + n);
BinaryWriter bw = new(FS);
MemoryStream ms = new();
br.ReadInt16();
using (var ds = new DeflateStream(new MemoryStream(br.ReadBytes(sub.sizeCompressed)), CompressionMode.Decompress))
ds.CopyTo(ms);
br = new(ms);
br.BaseStream.Position = 0;
bw.Write(br.ReadBytes(sub.sizeUncompressed));
bw.Close();
n++;
}
br.Close();
}
}
struct SUBFILE
{
public int sizeUncompressed;
public int sizeCompressed;
public int offset;
}
}