Messages in this thread | | | Date | Fri, 24 Oct 2014 02:05:32 +0900 | From | Hector Martin <> | Subject | Re: [PATCH] usb: serial: Perform verification for FTDI FT232R devices |
| |
On 23/10/14 23:14, Russ Dill wrote: > On Thu, Oct 23, 2014 at 5:44 AM, Hector Martin <hector@marcansoft.com> wrote: >> + write_eeprom(port, 0, eeprom_data[0]); >> + write_eeprom(port, 1, 0); >> + write_eeprom(port, eeprom_size - 2, eeprom_data[eeprom_size - 2]); >> + write_eeprom(port, eeprom_size - 1, checksum); > > Damned off by one errors. Yes, it should be the product ID, not the > vendor ID. These write u16's though, writing to wIndex 2 writes to > bytes 4 and 5. the correct code is: > > write_eeprom(port, 2, 0); > write_eeprom(port, eeprom_size - 2, checksum); > > And yes, the checksum code needs to be modified to create a specially > crafted value that allows the existing checksum to pass.
Oh, I thought/assumed that the switch to VID and the real checksum was a deliberate attempt at perversing the original code into something that bricks even real FTDIs :-) (In which case all you'd need to add is the two extra dummy writes, to load the proper data into the buffer register on a real FT232RL to prevent it from corrupting the adjacent EEPROM words).
-- Hector Martin (hector@marcansoft.com) Public Key: http://www.marcansoft.com/marcan.asc
| |