This is the 4th unit based on Joachim Metz work.
This time I quickly coded a delphi wrapper for libqcow.
As previous ones : create the object, open the file, get the size, read and/or write, close…
The delphi unit is here : libqcow .
This is the 4th unit based on Joachim Metz work.
This time I quickly coded a delphi wrapper for libqcow.
As previous ones : create the object, open the file, get the size, read and/or write, close…
The delphi unit is here : libqcow .
This is the 3rd unit based on Joachim Metz work.
This time I quickly coded a delphi wrapper for libvhdi.
As previous ones : create the object, open the file, get the size, read and/or write, close…
The delphi unit is here : libvhdi .
I recently discovered the work of Joachim Metz.
I first decided to write a delphi wrapper unit around libewf (here) so that I could add EWF support to CloneDisk.
Today, I decided to do the same for Joachim’s libvmdk unit : another delphi wrapper.
The unit is straighforward and is based on the previous libewf one : create the object, open the file, get the size, read and/or write, close…
The delphi unit is here : libvmdk .
In a previous article, I showed how to setup a « proxy » for ImDisk thru devio to mount an EWF file.
This time, lets do it with a VMDK file (using external libyal library).
The command lines for the proxy and ImDisk are below :
devio --dll=proxy.dll;dllopen shm:test_proxy c:\test.vmdk
imdisk -a -t proxy -o shm -o ro -f test_proxy -m Z:
Find the proxy here : proxy_VMDK .
Can be handy under windows : TortoiseSVNDiff.
In a previous article, I have shared a delphi unit for libewf.
Now lets code a proxy for ImDisk using that external libyal library to mount an EWF file.
I initially used this template from reboot.pro and came with the below basic delphi unit.
Once I had done that, it was pretty easy to fill in the missing parts to mount and EWF reusing my previous libewf delphi unit.
See code attached.proxy_EWF
library proxy; uses SysUtils, Classes,windows; {$R *.res} type dllread_proc = function (handle:thandle; buf:pointer; size:cardinal; offset:int64): integer; cdecl; dllwrite_proc = function (handle:thandle; buf:pointer; size:cardinal; offset:int64): integer; cdecl; dllclose_proc = function (handle:thandle): integer; cdecl; var file_handle:thandle; function SetFilePointerEx (hFile: THandle; lDistanceToMove: int64; lpNewFilePointer: Pointer; dwMoveMethod: DWORD): BOOL; stdcall; external 'kernel32.dll'; function GetFileSizeEx(hFile: THandle; var lpFileSize: Int64): BOOL; stdcall; external 'kernel32.dll' name 'GetFileSizeEx'; function my_read_proc(handle:thandle; buf:pointer; size:cardinal; offset:int64): integer; cdecl; var bytes_read:cardinal; begin writeln('Read request - size:'+inttostr(size)+' offset:'+inttostr(offset)); SetFilePointerEx(handle, offset, nil, FILE_BEGIN); ReadFile(handle, buf^, size, bytes_read, nil); result:=bytes_read; end; function my_write_proc(handle:thandle; buf:pointer; size:cardinal; offset:int64): integer; cdecl; var bytes_written:cardinal; begin writeln('Write request - size:'+inttostr(size)+' offset:'+inttostr(offset)); SetFilePointerEx(handle, offset, nil, FILE_BEGIN); WriteFile(handle, buf^, size, bytes_written, nil); result:=bytes_written; end; function my_close_proc(handle:thandle): integer; cdecl; begin writeln('Close request'); CloseHandle(handle); result:=0; end; function dllopen(filename:pchar; read_only:integer; var dllread:dllread_proc; var dllwrite:dllwrite_proc; var dllclose:dllclose_proc; var size:int64):thandle;cdecl; begin writeln('File to open: '+filename); dllread := my_read_proc; dllwrite := my_write_proc; dllclose := my_close_proc; file_handle := CreateFile(filename, GENERIC_READ or GENERIC_WRITE, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); GetFileSizeEx(file_handle, size); result:=file_handle; end; exports dllopen index 1; begin end.
The command lines for the proxy and ImDisk are below :
devio --dll=proxy.dll;dllopen shm:test_proxy c:\test.vmdk
imdisk -a -t proxy -o shm -o ro -f test_proxy -m Z:
Changes since last changelog.
Discuss it here. Download it here.
changed : using IOCTL_DISK_GET_LENGTH_INFO in main screen rather than disk geometry to retrieve (correct) disk size
added : user confirmation on disk online/offline/rw/ro
added : display disk serial number (in disk properties)
added : display disk cache information (in disk properties)
added : display disk attributes (in disk properties)
changed : update int13 unit with IOCTL_DISK_GET_DRIVE_GEOMETRY_EX instead of IOCTL_DISK_GET_DRIVE_GEOMETRY
changed : moved most disk management (GET) functions to a separate unit (http://msdn.microsoft.com/en-us/library/windows/desktop/aa363979(v=vs.85).aspx)
changed : renamed clone_disk method to clone
fixed : _GetDiskLength
added : _GetPartLength
added : backup_ewf & restore_ewf
added : zero out unused (ntfs) clusters
added : CompactVirtualDisk
added : backup to fixed vhd (raw image+footer)
For years I have been using Ext2fsd to read (and possibly write) ext2 (or ext3 / ext4) filesystem.
I would usually mount the image with ImDisk.
Today I stumbled upon a nice little (and free) utility from diskinternals : Linux Reader.
The tool can mount the image or read an existing logical drive.
When playing with linux distros, there are times where you want to be able to extract or add content to a squash filesystem.
Under linux, there is rather straight forward but under windows there is not a given.
Doru Baru has made the squashfs tools available for windows here.
Find the binaries here : squashfs_tools-4.0-i686-cygwin.tar .
A small break away from coding and electronic…
I wanted to offer something special to my special geek girl so here it is : a jewel (earings) made of resistors 🙂
Two times 5 * 1.8Kohm : yes, I am not cheap, not counting !