Does anyone know how the driver is detecting counterfeit chips? It would be nice to package that up for running on an old system, just for checking suspect boards/etc...
It's NOT detecting counterfeit chips, it's writing a sequence of commands that are ignored if the EEPROM on the chip is implemented the way it is on the FT232RL. The code is specifically designed to set the PID to zero and fix the checksum by only writing to locations that are buffered and not written in a legitimate FTDI chip.
It would be possible to make a version of this that performs a test read, write, read, and restore operation to check to see how the EEPROM is implemented, but it would not be without risk as interrupting the cycle between writes could leave the non-FTDI part in an inconsistent state.
I think there is one point that needs to be made clear: the counterfeit chips are counterfeits because they are marked with the FTDI logo and part number, not because they present the FTDI VIN and PIN and speak (nominally) the same protocol. I think many of the 'counterfeit' FTDI chips are actually legitimate FTDI-compatible clones that have been re-marked. This is the main reason why FTDI's actions are illegal as they target legitimate clones as well as counterfeit chips, where the only difference is the package marking.