Even if you are allowed to reverse engineer software in certain cases, directly taking what you learned from the effort and using it to write other code by yourself is another matter. It's the sort of situation we have "clean room" reverse engineering[1] procedures for.