committed by
GitHub
3 changed files with 84 additions and 0 deletions
@ -0,0 +1,9 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<OutputType>Exe</OutputType> |
|||
<TargetFramework>net5.0</TargetFramework> |
|||
<RootNamespace>PixelJunk_Extractor</RootNamespace> |
|||
</PropertyGroup> |
|||
|
|||
</Project> |
@ -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 |
@ -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; |
|||
} |
|||
} |
Loading…
Reference in new issue