Skip to content

Commit e2e13a6

Browse files
committed
FInd root key fix
1 parent cecc612 commit e2e13a6

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

Registry.Test/TestRegistryHive.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using NFluent;
66
using NLog;
77
using NUnit.Framework;
8+
using Registry.Cells;
89
using Registry.Other;
910

1011
namespace Registry.Test
@@ -663,12 +664,17 @@ public void HBinSizeShouldNotMatchReadSize()
663664
}
664665

665666
[Test]
666-
[Ignore("Unknown test source file.")]
667+
667668
public void OneOff()
668669
{
669-
var r = new RegistryHive(@"C:\Users\eric\Desktop\SAM");
670+
var r = new RegistryHive(@"C:\temp\SYSTEM");
670671
r.RecoverDeleted = true;
672+
r.FlushRecordListsAfterParse = false;
671673
r.ParseHive();
674+
675+
var sss = r.CellRecords.Values.OfType<NkCellRecord>().Where(f =>
676+
(f.Flags & NkCellRecord.FlagEnum.HiveEntryRootKey) == NkCellRecord.FlagEnum.HiveEntryRootKey);
677+
672678
}
673679

674680

Registry/Registry.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
<Copyright>Eric Zimmerman</Copyright>
1111
<PackageProjectUrl>https://github.com/EricZimmerman/Registry</PackageProjectUrl>
1212
<RepositoryUrl>https://github.com/EricZimmerman/Registry</RepositoryUrl>
13-
<AssemblyVersion>1.1.0.0</AssemblyVersion>
14-
<FileVersion>1.1.0.0</FileVersion>
15-
<Version>1.1.0.0</Version>
13+
<AssemblyVersion>1.1.0.1</AssemblyVersion>
14+
<FileVersion>1.1.0.1</FileVersion>
15+
<Version>1.1.0.1</Version>
16+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1617
</PropertyGroup>
1718

1819
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">

Registry/RegistryHive.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ public bool ParseHive()
958958
//here we are looking for the flag
959959
var rootNode =
960960
CellRecords.Values.OfType<NkCellRecord>()
961-
.SingleOrDefault(
961+
.FirstOrDefault(
962962
f =>
963963
(f.Flags & NkCellRecord.FlagEnum.HiveEntryRootKey) ==
964964
NkCellRecord.FlagEnum.HiveEntryRootKey);

0 commit comments

Comments
 (0)