If you can read several million binary instructions that have absolutely no names, useful text or description of what’s happening.
Source code is written in a pseudo-English. That’s then compiled. Compiled code is “translated” to machine code. Machine code is basically binary, but with all the context and human-readable elements stripped out. You can read it as binary, or as hexadecimal (e.g. FF 06 E2 B4 ….).
Even if you convert those numbers back to assembly (which is *technically* readable, but good luck working out what the hell is going on without any context), it looks like this:
`push rbp`
`mov rbp, rsp`
`sub rsp, 16`
`mov DWORD [rbp-4], 64`
`mov eax, DWORD [rbp-4]`
`bsr eax, eax`
`xor eax, 31`
`mov DWORD [rbp-8], eax`
`mov eax, 32`
`sub eax, DWORD [rbp-8]`
`mov DWORD [rbp-12], eax`
`mov eax, DWORD [rbp-12]`
`mov edx, eax`
`shr edx, 31`
`add eax, edx`
`sar eax, 1`
`mov DWORD [rbp-12], eax`
`mov eax, DWORD [rbp-12]`
`mov edx, DWORD [rbp-4]`
`mov ecx, eax`
`sar edx, cl`
`mov eax, edx`
`mov DWORD [rbp-16], eax`
`mov eax, DWORD [rbp-16]`
`mov esi, eax`
`lea rdi, [rel formatter]`
`mov eax, 0`
`call _printf`
`mov eax, 0`
`leave`
`ret`
Good luck understanding that, even as a programmer.
The compiler literally chooses things that go by the most roundabout routes to do what’s necessary in order to save thousandths of a second, so even if you WROTE the code that results in the above, as someone who has coded in C or assembler, good luck interpreting what it’s actually doing without a lot of work.
Hell, I can barely tell you what human-readable code that I wrote 5 years ago does any more, let alone once it’s been washed through a compiler and all the helpful hints (e.g. variable names, etc.) removed.
BTW: That’s about 2 dozen instructions. A typical Windows program will be in the MILLIONS of instructions and call functions in libraries which are also in the MILLIONS of instructions.
Decompilation projects to try to do this for programs with lost source code usually take absolute genius programmers years, if not decades, to do. It’s actually quicker to “just write Windows again” than it would be to decompile Windows, for example.
Latest Answers