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

Read lnk file structure from file like object #18

Merged
merged 5 commits into from
Apr 11, 2023

Conversation

Zawadidone
Copy link
Contributor

@Zawadidone Zawadidone commented Apr 9, 2023

@Schamper Schamper requested a review from Horofic April 9, 2023 20:31
@Schamper
Copy link
Member

Schamper commented Apr 9, 2023

In my opinion the path argument should be removed completely in favour of fh since it has no purpose beyond opening the file, but I'm not sure what else needs to be changed to accommodate that change @Horofic.

Remove file-object test
@Horofic
Copy link
Contributor

Horofic commented Apr 11, 2023

I agree! Only some small changes have to be done in dissect.target and the lnk-file parser tool of dissect.shellitem. In this case it is only needed to change lnk_file = Lnk(entry) to lnk_file = Lnk(entry.open()) on in both projects on lines 78, and 15 respectively.

@Zawadidone could you change line 15 in https://github.com/fox-it/dissect.shellitem/blob/main/dissect/shellitem/tools/lnk.py to
lnk_file = Entry(path.open("rb"))?

For dissect.target I created the following PR fox-it/dissect.target#224.

Ill approve and run CI when the proposed changes are reflected!

@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

Merging #18 (f971316) into main (c6bd1a9) will increase coverage by 0.02%.
The diff coverage is 66.66%.

❗ Current head f971316 differs from pull request most recent head a95cf4a. Consider uploading reports for the commit a95cf4a to get more accurate results

@@            Coverage Diff             @@
##             main      #18      +/-   ##
==========================================
+ Coverage   69.07%   69.10%   +0.02%     
==========================================
  Files           4        4              
  Lines         304      301       -3     
==========================================
- Hits          210      208       -2     
+ Misses         94       93       -1     
Flag Coverage Δ
unittests 69.10% <66.66%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
dissect/shellitem/tools/lnk.py 0.00% <0.00%> (ø)
dissect/shellitem/lnk/lnk.py 82.15% <100.00%> (+0.21%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Horofic Horofic merged commit 7375644 into fox-it:main Apr 11, 2023
@Zawadidone Zawadidone deleted the feature/lnk_structure_file_object branch April 11, 2023 18:04
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.

Read LNK file structure from file or buffer
3 participants