@@ -13,17 +13,17 @@ class FseventsFile(data_format.BinaryDataFile):
13
13
# the dtFabric definition file.
14
14
_FABRIC = data_format .BinaryDataFile .ReadDefinitionFile ('fseventsd.yaml' )
15
15
16
- _DEBUG_INFO_DLS_PAGE_ENTRY = [
17
- ('path' , 'Path' , '_FormatString' ),
18
- ('event_identifier' , 'Event identifier' , '_FormatIntegerAsDecimal' ),
19
- ('event_flags' , 'Event flags' , '_FormatIntegerAsHexadecimal' ),
20
- ('node_identifier' , 'Node identifier' , '_FormatIntegerAsDecimal' )]
21
-
22
16
_DEBUG_INFO_DLS_PAGE_HEADER = [
23
17
('signature' , 'Signature' , '_FormatStreamAsSignature' ),
24
- ('padding ' , 'Padding ' , '_FormatDataInHexadecimal' ),
18
+ ('unknown1 ' , 'Unknown1 ' , '_FormatDataInHexadecimal' ),
25
19
('page_size' , 'Page size' , '_FormatIntegerAsDecimal' )]
26
20
21
+ _DEBUG_INFO_DLS_RECORD = [
22
+ ('path' , 'Path' , '_FormatString' ),
23
+ ('event_identifier' , 'Event identifier' , '_FormatIntegerAsDecimal' ),
24
+ ('flags' , 'Flags' , '_FormatIntegerAsHexadecimal4' ),
25
+ ('node_identifier' , 'Node identifier' , '_FormatIntegerAsDecimal' )]
26
+
27
27
# The version 1 format was used in Mac OS X 10.5 (Leopard) through macOS 10.12
28
28
# (Sierra).
29
29
_DLS_V1_SIGNATURE = b'1SLD'
@@ -32,7 +32,7 @@ class FseventsFile(data_format.BinaryDataFile):
32
32
_DLS_V2_SIGNATURE = b'2SLD'
33
33
34
34
def __init__ (self , debug = False , output_writer = None ):
35
- """Initializes a Windows Restore Point rp.log file.
35
+ """Initializes a MacOS fseventsd file.
36
36
37
37
Args:
38
38
debug (Optional[bool]): True if debug information should be written.
@@ -89,24 +89,23 @@ def _ReadDLSRecord(self, file_object, file_offset, format_version):
89
89
format_version (int): format version.
90
90
91
91
Returns:
92
- int: number of bytes read.
92
+ tuple[dls_record_v1|dls_record_v2, int]: record and number of bytes read.
93
93
94
94
Raises:
95
- ParseError: if the page entry cannot be read.
95
+ ParseError: if the record cannot be read.
96
96
"""
97
97
if format_version == 1 :
98
98
data_type_map = self ._GetDataTypeMap ('dls_record_v1' )
99
99
elif format_version == 2 :
100
100
data_type_map = self ._GetDataTypeMap ('dls_record_v2' )
101
101
102
- dls_page_entry , bytes_read = self ._ReadStructureFromFileObject (
102
+ dls_record , bytes_read = self ._ReadStructureFromFileObject (
103
103
file_object , file_offset , data_type_map , 'DLS record' )
104
104
105
105
if self ._debug :
106
- self ._DebugPrintStructureObject (
107
- dls_page_entry , self ._DEBUG_INFO_DLS_PAGE_ENTRY )
106
+ self ._DebugPrintStructureObject (dls_record , self ._DEBUG_INFO_DLS_RECORD )
108
107
109
- return bytes_read
108
+ return dls_record , bytes_read
110
109
111
110
def ReadFileObject (self , file_object ):
112
111
"""Reads a MacOS fseventsd file-like object.
@@ -139,7 +138,7 @@ def ReadFileObject(self, file_object):
139
138
else :
140
139
format_version = 0
141
140
142
- bytes_read = self ._ReadDLSRecord (
141
+ _ , bytes_read = self ._ReadDLSRecord (
143
142
gzipf_file , file_offset , format_version )
144
143
145
144
file_offset += bytes_read
0 commit comments