Add a windows drive container type to load Windows logical or physical drive from a windows host.#1775
Open
william-billaud wants to merge 26 commits into
Open
Conversation
Contributor
Author
|
Just tested manually after rebase / new target path PS C:\Users\Username\Documents\git\dissect.target> git rev-parse HEAD
2e650e89bece9f7e441ed5a74fc8c2fd3997fbf8
PS C:\Users\Username\Documents\git\dissect.target> uv run --python 3.13 --extra full target-query -f hostname \\.\PhysicalDrive0
<Target \\.\PhysicalDrive0> DESKTOP-XXXXXXX
PS C:\Users\Username\Documents\git\dissect.target> uv run --python 3.13 --extra full target-query -f hostname \\.\C:
2026-06-11T15:28:42.048024Z [warning ] <Target \\.\C:>: Can't identify volume system or no volumes found, adding as raw volume instead: <Container type=windows_drive size=53075599872 vs=None> [dissect.target.target]
<Target \\.\C:> DESKTOP-XXXXXXX
PS C:\Users\Username\Documents\git\dissect.target>But raise the following error for python < 3.12 I put issue to draft until I solve the issue (which was probably already present before) |
william-billaud
marked this pull request as draft
June 11, 2026 15:35
Contributor
Author
|
Before python 3.11 the str(path) representation return a different value as the original path (\ is appended), Thus when the value is forwarded to Making this works for python < 3.12 seems to be a lot of modification of loading logic. Regarding the fact that python 3.11 is end of life in ~1 year maybe bug can be "accepted"? If not I can try to look how I can fix it. Python 3.11from pathlib from Path
str(Path("\\\\.\\PhysicalDrive0"))
> '\\\\.\\PhysicalDrive0\\'Python 3.12from pathlib from Path
str(Path("\\\\.\\PhysicalDrive0"))
> '\\\\.\\PhysicalDrive0' |
william-billaud
marked this pull request as ready for review
June 12, 2026 14:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a windows drive container type
Currenlty, Target could not be loaded from a drive (Physical or logical (
\\.\O:) on a windows systems, except using the local loader that will load all drives.The mains issue is that drive are not seekable, and could not be natively handled by RawContainer
Selecting specific drive may allows to collect/analyses a specific drive encrypted with a veracrypt like encrypted solution, without having copying the whole drive in a file before.
Proposed Changes
IOCTL_DISK_GET_LENGTH_INFO.IOCTL_DISK_GET_DRIVE_GEOMETRY_EXreturn the whole disk size, not just the one of the volume/partition.dissect/target/helpers/windows_ffi.pyIOCTL_DISK_GET_DRIVE_GEOMETRY_EX,IOCTL_DISK_GET_LENGTH_INFOrequired Generic read privileges (and thus must also set the file share mode).PermissionErrorwhen testing from path existence (E.g.PermissionError: [WinError 31] A device attached to the system is not functioning: '\\\\.\\PhysicalDrive0\\MFT.bin'for the vb loader, and this make dissect crash.Issue
It does not works with multiraw, as the original literal string is converted as path with the '+', and then splited, maybe the multiraw._split_paths function should be done on the original literal provided, and not the Path version of the string.
Checklist