Ticket #482: PL2773 reverse engineering.txt

File PL2773 reverse engineering.txt, 2.3 KB (added by TomVe, 9 years ago)

sg_raw commands replicating output from ismart.exe

Line 
120141104/TOV
2Testing of Prolific PL2773 based on reverse engineering from ismart.exe with API monitor.
3Commands replicated with sg_raw
4
5sudo sg_raw -v -v -r 0x100 /dev/sdb d0 0 0 0 06 7b 0 0 0 0 0 0
6# ismart.exe only requests 16 bytes, but block is 256 long and then repeats
7# First 16 bytes seems like firmware version info
8# Some bytes change value on consecutive runs?!
9Received 256 bytes of data:
10 00 06 7b 27 73 20 11 05 24 08 21 00 01 03 00 04 00 .{'s ..$.!......
11 10 00 00 94 57 ce 2d 8f 9f ef e9 ed ff 7e 83 be 0f ...W.-......~...
12...
13
14sudo sg_raw -v -v -r 0x18 /dev/sdb F4 0 0 0 6 7b
15# Makes some error?!
16SCSI Status: Check Condition
17
18Sense Information:
19 Fixed format, current; Sense key: Illegal Request
20 Additional sense: Invalid command operation code
21 Raw sense data (in hex):
22 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00
23 00 00
24
25sudo sg_raw -v -v /dev/sdb D8 15 0 D8 06 7B 0 0 0 0 1 1 4F C2 A0 B0
26# Makes disk make noises...
27# B0 = ATA_SMART_CMD
28# D8 = SMART Enable
29
30sudo sg_raw -v -v -r 0x24 /dev/sdb 12 0 0 0 24 0 0 0 0 0 0
31# Returns device info
32Received 36 bytes of data:
33 00 00 00 00 00 23 00 00 00 57 44 43 20 57 44 32 30 ....#...WDC WD20
34 10 45 41 52 53 2d 30 30 4d 56 57 42 30 20 20 20 20 EARS-00MVWB0
35 20 35 31 2e 30 51.0
36
37sudo sg_raw -v -v -r 512 /dev/sdb D8 15 0 D0 06 7B 0 0 2 0 1 1 4F C2 A0 B0
38# B0 = ATA_SMART_CMD
39# D0 = READ_VALUES
40
41sudo sg_raw -v -v -r 512 /dev/sdb D8 15 0 D1 06 7B 0 0 2 0 1 1 4F C2 A0 B0
42# B0 = ATA_SMART_CMD
43# D1 = READ_THRESHOLDS
44
45sudo sg_raw -v -v /dev/sdb D8 15 0 D4 06 7B 0 0 0 0 0 1 4F C2 A0 B0
46# Starts a selftest (Disk makes noises for a while!)
47# B0 = ATA_SMART_CMD
48# D4 = SMART Execute Off-line immediate
49
50sudo sg_raw -v -v -r 0x10 /dev/sdb D7 0 0 0 06 7B 0 0 0 0 0 0 0 0 0 0
51# ATA status registers
52# Receives 16 bytes of data
53# Different examples when fooling around:
54 00 50 00 00 00 09 00 4f 00 c2 00 a0 d5 00 b0 00 50 P.....O........P
55 00 50 00 00 00 01 00 4f 00 c2 00 a0 d9 00 b0 00 50 P.....O........P
56 00 fa c3 13 1c 06 72 9f f8 3b ba 06 01 98 00 00 d1 .....r..;.......
57 00 51 04 01 00 b4 00 4f 00 c2 00 a0 d9 00 b0 00 50 Q.....O........P
58 00 50 00 00 00 01 00 4f 00 c2 00 a0 d8 00 b0 00 50 P.....O........P
59
60
61