Skip to content

add initial support for $I30 index records - #11

Open
jleaniz wants to merge 7 commits into
libyal:mainfrom
jleaniz:add-indx-support
Open

add initial support for $I30 index records#11
jleaniz wants to merge 7 commits into
libyal:mainfrom
jleaniz:add-indx-support

Conversation

@jleaniz

@jleaniz jleaniz commented Nov 19, 2021

Copy link
Copy Markdown

Added a data structure definition file and supporting class/methods for NTFS INDX directory records

@joachimmetz joachimmetz self-assigned this Nov 21, 2021
@joachimmetz
joachimmetz self-requested a review November 21, 2021 08:46

from dtformats import data_format
from dtformats.errors import ParseError

@joachimmetz joachimmetz Nov 21, 2021

Copy link
Copy Markdown
Member

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

Comment thread dtformats/indx_directory_entry.py Outdated
@@ -0,0 +1,144 @@
# -*- coding: utf-8 -*-
"""INDX entries """

Copy link
Copy Markdown
Member

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.

Comment thread dtformats/indx_directory_entry.py Outdated
import os

from dtformats import data_format
from dtformats.errors import ParseError

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread dtformats/indx_directory_entry.py Outdated
"""

_FABRIC = data_format.BinaryDataFile.ReadDefinitionFile(
'indx_directory_entry.yml')

@joachimmetz joachimmetz Nov 21, 2021

Copy link
Copy Markdown
Member

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)

Comment thread dtformats/indx_directory_entry.py Outdated
'indx_directory_entry.yml')

_DEBUG_INDX_ENTRY_HEADER = [
('signature', 'signature', ''),

Copy link
Copy Markdown
Member

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

@joachimmetz joachimmetz left a comment

Copy link
Copy Markdown
Member

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

Comment thread dtformats/indx_directory_entry.py Outdated
from dtformats import data_format
from dtformats.errors import ParseError

class INDXRecord(data_format.BinaryDataFile):

Copy link
Copy Markdown
Member

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

Comment thread dtformats/indx_directory_entry.py Outdated
('filename', 'filename', '_FormatString')]

def PrintRecord(self, record):
"""

Copy link
Copy Markdown
Member

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 """

Comment thread dtformats/indx_directory_entry.py Outdated
Args:
record (index_dir_entry): An index_dir_entry structure.
"""
if record is not None:

Copy link
Copy Markdown
Member

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 ?

Copy link
Copy Markdown
Author

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

record.index_key_data, self._DEBUG_FILE_NAME_ATTR)


def _ParseIndexEntryHeader(self, file_object):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing docstring

Comment thread dtformats/indx_directory_entry.py Outdated
record, self._DEBUG_INDX_DIR_RECORD)
self._DebugPrintStructureObject(
record.index_key_data, self._DEBUG_FILE_NAME_ATTR)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove 1 white line

Comment thread dtformats/indx_directory_entry.yml Outdated
@@ -0,0 +1,158 @@
name: index_record

Copy link
Copy Markdown
Member

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

Comment thread dtformats/indx_directory_entry.yml Outdated
@@ -0,0 +1,158 @@
name: index_record
type: format
description: Index Directory Entry

Copy link
Copy Markdown
Member

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

Comment thread 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"]

Copy link
Copy Markdown
Member

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)

Comment thread 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 <joachim.metz@gmail.com>', 'Juan Leaniz <juan.leaniz@gmail.com']

Copy link
Copy Markdown
Member

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 <juan.leaniz@gmail.com'

However you can remove me at this point since I did not author this file

Comment thread dtformats/indx_directory_entry.yml Outdated
- name: index_node_flags
data_type: uint32
---
name: index_dir_entry

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't abbreviate

@jleaniz

jleaniz commented Nov 22, 2021

Copy link
Copy Markdown
Author

Renamed .py and .yml file names to use non-abbreviated names. Addressed style and other comments.

@jleaniz
jleaniz requested a review from joachimmetz November 22, 2021 21:07
@jleaniz

jleaniz commented Dec 8, 2021

Copy link
Copy Markdown
Author

@joachimmetz PTAL, minor changes

@joachimmetz
joachimmetz force-pushed the main branch 6 times, most recently from a6c6c05 to 4116264 Compare May 28, 2023 13:36
@joachimmetz
joachimmetz force-pushed the main branch 6 times, most recently from 05669cf to f36ac18 Compare June 3, 2023 11:18
@joachimmetz
joachimmetz force-pushed the main branch 13 times, most recently from 5e1c1c1 to 7f03eae Compare June 11, 2023 11:19
@joachimmetz
joachimmetz force-pushed the main branch 2 times, most recently from f152369 to 2d1d66b Compare June 18, 2023 17:17
@joachimmetz
joachimmetz force-pushed the main branch 2 times, most recently from 817df43 to 4b73068 Compare January 4, 2024 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants