Of course, everything can be reverse engineered given enough effort (but you wouldn't legally be able to use it for any public or commercial purpose). |
That's not necessarily true. It depends on the specific method of re-engineering and on whether the software is covered by any patents (if software patents are allowed in the particular jurisdiction).
If you just inspect the binary and reimplement the program (or pieces thereof) verbatim elsewhere, that would be illegal under copyright law.
What's usually done to get around that is clean-room engineering, where one engineer or team of engineers does the reverse engineering and writes a technical document about their findings, taking care to stay at a sufficiently high level. For example in the case of Photoshop the reverse engineer may try to find the algorithm for a specific image transformation, and then describe the algorithm abstractly.
Then a different team takes that document and implements the requirements described in it. It's important to avoid contamination that none of these engineers has ever been exposed to any code by the original developer (in this example, Adobe).
Clean room engineering isn't fool-proof, however. Going back to the previous example, if the algorithm behind that image transformation is patented, to use it you will still need to pay a license to use it. Although if it's patented you wasted resources by reverse engineering it, because the algorithm should be described in the patent application.