How do people reverse-engineer compiled applications to get the source code?

324 views

I know the long answer to this question would probably be the equivalent of a college course, but can you summarise how tech people do this?

If you open game.exe with a text editor you’re just going to get what looks like a scrambled mess of characters, so how would one convert this into readable source code?

In: 5

12 Answers

Anonymous 0 Comments

You get a scrambled mess of characters because the text editor tries to decode the contents of the file as texy, which it isn’t. It’s like trying to read Chinese when you don’t know the language.

The contents of the file are (among other things) instructions written in machine code. You can view the file using a program called a “disassembler”, which converts these into assembly code. Assembly is basically a human readable equivalent of machine code – instead of a bunch of 0s and 1s, you get commands like ADD, MUL and JMP.

Anonymous 0 Comments

It’s not “a scrambled mess of characters”, it’s the specific machine code of the computer processor it will run on. That’s known by the reverse-engineer, and they certainly have existing tools that can translate that “Windows on Intel” executable into assembly code. They it’s simply a matter of pattern matching the assembly code to higher level language constructs. Most reverse engineers read assembly code pretty well, so the goal of mapping 90% to C source, for example, is just to make the code take fewer pages to print out.