-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add initial support for $I30 index records #11
base: main
Are you sure you want to change the base?
Conversation
dtformats/indx_directory_entry.py
Outdated
|
||
from dtformats import data_format | ||
from dtformats.errors import ParseError | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using the l2t/Plaso style guide here: please add an additional white line
dtformats/indx_directory_entry.py
Outdated
@@ -0,0 +1,144 @@ | |||
# -*- coding: utf-8 -*- | |||
"""INDX entries """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these NTFS $I30 index entries? Note that NTFS support different types of index entries as well, so please be as specific as possible here.
dtformats/indx_directory_entry.py
Outdated
import os | ||
|
||
from dtformats import data_format | ||
from dtformats.errors import ParseError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't import classes directly see https://github.com/log2timeline/l2tdocs/blob/main/process/Style-guide.md
dtformats/indx_directory_entry.py
Outdated
""" | ||
|
||
_FABRIC = data_format.BinaryDataFile.ReadDefinitionFile( | ||
'indx_directory_entry.yml') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style nit: 4 space continuation indentation (repeat elsewhere as well)
dtformats/indx_directory_entry.py
Outdated
'indx_directory_entry.yml') | ||
|
||
_DEBUG_INDX_ENTRY_HEADER = [ | ||
('signature', 'signature', ''), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing debug value print function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comment, PTAL at the style guide
dtformats/indx_directory_entry.py
Outdated
from dtformats import data_format | ||
from dtformats.errors import ParseError | ||
|
||
class INDXRecord(data_format.BinaryDataFile): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Limit the use of abbreviation, for international audiences these lead to unnecessary additional confusion
dtformats/indx_directory_entry.py
Outdated
('filename', 'filename', '_FormatString')] | ||
|
||
def PrintRecord(self, record): | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style consistency nit: start on the first line directly after """
dtformats/indx_directory_entry.py
Outdated
Args: | ||
record (index_dir_entry): An index_dir_entry structure. | ||
""" | ||
if record is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not if not record
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change this to if record
-- I am checking if record
has a value other than None
dtformats/indx_directory_entry.py
Outdated
record.index_key_data, self._DEBUG_FILE_NAME_ATTR) | ||
|
||
|
||
def _ParseIndexEntryHeader(self, file_object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing docstring
dtformats/indx_directory_entry.py
Outdated
record, self._DEBUG_INDX_DIR_RECORD) | ||
self._DebugPrintStructureObject( | ||
record.index_key_data, self._DEBUG_FILE_NAME_ATTR) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove 1 white line
dtformats/indx_directory_entry.yml
Outdated
@@ -0,0 +1,158 @@ | |||
name: index_record |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
index_record > ntfs_i30_index
dtformats/indx_directory_entry.yml
Outdated
@@ -0,0 +1,158 @@ | |||
name: index_record | |||
type: format | |||
description: Index Directory Entry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(change to something in line with) NTFS $I30 index, which contains directory entries
dtformats/indx_directory_entry.yml
Outdated
name: index_record | ||
type: format | ||
description: Index Directory Entry | ||
urls: ["https://github.com/libyal/libfsntfs/blob/83c2f4ce3d16b5535eae9de767adc93fff724004/documentation/New%20Technologies%20File%20System%20(NTFS).asciidoc#index"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please pin to main (latest version of the documentation)
dtformats/indx_directory_entry.yml
Outdated
description: Index Directory Entry | ||
urls: ["https://github.com/libyal/libfsntfs/blob/83c2f4ce3d16b5535eae9de767adc93fff724004/documentation/New%20Technologies%20File%20System%20(NTFS).asciidoc#index"] | ||
metadata: | ||
authors: ['Joachim Metz <[email protected]>', 'Juan Leaniz <[email protected]'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for multiple entries use:
authors:
- Juan Leaniz <[email protected]'
However you can remove me at this point since I did not author this file
dtformats/indx_directory_entry.yml
Outdated
- name: index_node_flags | ||
data_type: uint32 | ||
--- | ||
name: index_dir_entry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't abbreviate
Renamed .py and .yml file names to use non-abbreviated names. Addressed style and other comments. |
@joachimmetz PTAL, minor changes |
1ebe12b
to
4524810
Compare
85d9b05
to
00df5f2
Compare
a6c6c05
to
4116264
Compare
05669cf
to
f36ac18
Compare
5e1c1c1
to
7f03eae
Compare
f152369
to
2d1d66b
Compare
817df43
to
4b73068
Compare
Added a data structure definition file and supporting class/methods for NTFS INDX directory records