mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Fix working with VirtualBox disk images bigger than 4GiB.
This commit is contained in:
@@ -209,7 +209,7 @@ namespace Aaru.DiscImages
|
||||
if(ibmOff == VDI_EMPTY)
|
||||
return new byte[_vHdr.sectorSize];
|
||||
|
||||
ulong imageOff = _vHdr.offsetData + (ibmOff * _vHdr.blockSize);
|
||||
ulong imageOff = _vHdr.offsetData + ((ulong)ibmOff * _vHdr.blockSize);
|
||||
|
||||
byte[] cluster = new byte[_vHdr.blockSize];
|
||||
_imageStream.Seek((long)imageOff, SeekOrigin.Begin);
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Aaru.DiscImages
|
||||
// TODO: Support fixed images
|
||||
public sealed partial class Vdi : IWritableImage
|
||||
{
|
||||
uint _currentWritingPosition;
|
||||
ulong _currentWritingPosition;
|
||||
uint[] _ibm;
|
||||
ImageInfo _imageInfo;
|
||||
Stream _imageStream;
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace Aaru.DiscImages
|
||||
headerSize = Marshal.SizeOf<Header>() - 72,
|
||||
imageType = VdiImageType.Normal,
|
||||
offsetBlocks = sectorSize,
|
||||
offsetData = _currentWritingPosition,
|
||||
offsetData = (uint)_currentWritingPosition,
|
||||
sectorSize = sectorSize,
|
||||
size = sectors * sectorSize,
|
||||
blockSize = DEFAULT_BLOCK_SIZE,
|
||||
@@ -169,13 +169,13 @@ namespace Aaru.DiscImages
|
||||
|
||||
if(ibmOff == VDI_EMPTY)
|
||||
{
|
||||
ibmOff = (_currentWritingPosition - _vHdr.offsetData) / _vHdr.blockSize;
|
||||
ibmOff = (uint)((_currentWritingPosition - _vHdr.offsetData) / _vHdr.blockSize);
|
||||
_ibm[index] = ibmOff;
|
||||
_currentWritingPosition += _vHdr.blockSize;
|
||||
_vHdr.allocatedBlocks++;
|
||||
}
|
||||
|
||||
ulong imageOff = _vHdr.offsetData + (ibmOff * _vHdr.blockSize);
|
||||
ulong imageOff = _vHdr.offsetData + ((ulong)ibmOff * _vHdr.blockSize);
|
||||
|
||||
_writingStream.Seek((long)imageOff, SeekOrigin.Begin);
|
||||
_writingStream.Seek((long)secOff, SeekOrigin.Current);
|
||||
|
||||
Reference in New Issue
Block a user