U盘BOT存储UFI协议READ(10)命令:0x28
2022-05-23
1959
0
READ(10)命令请求UFI设备将数据传输到主机。应返回写入寻址逻辑块的最新数据值。
#define READ_DATA 0x28
UFI READ(10)命令格式
- DPO:为0
- FUA:为0
- RelAdr:为0
55 53 42 43 a0 69 49 b4 00 10 00 00 80 00 0a 28 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 //OUT
... //IN数据
55 53 42 53 a0 69 49 b4 00 00 00 00 00 // IN CSW
#define SwapUSHORT(A) (( ((USHORT)(A) & 0xff00) >> 8) | ((USHORT)(A) & 0x00ff) << 8)
typedef struct _READ_CMD
{
#pragma pack(1)
UCHAR cmd;
UCHAR Reserved : 5;
UCHAR LogicalUnitNum : 3;
ULONG LogicalBlockAddress;
UCHAR Reserved2;
USHORT TransferLength;
UCHAR Reserved3[3];
#pragma pack()
}READ_CMD;
READ_CMD* pReadCmd = (READ_CMD*)deviceExtension->cbw.CBWCB;
USHORT len = SwapUSHORT(pReadCmd->TransferLength);
ULONG Lba = SwapULONG(pReadCmd->LogicalBlockAddress);
HID人机交互QQ群:564808376
UAC音频QQ群:218581009
UVC相机QQ群:331552032
BOT&UASP大容量存储QQ群:258159197
STC-USB单片机QQ群:315457461
USB技术交流QQ群2:580684376
USB技术交流QQ群:952873936