RibShark / SafeDiscShim

SafeDiscShim is a compatibility tool that allows for SafeDisc protected games which utilize the insecure Macrovision Security Driver ("secdrv.sys") to run on modern versions of Windows .
Other
386 stars 12 forks source link

Added a workaround for Alcohol/DT virtual drive bug #16

Open NicknineTheEagle opened 2 months ago

NicknineTheEagle commented 2 months ago

This introduces a workaround for a bug in SPTD SATA controller used by Alcohol and DAEMON Tools where it doesn't return LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE error for out-of-range sector reads - this includes track 1 pregap which later versions of SafeDisc try to check. If the disc drive returns an error then SafeDisc gives up and doesn't bother checking pregap but SPTD returns success code despite not actually returning any sector data so SafeDisc keeps checking pregap and then fails the disc check since it did not receive valid data from the virtual drive. This is only present on SPTD SATA controller which Alcohol (and presumably DT) uses on Windows 10. On Windows 7 and below, Alcohol emulates SCSI drive which doesn't have this bug.

The workaround checks if read command on negative LBA was attempted and success code was returned with empty output buffer. If yes, it manually writes LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE error.