There's no need to reverse engineer. The ST Link schematics are published (e.g., as part of the Discovery & Nucleo board schematics) and the firmware is available for download as well.
So it's fairly straightforward to incorporate an ST Link programmer into your own board. Whether that might violate any ST copyrights, etc., I have no idea.