afs_mp
afs_mp

Reputation: 77

difference between .text and .code section name

I work with pe files analyzer sofwares like exeinfoPe and in section list part there are both .text and CODE section types that we can use them for example change .data name to .text or CODE or other section names. are these section typesthe same? what is difference between them?

Upvotes: 2

Views: 4477

Answers (2)

N. S.
N. S.

Reputation: 169

There is no semantic difference between the .CODE and .TEXT sections. Just as in the MASM assembler, the instruction space address is named by .CODE section, and in other compilers is named by .CODE.

So when you assemble your code with MASM you will see .CODE section as well as .TEXT.

Upvotes: 0

Cody Gray
Cody Gray

Reputation: 244941

There is no functional difference between the .text and .code sections of a binary.

In almost all cases, they are completely synonymous (meaning that they refer to the same section), but even when they're not (e.g. due to the actual order of sections in the binary), they are semantically identical.

This is the section of the object file or address space that contains executable instructions ("code"), which are stored as plain text ("text"). It is almost always read-only, unlike the .data section.

Consult the documentation for your assembler, compiler, linker, or disassembler to see which name it prefers. The PE format uses .text.

Upvotes: 4

Related Questions