Skip to content

Commit

Permalink
updating to new construct syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessandroZ committed Mar 18, 2018
1 parent cf7502b commit 1046838
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Windows/lazagne/config/DPAPI/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

from construct import *
import construct
import datetime
import struct
import crypto
Expand Down Expand Up @@ -121,12 +122,12 @@ def _decode(self, obj, context, path):

UNICODE_STRING = Struct(
'length' / Int32ul,
'data' / String(this.length, encoding='UTF_16_LE'),
'data' / PaddedString(this.length, encoding='UTF_16_LE'),
)

UNICODE_STRING_STRIP = Struct(
'length' / Int32ul,
'data' / UnicodeRstripZero(String(this.length, encoding='UTF_16_LE'))
'data' / UnicodeRstripZero(PaddedString(this.length, encoding='UTF_16_LE'))
)

SIZED_DATA = Struct(
Expand Down Expand Up @@ -173,7 +174,7 @@ def _decode(self, obj, context, path):
MKFILE = Struct(
'version' / Int32ul,
Padding(8),
'guid' / String(72, encoding='UTF-16'),
'guid' / PaddedString(72, encoding='UTF-16'),
Padding(8),
'policy' / Int32ul, # define if sha-1 or md4 is used
'masterkeyLen' / Int64ul,
Expand Down

0 comments on commit 1046838

Please sign in to comment.