Is .exe only pure machine code?

When a high-level programming language is compiled, it is compiled into object code, and then the linker links the objects together to create an executable file.

  • Since object codes are mostly machine code, that means .exe is pure machine code, am I right?

  • If so, is it possible if you know what kind of machine code .exe was used to convert this (.exe) machine code into an assembly and then into a high-level language (source code)?

+4
source share
3 answers

To answer your first question, no. The executable file usually does not contain pure machine code, but also contains various metadata to help the operating system find the dependencies of the program (provided that the program uses external libraries), as well as contain various static data embedded inside.

Typically, an executable file consists of various sections (although keep in mind that the "Executable file" depends on the platform and operating system), these sections are designed to store metadata, static data and executable code.

, , ( , , 1:1 ), (, , - ). , EXE , - - , / .

Linux readelf objdump. .

+3

Windows.EXE x86 x86-64, . . x86 x86-64 , , (IDA Disassembler , , C, , .EXE). .EXE , . Opcodes , , , , .EXE , , .EXE, ( , ). , , , , . , .EXE , CIL, ( .NET Mono).

+3

.

"" (exe, coff, elf ..) - , , , , ​​ .., .

, . , , . , , .

, , .. , , , , .

, , java, JIT, , , . , , .

For work where you are dealing with processor loading, for example, microcontrollers or a boot flash on a PC, or something like that where you need a prom image, sometimes a pure binary file is created, because this is what the bootloader or graduate programmer, although over time, downloaders and graduate programmers begin to accept other file formats.

+2
source

All Articles