-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feature/buffer mode #3
base: master
Are you sure you want to change the base?
Feature/buffer mode #3
Conversation
To support use of the VHD and VHDX classes for other uses besides the ConvertImage function.
Base class does not assume a full image exists, includes only capability for generating header/footer.
Instead of writing to file, support importing header/footer as a byte buffer for use with memory only implementations.
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.
When VHD[X]_Image::ConstructHeader(is_fixed == false)
, will call SetFileInformationByHandle with an uninitialized value, and abort.
@0xbadfca11, can you mark this place in code and say little more about this situation? I can't understood about witch place you are talking. |
void VHD_Image::ConstructHeader(UINT64 disk_size, UINT32 block_size, UINT32 sector_size, bool is_fixed)
{
// 1. eof_info is uninitialized memory.
FILE_END_OF_FILE_INFO eof_info;
VHD::ConstructHeader(disk_size, block_size, sector_size, is_fixed, eof_info);
// 3. eof_info still uninitialized.
if (!SetFileInformationByHandle(image, FileEndOfFileInfo, &eof_info, sizeof eof_info))
{
die();
}
}
void VHD::ConstructHeader(UINT64 disk_size, UINT32 block_size, UINT32 sector_size, bool is_fixed, FILE_END_OF_FILE_INFO &eof_info)
{
if (is_fixed)
{
eof_info.EndOfFile.QuadPart = disk_size + sizeof vhd_footer;
}
else
{
// 2. Nothing to did to eof_info.
}
} VHDX_Image::ConstructHeader same too. |
To be honest, features creating an image in memory is not needs for this tool. |
@0xbadfca11, pleace look at Dokan project. We're using buffered makevhdx and Dokan mirroring functionality create tool that can mirror some drive to vhdx file, then this disk attaching to OS file system. It tool can be used for real time decrypt disks. You insert encrypted disk, real disk hidden, and in file system appear after authentication virtual regular disk. |
This merge request exist like result of implementing issue dokan-dev/dokany#627.
Add feature to get header/footer as buffer, instead of writing to file. It help to importing header/footer as
a byte buffer for use with memory only implementations.
And refactored code into additional headers and c files.
Base class does not assume a full image exists, includes only capability for generating header/footer.