1
0

commands.txt 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. ---
  2. >> 0x00
  3. description:
  4. Read a page with some sort of device info
  5. type: request
  6. command:
  7. CBWCB = 0xFF 0x00 0x00 0x03 0x00 0x27 0x00 0x00 0x00 0x00 0x00 0x00
  8. byte data description
  9. ------------------------------------------------------------------------------
  10. 0 0xFF SCSI opcode
  11. 1-2 0x0000 command
  12. 3-4 0x0003 Page number
  13. 5-6 0x27 Request data length
  14. 9 0x0 ??? sofware update tool also uses 0x01 here
  15. valid page numbers according to bCSWStatus:
  16. verbatime: 0x3, 0x4, 0x6, 0x8, 0xa, 0xc, 0xe, 0x13, 0x14
  17. data:
  18. 6+ bytes
  19. 0000 03 00 01 00 27 00 |....'. |
  20. byte data description
  21. ------------------------------------------------------------------------------
  22. 0-1 0x0003 page number
  23. 2-3 0x0001 ??? mostly 0x01, once 0x03
  24. 4-5 0x0027 total usefull data length (including 6 byte header)
  25. page 0x03:
  26. 0000 03 00 01 00 27 00 77 00 00 00 03 81 07 06 54 30 |....'.w.......T0|
  27. 0016 30 30 30 31 31 41 31 41 41 31 31 41 41 41 31 81 |00011A1AA11AAA1.|
  28. 0032 07 06 54 91 4e 0f 00 |..T.N..|
  29. byte data description
  30. ------------------------------------------------------------------------------
  31. 0-5 header(see above)
  32. 6 Real size of full record...????
  33. 7-11 ??? same for both verbatime and sandisk
  34. 11-14 0x54060781 ??? same as @ byte 31 (actual value different on verbatim)
  35. 15-30 "000011A1AA11AAA1" Serial number
  36. 31-34 0x54060781 ??? same as @ byte 11
  37. 35-38 0x000f4e91 Device size in 512-byte blocks
  38. page 0x0c:
  39. 0000 0c 00 01 00 0a 00 10 27 00 00 |.......'.. |
  40. byte data description
  41. ------------------------------------------------------------------------------
  42. 0-5 header(see above)
  43. 6-9 0x00002710 Maximum wrong password try for secure zone.
  44. ---
  45. >> 0x20
  46. description:
  47. Round CD size to a value the device likes
  48. type: action
  49. command:
  50. CBWCB = 0xFF 0x20 0x00 0x02 0xFF 0x03 0x00 0x00 0x00 0x00 0x00 0x00
  51. byte data description
  52. ------------------------------------------------------------------------------
  53. 0 0xFF scsi opcode
  54. 1-2 0x0020 command
  55. 3 0x02 ??? can atleast be 0x02 and 0x03 but not 0, 1, 4, is
  56. this some sort of domain id to select the partition,
  57. like in 0x21, byte 3??? the verbatim is less picky and
  58. accepts all values...
  59. 4-7 0x3FF Value to round (in 512-byte sectors)
  60. 8 0x0 Direction to round(0x00 = down, 0x01 = up)
  61. data:
  62. 4 bytes
  63. 0000 00 02 00 00 |....|
  64. byte data description
  65. ------------------------------------------------------------------------------
  66. 0-3 0x200 Rounded value
  67. ---
  68. >> 0x21
  69. description:
  70. get information about the partition configuration
  71. type: request
  72. command:
  73. CBWCB = 0xFF 0x21 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
  74. byte data description
  75. ------------------------------------------------------------------------------
  76. data:
  77. 0000 02 02 00 00 00 91 1e 0f 00 03 01 00 00 00 30 00 |..............0.|
  78. can be read in any multiple of 8 all dat beyond the above data is zero(0)
  79. u3-remover uses the following data(IIRC), (0x0f4e91 == full drive size):
  80. 0000 01 02 00 00 00 91 4e 0f 00 |......... |
  81. byte data description
  82. ------------------------------------------------------------------------------
  83. 0 02 amount of available records, where 1 record = 8 byte???
  84. 1 02 ??? some sort of domain id???
  85. 3-4 00 00 00 ??
  86. 5-8 0x000F1E91 size of data partition in 512-byte sectors
  87. 9 0x03 ?? some sort of domain id????
  88. 10 0x01 ?? WARNING: If set to 0 on Sandisk cruzer, cd drive
  89. will show up as direct-access, but can't be used, also
  90. drive doesn't react to command 0x00, page 3 and you
  91. won't be able to re-partition device!!!!
  92. 11-12 00 00 ??
  93. 13-15 0x003000 size of cdrom partitoin in 512-byte sectors
  94. ---
  95. >> 0x22
  96. description:
  97. Repartition device
  98. type: action
  99. command:
  100. CBWCB = 0xFF 0x22 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
  101. byte data description
  102. ------------------------------------------------------------------------------
  103. data:
  104. 0000 02 02 00 00 00 91 1e 0f 00 03 01 00 00 00 30 00 |..............0.|
  105. 0016 00 |. |
  106. byte data description
  107. ------------------------------------------------------------------------------
  108. 0 0x02 amount of dword of data(+1byte+1dword=packet_size)
  109. 1-4 0x00000002 ???
  110. 5-8 0x000f1e91 Size of data partition in 512-byte sectors
  111. 9-12 0x00000103 ??? 0x0003 make's it a direct access partition.(but can't partition afterwards, and page 3 of command 0x0000 isn't accessible anymore...)
  112. 13-16 0x00003000 Size of CD partition in 512-byte sectors
  113. ---
  114. >> 0x42
  115. description:
  116. Write block of data to CD-rom partition
  117. type: action
  118. command:
  119. CBWCB = 0xFF 0x42 0x00 0x01 0x00 0x00 0x01 0x1D 0x00 0x00 0x00 0x01
  120. byte data description
  121. ------------------------------------------------------------------------------
  122. 0 0xFF scsi opcode
  123. 1-2 0x42 command
  124. 3 0x01 ???
  125. 4-7 0x0000011D Block Address (Big Endian!!!!!!!)
  126. 8-11 0x01 ??? (Big Endian?)
  127. data:
  128. A 2048 byte block
  129. ---
  130. >> 0x61
  131. description:
  132. read out hidden data/config storage. Looks the same as with mDrive.
  133. type: request
  134. command:
  135. CBWCB = 0xFF 0x61 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
  136. byte data description
  137. ------------------------------------------------------------------------------
  138. data:
  139. byte data description
  140. ------------------------------------------------------------------------------
  141. ---
  142. >> 0x63
  143. description:
  144. read out hidden data/config storage. Looks the similar as with mDrive.
  145. type: request
  146. command:
  147. CBWCB = 0xFF 0x63 0x00 0x00 0x00 0x55 0x33 0x49 0x4E 0x50 0x52 0x50
  148. byte data description
  149. ------------------------------------------------------------------------------
  150. data:
  151. byte data description
  152. ------------------------------------------------------------------------------
  153. ---
  154. >> 0xA0
  155. description:
  156. get some sort of data partition information
  157. type: request
  158. command:
  159. CBWCB = 0xFF 0xA0 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
  160. byte data description
  161. ------------------------------------------------------------------------------
  162. data:
  163. 16 byte
  164. 0000 40 ab 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 |@...............|
  165. 0000 40 ab 1d 00 40 ab 1d 00 01 00 00 00 00 00 00 00 |@...@...........| (secured)
  166. byte data description
  167. ------------------------------------------------------------------------------
  168. 0-3 0x001dab40 Total data partition size
  169. 4-7 0x001dab40 Amount of data partition encrypted????
  170. 8-11 0x00000001 Lock(=0) or Unlocked(=1)
  171. 12-15 0x00000000 Wrong password try counter
  172. ---
  173. >> 0xA1
  174. description:
  175. FUZED
  176. type: Request?
  177. command:
  178. CBWCB = 0xFF 0xA1 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
  179. byte data description
  180. ------------------------------------------------------------------------------
  181. 0 scsi opcode
  182. 1-2 command
  183. 3 0 Failes on Sandisk if != 0
  184. 4- changing these doesn't seem to have any effect
  185. data:
  186. data is random, and changes due to executing commands
  187. byte data description
  188. ------------------------------------------------------------------------------
  189. ---
  190. >> 0xA2
  191. description:
  192. Secure data partition
  193. Password hash is a md5 sum of the unicode password including the terminating
  194. null. So for a password of 'a' the following byte stream is fead to the md5
  195. function: 0x61 0x00 0x00 0x00 == UNICODE "a\0"
  196. It seems that if the whole of the data partition is made secure zone, then
  197. the data currently on the data partition is accessible in the secure zone.
  198. If only a part of the data partition is made secure zone than the first part
  199. of the data on the partition is retained and the rest isn't accessible. In
  200. this case the secure zone will contain garbage(the data on that was on that
  201. part of the data partition but decrypted with an other key).
  202. If the device is already secured and this command is issued again, the current
  203. data on the device is lost(if secure zone == 100%).
  204. type: action
  205. command:
  206. CBWCB = 0xFF 0xA2 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
  207. byte data description
  208. ------------------------------------------------------------------------------
  209. data:
  210. 20 byte
  211. 0000 40 ab 1d 00 33 2c e7 85 e9 73 57 4a 1c 5f da f3 |@...3,...sWJ._..|
  212. 0016 ee e3 f0 83 |....|
  213. byte data description
  214. ------------------------------------------------------------------------------
  215. 0-3 0x001dab40 Size of private zone????
  216. 4-19 ... Password hash ( pass='a')
  217. ---
  218. >> 0xA3
  219. description:
  220. value rounding for data partition securing
  221. type: request
  222. command:
  223. CBWCB = 0xFF 0xA3 0x00 0x00 0x40 0xAB 0x1D 0x00 0x01 0x00 0x00 0x00
  224. byte data description
  225. ------------------------------------------------------------------------------
  226. 0 0xFF scsi opcode
  227. 1-2 0x00A3 Command
  228. 3 0x00 ???
  229. 4-7 0x001DAB40 Value to round (in 512-byte sectors)
  230. 8 0x01 Direction to round(0x00 = down, 0x01 = up)
  231. data:
  232. 4 byte
  233. 0000 40 ab 1d 00 |@...|
  234. byte data description
  235. ------------------------------------------------------------------------------
  236. 0-3 0x001DAB40 Rounded value
  237. ---
  238. >> 0xA4
  239. description:
  240. unlock device
  241. Password hash is a md5 sum of the unicode password including the terminating
  242. null. So for a password of 'a' the following byte stream is fead to the md5
  243. function: 0x61 0x00 0x00 0x00 == UNICODE "a\0"
  244. type: action
  245. command:
  246. CBWCB = 0xFF 0xA4 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
  247. byte data description
  248. ------------------------------------------------------------------------------
  249. data:
  250. 16 byte
  251. 0000 33 2c e7 85 e9 73 57 4a 1c 5f da f3 ee e3 f0 83 |3,...sWJ._......|
  252. byte data description
  253. ------------------------------------------------------------------------------
  254. 0-15 ... password hash (pass='a')
  255. ---
  256. >> 0xA6
  257. description:
  258. change password
  259. Password hash is a md5 sum of the unicode password including the terminating
  260. null. So for a password of 'a' the following byte stream is fead to the md5
  261. function: 0x61 0x00 0x00 0x00 == UNICODE "a\0"
  262. type: action
  263. command:
  264. CBWCB = 0xFF 0xA6 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
  265. byte data description
  266. ------------------------------------------------------------------------------
  267. data:
  268. 0000 33 2c e7 85 e9 73 57 4a 1c 5f da f3 ee e3 f0 83 |3,...sWJ._......|
  269. 0016 c0 51 c1 bb 98 b7 1c cb 15 b0 cf 9c 67 d1 43 ee |.Q..........g.C.|
  270. byte data description
  271. ------------------------------------------------------------------------------
  272. 0-15 ... Old password hash ( pass='a')
  273. 16-31 ... New password hash ( pass='b')
  274. ---
  275. >> 0xA7
  276. description:
  277. Remove security
  278. Password hash is a md5 sum of the unicode password including the terminating
  279. null. So for a password of 'a' the following byte stream is fead to the md5
  280. function: 0x61 0x00 0x00 0x00 == UNICODE "a\0"
  281. hmm... if security zone size != size of data partition, then this fails!!!
  282. it returns a failed status but doesn't increase the password try counter,
  283. even if password was incorrect.... to remove the secure zone if it doesn't
  284. fully occupy the data partition, recreate the secure zone with maximum size.
  285. > Possible cause: If this command is issued the secure zone becomes the public
  286. zone, and thus all data on the disk will be retained. It is suspected that all
  287. partitions/zones are stored encrypted on the flash device(Yes, even the public
  288. zone). So, if this command is issued the secure zone key is decrypted(if
  289. encrypted at all) and the zone is marked as public. Logically this would not
  290. work if there is a public and secure zone. Then you would end up with two
  291. public zone's with different encryptions keys.
  292. Byte 3 of command does something... but still doesn't allow for removing half
  293. secure zones.
  294. type: action
  295. command:
  296. CBWCB = 0xFF 0xA7 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
  297. byte data description
  298. ------------------------------------------------------------------------------
  299. data:
  300. 0000 c0 51 c1 bb 98 b7 1c cb 15 b0 cf 9c 67 d1 43 ee |.Q..........g.C.|
  301. byte data description
  302. ------------------------------------------------------------------------------
  303. 0-15 ... Password hash (in this case 'b')
  304. ---
  305. >> 0x100
  306. description:
  307. seen used after a 0xA4(with some normal scsi stuff in between...).
  308. generate reset some sort of reset or insert condition on data disk. Linux old 2.4
  309. usb-storage sees it as a disconnect of the drive.
  310. type:
  311. command:
  312. CBWCB = 0xFF 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
  313. byte data description
  314. ------------------------------------------------------------------------------
  315. data:
  316. No data....
  317. ---
  318. >> 0x101
  319. description:
  320. disconnect's and possibly reconnects device
  321. type: action
  322. command:
  323. CBWCB = 0xFF 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
  324. byte data description
  325. ------------------------------------------------------------------------------
  326. data:
  327. 12 bytes
  328. 0000 50 00 00 00 40 9c 00 00 01 00 00 00 |P...@.......|
  329. byte data description
  330. ------------------------------------------------------------------------------
  331. 8 0x01 If 1 reconnect after disconnect, else not
  332. all other byte's dont seem to have any effect...
  333. ---
  334. >> 0x103
  335. description:
  336. Get chip maker and version
  337. type: request
  338. command:
  339. CBWCB = 0xFF 0x03 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
  340. byte data description
  341. ------------------------------------------------------------------------------
  342. data:
  343. 24 bytes
  344. 0000 33 2e 32 31 00 00 00 00 53 61 6e 44 69 73 6b 20 |3.21....SanDisk |
  345. 0016 00 00 00 00 00 00 00 00 |........|
  346. byte data description
  347. ------------------------------------------------------------------------------
  348. 0-7 "3.21" Chip version
  349. 8-23 "SanDisk" Chip maker
  350. possible read commands:
  351. 0x20
  352. 0x21
  353. 0x61
  354. 0x63
  355. 0x68
  356. 0x6b 512?
  357. 0x81 128-byte
  358. 0x84 64-byte
  359. 0x85 64-byte
  360. 0x88 64-byte
  361. 0xa1 4-byte
  362. 0xc1
  363. 0xe2 = read random?, 64-byte
  364. 0x102 512-byte
  365. Write:
  366. 0x01 -> 0x1f
  367. 0x22 -> 0x40
  368. 0x42
  369. 0x60
  370. 0x62
  371. 0x6a
  372. 0x6c
  373. 0x6d
  374. 0x6e
  375. 0x82 128 byte
  376. 0x83 64 byte?
  377. 0x86
  378. 0x87
  379. 0xc0
  380. 0xc2
  381. ---
  382. >>
  383. description:
  384. type:
  385. command:
  386. byte data description
  387. ------------------------------------------------------------------------------
  388. data:
  389. byte data description
  390. ------------------------------------------------------------------------------