mirror of
https://github.com/StudentBlake/XCI-Explorer
synced 2024-11-24 21:23:02 +00:00
Removed old code, changed target framework to latest
This commit is contained in:
parent
ee752c1e3c
commit
ae0ff7a7dd
6 changed files with 18 additions and 153 deletions
|
@ -11,9 +11,9 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("XCI Explorer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2018")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: Guid("206c6c47-87b1-477f-b6e6-f7e7c1a92f8f")]
|
||||
[assembly: AssemblyFileVersion("1.4.5.0")]
|
||||
[assembly: AssemblyVersion("1.4.5.0")]
|
||||
[assembly: AssemblyFileVersion("1.4.6.0")]
|
||||
[assembly: AssemblyVersion("1.4.6.0")]
|
||||
|
|
12
README.md
12
README.md
|
@ -5,7 +5,7 @@
|
|||
View contents of XCI files and more!
|
||||
|
||||
## Features
|
||||
* View metadata
|
||||
* View metadata for XCI and NSP files
|
||||
* Explore partitions
|
||||
* Check NCA hashes
|
||||
* Extract NCA
|
||||
|
@ -13,18 +13,18 @@ View contents of XCI files and more!
|
|||
|
||||
Main | Partitions
|
||||
:-------------------------:|:-------------------------:
|
||||
![main](https://i.imgur.com/JvmhkPW.jpg) | ![partitions](https://i.imgur.com/x5Kqp9I.jpg)
|
||||
![main](https://cdn.discordapp.com/attachments/377518386826969088/567048477058662401/1.JPG) | ![partitions](https://cdn.discordapp.com/attachments/377518386826969088/567048488823554051/2.JPG)
|
||||
|
||||
## Build Requirements
|
||||
* Visual Studio 2017
|
||||
* [Hactool](https://github.com/SciresM/hactool/releases)
|
||||
* [Dumped keys](https://gbatemp.net/threads/how-to-get-switch-keys-for-hactool-xci-decrypting.506978/)
|
||||
* [Visual Studio Community 2019](https://visualstudio.microsoft.com/downloads/)
|
||||
* [hactool](https://github.com/SciresM/hactool/releases)
|
||||
* [Lockpick](https://gbatemp.net/threads/switch-7-0-key-derivation-lockpick_rcm-payload.532916/)
|
||||
|
||||
## Build Instructions
|
||||
* Open **XCI Explorer.sln**
|
||||
* Change *Debug* to *Release* in the dropdown menu
|
||||
* Go to *Build*, then *Build Solution*
|
||||
* Extract **hactool.zip** to `XCI-Explorer/bin/Release/` folder
|
||||
* Extract **hactool.zip** to `XCI-Explorer/bin/Release/tools/` folder
|
||||
* Run **XCI-Explorer.exe**
|
||||
|
||||
## Special Thanks
|
||||
|
|
|
@ -7,11 +7,12 @@
|
|||
<OutputType>WinExe</OutputType>
|
||||
<AssemblyName>XCI-Explorer</AssemblyName>
|
||||
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
@ -97,6 +98,7 @@
|
|||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27703.2026
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.28803.156
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XCI Explorer", "XCI Explorer.csproj", "{89DBE891-22C7-40FF-A3D3-36F26224E09D}"
|
||||
EndProject
|
||||
|
@ -20,6 +20,6 @@ Global
|
|||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {1F73AFFB-5BC0-4923-9D40-CD671B603EC9}
|
||||
SolutionGuid = {F9C853DD-FEA7-470E-B594-C72A1C93ECBB}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -758,146 +758,6 @@ namespace XCI_Explorer
|
|||
return ByteArrayToString(hashValue);
|
||||
}
|
||||
|
||||
private void LoadPartitionsOld()
|
||||
{
|
||||
string actualHash;
|
||||
byte[] hashBuffer;
|
||||
long offset;
|
||||
|
||||
TV_Partitions.Nodes.Clear();
|
||||
TV_Parti = new TreeViewFileSystem(TV_Partitions);
|
||||
rootNode = new BetterTreeNode("root");
|
||||
rootNode.Offset = -1L;
|
||||
rootNode.Size = -1L;
|
||||
TV_Partitions.Nodes.Add(rootNode);
|
||||
FileStream fileStream = new FileStream(TB_File.Text, FileMode.Open, FileAccess.Read);
|
||||
HFS0.HSF0_Entry[] array = new HFS0.HSF0_Entry[HFS0.HFS0_Headers[0].FileCount];
|
||||
fileStream.Position = XCI.XCI_Headers[0].HFS0OffsetPartition + 16 + 64 * HFS0.HFS0_Headers[0].FileCount;
|
||||
long num = XCI.XCI_Headers[0].HFS0OffsetPartition + XCI.XCI_Headers[0].HFS0SizeParition;
|
||||
byte[] array2 = new byte[64];
|
||||
byte[] array3 = new byte[16];
|
||||
byte[] array4 = new byte[24];
|
||||
for (int i = 0; i < HFS0.HFS0_Headers[0].FileCount; i++)
|
||||
{
|
||||
fileStream.Position = XCI.XCI_Headers[0].HFS0OffsetPartition + 16 + 64 * i;
|
||||
fileStream.Read(array2, 0, 64);
|
||||
array[i] = new HFS0.HSF0_Entry(array2);
|
||||
fileStream.Position = XCI.XCI_Headers[0].HFS0OffsetPartition + 16 + 64 * HFS0.HFS0_Headers[0].FileCount + array[i].Name_ptr;
|
||||
int num2;
|
||||
while ((num2 = fileStream.ReadByte()) != 0 && num2 != 0)
|
||||
{
|
||||
chars.Add((char)num2);
|
||||
}
|
||||
array[i].Name = new string(chars.ToArray());
|
||||
chars.Clear();
|
||||
|
||||
offset = num + array[i].Offset;
|
||||
hashBuffer = new byte[array[i].HashedRegionSize];
|
||||
fileStream.Position = offset;
|
||||
fileStream.Read(hashBuffer, 0, array[i].HashedRegionSize);
|
||||
actualHash = SHA256Bytes(hashBuffer);
|
||||
|
||||
TV_Parti.AddFile(array[i].Name + ".hfs0", rootNode, offset, array[i].Size, array[i].HashedRegionSize, ByteArrayToString(array[i].Hash), actualHash);
|
||||
BetterTreeNode betterTreeNode = TV_Parti.AddDir(array[i].Name, rootNode);
|
||||
HFS0.HFS0_Header[] array5 = new HFS0.HFS0_Header[1];
|
||||
fileStream.Position = array[i].Offset + num;
|
||||
fileStream.Read(array3, 0, 16);
|
||||
array5[0] = new HFS0.HFS0_Header(array3);
|
||||
if (array[i].Name == "secure")
|
||||
{
|
||||
SecureSize = new long[array5[0].FileCount];
|
||||
SecureOffset = new long[array5[0].FileCount];
|
||||
SecureName = new string[array5[0].FileCount];
|
||||
}
|
||||
if (array[i].Name == "normal")
|
||||
{
|
||||
NormalSize = new long[array5[0].FileCount];
|
||||
NormalOffset = new long[array5[0].FileCount];
|
||||
}
|
||||
HFS0.HSF0_Entry[] array6 = new HFS0.HSF0_Entry[array5[0].FileCount];
|
||||
for (int j = 0; j < array5[0].FileCount; j++)
|
||||
{
|
||||
fileStream.Position = array[i].Offset + num + 16 + 64 * j;
|
||||
fileStream.Read(array2, 0, 64);
|
||||
array6[j] = new HFS0.HSF0_Entry(array2);
|
||||
fileStream.Position = array[i].Offset + num + 16 + 64 * array5[0].FileCount + array6[j].Name_ptr;
|
||||
while ((num2 = fileStream.ReadByte()) != 0 && num2 != 0)
|
||||
{
|
||||
chars.Add((char)num2);
|
||||
}
|
||||
array6[j].Name = new string(chars.ToArray());
|
||||
chars.Clear();
|
||||
if (array[i].Name == "secure")
|
||||
{
|
||||
SecureSize[j] = array6[j].Size;
|
||||
SecureOffset[j] = array[i].Offset + array6[j].Offset + num + 16 + array5[0].StringTableSize + array5[0].FileCount * 64;
|
||||
SecureName[j] = array6[j].Name;
|
||||
}
|
||||
if (array[i].Name == "normal")
|
||||
{
|
||||
NormalSize[j] = array6[j].Size;
|
||||
NormalOffset[j] = array[i].Offset + array6[j].Offset + num + 16 + array5[0].StringTableSize + array5[0].FileCount * 64;
|
||||
}
|
||||
|
||||
offset = array[i].Offset + array6[j].Offset + num + 16 + array5[0].StringTableSize + array5[0].FileCount * 64;
|
||||
hashBuffer = new byte[array6[j].HashedRegionSize];
|
||||
fileStream.Position = offset;
|
||||
fileStream.Read(hashBuffer, 0, array6[j].HashedRegionSize);
|
||||
actualHash = SHA256Bytes(hashBuffer);
|
||||
|
||||
TV_Parti.AddFile(array6[j].Name, betterTreeNode, offset, array6[j].Size, array6[j].HashedRegionSize, ByteArrayToString(array6[j].Hash), actualHash);
|
||||
TreeNode[] array7 = TV_Partitions.Nodes.Find(betterTreeNode.Text, true);
|
||||
if (array7.Length != 0)
|
||||
{
|
||||
TV_Parti.AddFile(array6[j].Name, (BetterTreeNode)array7[0], 0L, 0L);
|
||||
}
|
||||
}
|
||||
}
|
||||
long num3 = -9223372036854775808L;
|
||||
for (int k = 0; k < SecureSize.Length; k++)
|
||||
{
|
||||
if (SecureSize[k] > num3)
|
||||
{
|
||||
gameNcaSize = SecureSize[k];
|
||||
gameNcaOffset = SecureOffset[k];
|
||||
num3 = SecureSize[k];
|
||||
}
|
||||
}
|
||||
PFS0Offset = gameNcaOffset + 32768;
|
||||
fileStream.Position = PFS0Offset;
|
||||
fileStream.Read(array3, 0, 16);
|
||||
PFS0.PFS0_Headers[0] = new PFS0.PFS0_Header(array3);
|
||||
PFS0.PFS0_Entry[] array8;
|
||||
array8 = new PFS0.PFS0_Entry[PFS0.PFS0_Headers[0].FileCount];
|
||||
for (int m = 0; m < PFS0.PFS0_Headers[0].FileCount; m++)
|
||||
{
|
||||
fileStream.Position = PFS0Offset + 16 + 24 * m;
|
||||
fileStream.Read(array4, 0, 24);
|
||||
array8[m] = new PFS0.PFS0_Entry(array4);
|
||||
PFS0Size += array8[m].Size;
|
||||
}
|
||||
TV_Parti.AddFile("boot.psf0", rootNode, PFS0Offset, 16 + 24 * PFS0.PFS0_Headers[0].FileCount + 64 + PFS0Size);
|
||||
BetterTreeNode betterTreeNode2 = TV_Parti.AddDir("boot", rootNode);
|
||||
for (int n = 0; n < PFS0.PFS0_Headers[0].FileCount; n++)
|
||||
{
|
||||
fileStream.Position = PFS0Offset + 16 + 24 * PFS0.PFS0_Headers[0].FileCount + array8[n].Name_ptr;
|
||||
int num4;
|
||||
while ((num4 = fileStream.ReadByte()) != 0 && num4 != 0)
|
||||
{
|
||||
chars.Add((char)num4);
|
||||
}
|
||||
array8[n].Name = new string(chars.ToArray());
|
||||
chars.Clear();
|
||||
TV_Parti.AddFile(array8[n].Name, betterTreeNode2, PFS0Offset + array8[n].Offset + 16 + PFS0.PFS0_Headers[0].StringTableSize + PFS0.PFS0_Headers[0].FileCount * 24, array8[n].Size);
|
||||
TreeNode[] array9 = TV_Partitions.Nodes.Find(betterTreeNode2.Text, true);
|
||||
if (array9.Length != 0)
|
||||
{
|
||||
TV_Parti.AddFile(array8[n].Name, (BetterTreeNode)array9[0], 0L, 0L);
|
||||
}
|
||||
}
|
||||
fileStream.Close();
|
||||
}
|
||||
|
||||
private void LoadPartitions()
|
||||
{
|
||||
string actualHash;
|
||||
|
|
3
app.config
Normal file
3
app.config
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
|
Loading…
Reference in a new issue