Search the Community
Showing results for tags 'but HDDs are OK'.
Found 1 result
I can do a raw write to a hard drive, even when hooked up through a USB bridge, but can not to a flash drive. Any theories?? **PLEASE BE CAREFUL WITH THIS TEST SCRIPT!!!!!!!! I have it hard-coded for \\.\PHYSICALDRIVE2, if you are unsure of what that is, or how to determine which drive that may be for you, or care at all about the data on that drive should you be able to identify it, then DO NOT RUN THIS TEST!! #include <WinAPI.au3> $ChunkSize = 8 * 1024 * 1024 ConsoleWrite("building zero fill data, be patient" & @CR) $ZeroFill = "" For $a = 1 To $ChunkSize $ZeroFill &= Chr(0) Next $Destination = _WinAPI_CreateFile("\\.\PHYSICALDRIVE2", 2, 4); CAREFUL!!!!!!!! BE SURE TO CHECK THIS!!!!! Local $nBytes, $nBytesWritten Local $tBuffer = DllStructCreate("byte[" & $ChunkSize & "]") Local $pBuffer = DllStructGetPtr($tBuffer) DllStructSetData($tBuffer, 1, $ZeroFill) $Write = _WinAPI_WriteFile($Destination, $pBuffer, $ChunkSize, $nBytesWritten) MsgBox(0, "Status", "Open Destination: " & $Destination & @CR & "Write: " & $Write) Setting the PHYSICALDRIVE number to a hard drive will return 1 for $Write. Any ideas would be appreciated, I have a suite of drive tools nearing completion and this issue has been stopping me for long enough! Forensic images, disk-to-disk cloning, testing, and wiping will be included in the suite. Thanks for any help! Ian