@@ -44,24 +44,24 @@ private void ReadNodeStructure(BinaryReader hive) {
44
44
45
45
hive . BaseStream . Position += 4 ;
46
46
47
- this . ParentOffset = BitConverter . ToInt32 ( hive . ReadBytes ( 4 ) , 0 ) ;
48
- this . SubkeysCount = BitConverter . ToInt32 ( hive . ReadBytes ( 4 ) , 0 ) ;
47
+ this . ParentOffset = hive . ReadInt32 ( ) ;
48
+ this . SubkeysCount = hive . ReadInt32 ( ) ;
49
49
50
50
hive . BaseStream . Position += 4 ;
51
51
52
- this . LFRecordOffset = BitConverter . ToInt32 ( hive . ReadBytes ( 4 ) , 0 ) ;
52
+ this . LFRecordOffset = hive . ReadInt32 ( ) ;
53
53
54
54
hive . BaseStream . Position += 4 ;
55
55
56
- this . ValuesCount = BitConverter . ToInt32 ( hive . ReadBytes ( 4 ) , 0 ) ;
57
- this . ValueListOffset = BitConverter . ToInt32 ( hive . ReadBytes ( 4 ) , 0 ) ;
58
- this . SecurityKeyOffset = BitConverter . ToInt32 ( hive . ReadBytes ( 4 ) , 0 ) ;
59
- this . ClassnameOffset = BitConverter . ToInt32 ( hive . ReadBytes ( 4 ) , 0 ) ;
56
+ this . ValuesCount = hive . ReadInt32 ( ) ;
57
+ this . ValueListOffset = hive . ReadInt32 ( ) ;
58
+ this . SecurityKeyOffset = hive . ReadInt32 ( ) ;
59
+ this . ClassnameOffset = hive . ReadInt32 ( ) ;
60
60
61
- hive . BaseStream . Position += ( startingOffset + 0x0044 ) - hive . BaseStream . Position ;
61
+ hive . BaseStream . Position += ( startingOffset + 68 ) - hive . BaseStream . Position ;
62
62
63
- this . NameLength = BitConverter . ToInt16 ( hive . ReadBytes ( 2 ) , 0 ) ;
64
- this . ClassnameLength = BitConverter . ToInt16 ( hive . ReadBytes ( 2 ) , 0 ) ;
63
+ this . NameLength = hive . ReadInt16 ( ) ;
64
+ this . ClassnameLength = hive . ReadInt16 ( ) ;
65
65
66
66
buf = hive . ReadBytes ( this . NameLength ) ;
67
67
this . Name = System . Text . Encoding . UTF8 . GetString ( buf ) ;
@@ -77,11 +77,11 @@ private void ReadChildrenNodes(BinaryReader hive) {
77
77
78
78
//ri
79
79
if ( buf [ 0 ] == 0x72 && buf [ 1 ] == 0x69 ) {
80
- int count = BitConverter . ToInt16 ( hive . ReadBytes ( 2 ) , 0 ) ;
80
+ int count = hive . ReadInt16 ( ) ;
81
81
82
82
for ( int i = 0 ; i < count ; i ++ ) {
83
83
long pos = hive . BaseStream . Position ;
84
- int offset = BitConverter . ToInt32 ( hive . ReadBytes ( 4 ) , 0 ) ;
84
+ int offset = hive . ReadInt32 ( ) ;
85
85
hive . BaseStream . Position = 4096 + offset + 4 ;
86
86
buf = hive . ReadBytes ( 2 ) ;
87
87
@@ -102,13 +102,13 @@ private void ReadChildrenNodes(BinaryReader hive) {
102
102
}
103
103
104
104
private void ParseChildNodes ( BinaryReader hive ) {
105
- int count = BitConverter . ToInt16 ( hive . ReadBytes ( 2 ) , 0 ) ;
105
+ int count = hive . ReadInt16 ( ) ;
106
106
long topOfList = hive . BaseStream . Position ;
107
107
108
108
for ( int i = 0 ; i < count ; i ++ )
109
109
{
110
110
hive . BaseStream . Position = topOfList + ( i * 8 ) ;
111
- int newoffset = BitConverter . ToInt32 ( hive . ReadBytes ( 4 ) , 0 ) ;
111
+ int newoffset = hive . ReadInt32 ( ) ;
112
112
hive . BaseStream . Position += 4 ;
113
113
//byte[] check = hive.ReadBytes(4);
114
114
hive . BaseStream . Position = 4096 + newoffset + 4 ;
@@ -128,7 +128,7 @@ private void ReadChildValues(BinaryReader hive) {
128
128
for ( int i = 0 ; i < this . ValuesCount ; i ++ )
129
129
{
130
130
hive . BaseStream . Position = 4096 + this . ValueListOffset + 4 + ( i * 4 ) ;
131
- int offset = BitConverter . ToInt32 ( hive . ReadBytes ( 4 ) , 0 ) ;
131
+ int offset = hive . ReadInt32 ( ) ;
132
132
hive . BaseStream . Position = 4096 + offset + 4 ;
133
133
this . ChildValues . Add ( new ValueKey ( hive ) ) ;
134
134
}
0 commit comments