That's called a clean room implementation and was the standard way to make x-compatible products (like for example, the bios on an IBM PC clone). Not sure what the current legal standing of that method is.
EDIT: Ninjad because I left the reply in a tab without posting.