Trying to answer superficially, this is a file in a certain format, as well as there are database formats, texts, spreadsheets, images, etc. This is a format that the operating system recognizes and knows what to do with the content inside. It contains instructions on how to put the relevant content in memory. It also has the instructions and static data of the application. One can understand this as a "textion" that some component will know how to deal with. It is not a plain text because it allows extra characters that are not present in texts, so it is called binary.
The operating system will tell the processor that it must execute the instructions contained there (within its internal scheduling system) and it will "interpret" those characters to decide what to do within it.
Some architectures have instructions of fixed size and others of variable size. Each character or character set indicates which instruction is to be executed and which "operands" are to be used in this operation. The processor will process the bits of these operands (if any) or some register or other thing previously defined by the instruction. Then it goes to the next instruction - eventually an instruction can change which one is next (deviation). In most operating systems this occurs until a previously defined signaling returns control to the operating system.
This can be best seen in How a computer understands binary code?.
It’s much more complex than that, but I’m already stretching. The important thing is that each character of these indicates something that the processor knows what to do. In the background the characters are numbers according to the extended ASCII table - it is shown so because it can make it easier to read something that is being interpreted as a common text (after all it was used a text editor), it is possible to see in other ways, you can even see their bits, each one chooses how he wants to visualize.
A code written in high-level language can be compiled to generate this, or a code in Assembly can be assembled. There is a 1:1 direct relationship between the Assembly instructions and these characters (set). Therefore the machine code can be easily converted to the approximate raw assembly that generated it (far from being readable) by a Desmontador. Assembly is an "easier" code for a human to read - even because it has comments, machine code is easier for the computer.
A suitable utility to view binary code is the objdump
or dumpbin
.
The links in the comments help to give a better idea of the subject.
What do you mean "how does it work?"? Be more specific in your question. Was this code written in Assembly? So it wasn’t compiled, and so there’s no point in talking about decompilation.
– Maniero
@bigown If he’s like this it’s because it’s compiled, right? Full of symbols. That’s not Assembly and I was specific, but it came from Assembly!
– Klaider
Assembly is not machine code, machine code is composed of 0s and 1s, and the size of the word varies, it depends on the architecture of the processor.
– gato
@But it’s been said that he is. I’m being fooled by the way...
– Klaider
@Theprohands Assembly is an assembly language to make machine code readable to human, and it also varies for each type of processor, depends on the family of processors, each family already has its instructions already defined in Assembly.
– gato
I don’t know if what you want to learn is machine code or Assembly.
– gato
@Theprohands no, compilation is something else. Some things that might help you: http://answall.com/q/104814/101, http://answall.com/q/101691/101 and http://answall.com/q/77070/101. If you think someone taught you wrong, you might want to put it where you saw it. And it wasn’t specific, the doubt is very general. You don’t know what you really want to know. Unless you’re asking us to write a chapter in a book about how codes work, then the question really doesn’t fit. If you’re more specific, you can save her.
– Maniero
Others that may help: http://answall.com/q/91775/101, http://answall.com/q/109886/101, http://answall.com/q/102452/101
– Maniero
I repeat, there is no assembly compiler. There is Assembler, i.e., assembler. There is even a compiler (if you can call it macros for assembly, but there is something else.
– Maniero
@Yes, I get it. I mean, the machine code is Assembly. It’s always said that I’m not specific, but I wanted to know what each symbol means, so I asked. Anyway, I found what I was looking for, hardly. The older 16-year-olds up seem to want to hide Assembly and its documentation so no one else can learn, amazingly.
– Klaider
No. Machine code is one thing, Assembly is another. Oh, you want a complete manual of that. There are books with more than 1000 pages that show that. That’s nothing specific. Yeah, there must be a conspiracy of over 16 years.
– Maniero
@bigown Books completely impossible to find, as always. Do not quote much on these symbols, so I get confused.
– Klaider
You can use Ollydbg to perform this reverse engineering.
– Laerte
@Laerte What I would do is what these tools do, although for another type of project without using these tools.
– Klaider