-
Notifications
You must be signed in to change notification settings - Fork 54
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
Fix EOF read error for char arrays in a BEEF0004 shellbag #730
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #730 +/- ##
==========================================
+ Coverage 74.92% 74.97% +0.04%
==========================================
Files 295 295
Lines 25070 25070
==========================================
+ Hits 18784 18796 +12
+ Misses 6286 6274 -12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Could you add a test case?
self.localized_name = c_bag.char[None](fh) | ||
|
||
if version >= 7 and localized_name_offset > 0: | ||
self.localized_name = c_bag.wchar[None](fh) |
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.
Could you add another test case that also evaluates this line? 😄
from dissect.target.plugins.os.windows.regf.shellbags import parse_shell_item_list | ||
|
||
|
||
def test_parse_shell_item_list_chars() -> 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.
def test_parse_shell_item_list_chars() -> None: | |
def test_parse_shell_item_list_char() -> None: |
assert extension.localized_name == b"@shell32.dll,-21786" | ||
|
||
|
||
def test_parse_shell_item_list_wchar() -> 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.
Suggestion: Maybe use pytest.parameterize
and use shellbag
, modification_time
, long_name
and localized_name
as parameters? Then use id
to distinguish the test cases char
and wchar
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.
LGTM!
No description provided.