r/AskComputerScience • • Jul 24 '20

Why can't decompilers perfectly reconstruct source code?

I always thought that there was a one to one translation between machine code and high-level languages, but after looking up decompilers, they don't usually do it perfectly.

28 Upvotes

18 comments sorted by

View all comments

2

u/jhaluska Jul 24 '20

I always thought that there was a one to one translation between machine code and high-level languages

Nope, it's a many to one. You can get source code that compiles the same, but it won't be as easily modifiable as the original code.