下面是读扇区的代码
RedDisk proc
local @hFile
local @dwBytesRead
invoke GetDlgItemText,hWinMain,IDC_CUSTOMTEXT1,addr szBuffer,sizeof szBuffer
invoke CreateFile,addr drive,GENERIC_READ,FILE_SHARE_READ,0,OPEN_EXISTING,0,0
.if eax == INVALID_HANDLE_VALUE
invoke MessageBox,hWinMain,addr szErrOpenFile,NULL,MB_OK or MB_ICONEXCLAMATION
ret
.endif
mov @hFile,eax
invoke SetFilePointer,@hFile,addr szBuffer,0,FILE_CURRENT
invoke ReadFile,@hFile,addr @vexedBuffer,sizeof @vexedBuffer,addr @dwBytesRead,0
invoke CloseHandle,@hFile
.if eax == 0
invoke MessageBox,hWinMain,addr szErrWriteFile,NULL,MB_OK or MB_ICONEXCLAMATION
ret
.endif
invoke CreateFile,addr szLogExt,GENERIC_WRITE,FILE_SHARE_READ,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0
.if eax !=INVALID_HANDLE_VALUE
mov @hFile,eax
invoke WriteFile,@hFile,addr @vexedBuffer,sizeof @vexedBuffer,addr @dwBytesRead,0
invoke CloseHandle,@hFile
.if eax
invoke MessageBox,hWinMain,addr szWriteFile,NULL,MB_OK OR MB_ICONEXCLAMATION
.endif
.endif
ret
RedDisk endp
现在 是可以读取了,但读出来的数据和别的工具读出来的数据 不同.为什么呢.大家帮忙解答下,先谢谢了
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!