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 support for at.exe .job files in scheduled tasks #249

Merged

Conversation

Wouter-Jansen
Copy link
Contributor

(DIS-1558)

- Implement binary .job file parsing
- Ensure consistency with XML task files by using the same record fields
- Extend and enhance tests
- Include missing docstrings and type hints for better documentation

This change allows the tasks parser to handle .job files, providing
compatibility with at.exe scheduled tasks.
@codecov
Copy link

codecov bot commented May 11, 2023

Codecov Report

Merging #249 (b72fc73) into main (bca9e64) will increase coverage by 0.19%.
The diff coverage is 80.06%.

@@            Coverage Diff             @@
##             main     #249      +/-   ##
==========================================
+ Coverage   68.61%   68.81%   +0.19%     
==========================================
  Files         222      225       +3     
  Lines       17036    17147     +111     
==========================================
+ Hits        11690    11800     +110     
- Misses       5346     5347       +1     
Flag Coverage Δ
unittests 68.81% <80.06%> (+0.19%) ⬆️

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

Impacted Files Coverage Δ
...arget/plugins/os/windows/task_helpers/tasks_xml.py 57.82% <57.82%> (ø)
...arget/plugins/os/windows/task_helpers/tasks_job.py 97.03% <97.03%> (ø)
...t/plugins/os/windows/task_helpers/tasks_records.py 100.00% <100.00%> (ø)
dissect/target/plugins/os/windows/tasks.py 97.67% <100.00%> (+33.38%) ⬆️

... and 31 files with indirect coverage changes

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

dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
- Fixed docstrings
- Better var naming
- Identing
- Fix struct field types
Copy link
Contributor

@pyrco pyrco left a comment

Choose a reason for hiding this comment

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

This file is becoming a bit unwieldy, it might be a good idea to split out the structure parsing bits in a xml_tasks.py and at_tasks.py or something like that.

dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
Wouter-Jansen and others added 2 commits May 17, 2023 17:44
- Split tasks.py in three files and classes
- Refactor to reduce code duplication
- Various improvements
- Add more records to be tested
- Add more fields to be tested
- Improve test file with more fields used
…of github.com:fox-it/dissect.target into DIS-1558_Add_at.exe_job_files_scheduled_tasks_support
dissect/target/plugins/os/windows/_tasks_job.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/_tasks_xml.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/_tasks_xml.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
tests/test_plugins_os_windows_tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
Wouter-Jansen and others added 2 commits May 22, 2023 21:27
- Improve handling of padding
- Fix delay bug in old code
- Improve naming consistency
- Improve exeption handling
- Improve tests
dissect/target/plugins/os/windows/_tasks_job.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/_tasks_job.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
Wouter-Jansen and others added 3 commits May 23, 2023 19:49
- Move record descriptors to separate file
- Implement some improvements
- Fix some bugs
…of github.com:fox-it/dissect.target into DIS-1558_Add_at.exe_job_files_scheduled_tasks_support
@Wouter-Jansen Wouter-Jansen requested a review from pyrco May 23, 2023 17:51
Copy link
Contributor

@Miauwkeru Miauwkeru left a comment

Choose a reason for hiding this comment

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

Maybe an idea to move everything into a tasks directory?
@pyrco what do you think?

dissect/target/plugins/os/windows/_tasks_xml.py Outdated Show resolved Hide resolved
@pyrco
Copy link
Contributor

pyrco commented May 31, 2023

Maybe an idea to move everything into a tasks directory? @pyrco what do you think?

That may be even cleaner indeed. I'd keep tasks.py in the current directory, but all "helper" .py files could go into a tasks subdir.

@pyrco
Copy link
Contributor

pyrco commented May 31, 2023

I'd remove the _ from the files now they are in a seperate sub-dir.

dissect/target/plugins/os/windows/tasks.py Outdated Show resolved Hide resolved
…of github.com:fox-it/dissect.target into DIS-1558_Add_at.exe_job_files_scheduled_tasks_support
@Wouter-Jansen Wouter-Jansen requested a review from pyrco May 31, 2023 12:58
@Wouter-Jansen Wouter-Jansen dismissed stale reviews from Miauwkeru, cecinestpasunepipe, and Schamper May 31, 2023 13:19

Reviewed by @pyrco

@Wouter-Jansen Wouter-Jansen merged commit 57a6c2f into main May 31, 2023
@Wouter-Jansen Wouter-Jansen deleted the DIS-1558_Add_at.exe_job_files_scheduled_tasks_support branch May 31, 2023 13:21
Poeloe pushed a commit that referenced this pull request Feb 29, 2024
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.

5 participants