Formatting and added hash validation

This commit is contained in:
klks 2018-06-23 23:58:42 +08:00
parent e65a64030f
commit 2e96015a85
5 changed files with 1248 additions and 988 deletions

View file

@ -7,11 +7,11 @@ using System.Runtime.Versioning;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("XCI Explorer v1.1.0.0")]
[assembly: AssemblyTitle("XCI Explorer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("XCI Explorer v1.1.0.0")]
[assembly: AssemblyProduct("XCI Explorer")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]

View file

@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputType>WinExe</OutputType>
<AssemblyName>XCI-Explorer-v1.1.0.0</AssemblyName>
<AssemblyName>XCI-Explorer</AssemblyName>
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<WarningLevel>4</WarningLevel>
@ -72,5 +72,10 @@
<Compile Include="XTSSharp\XtsSectorStream.cs" />
<Compile Include="XTSSharp\XtsStream.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="XCI_Explorer\MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -2,15 +2,17 @@ using System.Windows.Forms;
namespace XCI_Explorer.Helpers
{
public class BetterTreeNode : TreeNode
{
public long Offset;
public class BetterTreeNode : TreeNode
{
public long Offset;
public long Size;
public string ExpectedHash;
public string ActualHash;
public long HashedRegionSize;
public long Size;
public BetterTreeNode(string t)
{
base.Text = t;
}
}
public BetterTreeNode(string t)
{
base.Text = t;
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -3,30 +3,38 @@ using XCI_Explorer.Helpers;
namespace XCI_Explorer
{
public class TreeViewFileSystem
{
public TreeView treeView;
public class TreeViewFileSystem
{
public TreeView treeView;
public TreeViewFileSystem(TreeView tv)
{
}
public TreeViewFileSystem(TreeView tv)
{
}
public BetterTreeNode AddDir(string name, BetterTreeNode parent = null)
{
BetterTreeNode betterTreeNode = new BetterTreeNode(name);
betterTreeNode.Offset = -1L;
betterTreeNode.Size = -1L;
parent.Nodes.Add(betterTreeNode);
return betterTreeNode;
}
public BetterTreeNode AddDir(string name, BetterTreeNode parent = null)
{
BetterTreeNode betterTreeNode = new BetterTreeNode(name);
betterTreeNode.Offset = -1L;
betterTreeNode.Size = -1L;
parent.Nodes.Add(betterTreeNode);
return betterTreeNode;
}
public BetterTreeNode AddFile(string name, BetterTreeNode parent, long offset, long size)
{
BetterTreeNode betterTreeNode = new BetterTreeNode(name);
betterTreeNode.Offset = offset;
betterTreeNode.Size = size;
parent.Nodes.Add(betterTreeNode);
return betterTreeNode;
}
}
public BetterTreeNode AddFile(string name, BetterTreeNode parent, long offset, long size)
{
return AddFile(name, parent, offset, size, 0, "", "");
}
public BetterTreeNode AddFile(string name, BetterTreeNode parent, long offset, long size, long HashedRegionSize, string ExpectedHash, string ActualHash)
{
BetterTreeNode betterTreeNode = new BetterTreeNode(name);
betterTreeNode.Offset = offset;
betterTreeNode.Size = size;
betterTreeNode.ExpectedHash = ExpectedHash;
betterTreeNode.ActualHash = ActualHash;
betterTreeNode.HashedRegionSize = HashedRegionSize;
parent.Nodes.Add(betterTreeNode);
return betterTreeNode;
}
}
}