From 3aa30bccd25a20b4d939b9bf87dd35402811b365 Mon Sep 17 00:00:00 2001 From: Dijji Date: Wed, 14 Sep 2016 10:13:46 +0100 Subject: [PATCH] Version 1.0 Fix problems reading compressed control structures --- MainWindow.xaml | 2 +- NDB.cs | 12 ++++++------ Properties/AssemblyInfo.cs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/MainWindow.xaml b/MainWindow.xaml index cafa586..0ff5333 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -170,7 +170,7 @@ - diff --git a/NDB.cs b/NDB.cs index 8b2cb61..00b3fc7 100644 --- a/NDB.cs +++ b/NDB.cs @@ -554,9 +554,9 @@ private void ReadSubNodeBtreeUnicode(FileStream fs, UInt64 subDataBid, TreeInter var rb = LookupDataBlock(subDataBid); if (rb == null) throw new Exception("SubNode data block does not exist"); - byte[] buffer = new byte[rb.Length]; - fs.Seek((long)rb.Offset, SeekOrigin.Begin); - fs.Read(buffer, 0, rb.Length); + + int read; + byte[] buffer = ReadAndDecompress(fs, rb, out read); var sl = Map.MapType(buffer); if (sl.cLevel > 0) @@ -590,9 +590,9 @@ private void ReadSubNodeBtreeANSI(FileStream fs, UInt64 subDataBid, TreeIntermed var rb = LookupDataBlock(subDataBid); if (rb == null) throw new Exception("SubNode data block does not exist"); - byte[] buffer = new byte[rb.Length]; - fs.Seek((long)rb.Offset, SeekOrigin.Begin); - fs.Read(buffer, 0, rb.Length); + + int read; + byte[] buffer = ReadAndDecompress(fs, rb, out read); var sl = Map.MapType(buffer); if (sl.cLevel > 0) diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index bcfbc63..d08f34e 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -51,4 +51,4 @@ // 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("0.9.*")] +[assembly: AssemblyVersion("1.0.*")]