Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jleaniz
Copy link

@jleaniz jleaniz commented Nov 19, 2021

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

Copy link
Member

@joachimmetz joachimmetz Nov 21, 2021

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

@@ -0,0 +1,144 @@
# -*- coding: utf-8 -*-
"""INDX entries """
Copy link
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.

import os

from dtformats import data_format
from dtformats.errors import ParseError
Copy link
Member

Choose a reason for hiding this comment

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

"""

_FABRIC = data_format.BinaryDataFile.ReadDefinitionFile(
'indx_directory_entry.yml')
Copy link
Member

@joachimmetz joachimmetz Nov 21, 2021

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)

'indx_directory_entry.yml')

_DEBUG_INDX_ENTRY_HEADER = [
('signature', 'signature', ''),
Copy link
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

Copy link
Member

@joachimmetz joachimmetz left a 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

from dtformats import data_format
from dtformats.errors import ParseError

class INDXRecord(data_format.BinaryDataFile):
Copy link
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

('filename', 'filename', '_FormatString')]

def PrintRecord(self, record):
"""
Copy link
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 """

Args:
record (index_dir_entry): An index_dir_entry structure.
"""
if record is not None:
Copy link
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
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
Member

Choose a reason for hiding this comment

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

missing docstring

record, self._DEBUG_INDX_DIR_RECORD)
self._DebugPrintStructureObject(
record.index_key_data, self._DEBUG_FILE_NAME_ATTR)

Copy link
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

@@ -0,0 +1,158 @@
name: index_record
Copy link
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

@@ -0,0 +1,158 @@
name: index_record
type: format
description: Index Directory Entry
Copy link
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

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

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]']
Copy link
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 <[email protected]'

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

- name: index_node_flags
data_type: uint32
---
name: index_dir_entry
Copy link
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
Copy link
Author

jleaniz commented Nov 22, 2021

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
Copy link
Author

jleaniz commented Dec 8, 2021

@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