美文网首页
DDisasm Code Note

DDisasm Code Note

作者: 卷毛宿敌大小姐 | 来源:发表于2020-10-29 03:46 被阅读0次

ELF loader

Section

some section might be useful. We can know what they are by some flag.

  • SHF_SHARE(loadable):
    This section occupies memory during process execution Some control sections do not reside in the memory image of an object file. This attribute is off for those sections.
  • SHF_EXECINSTR(executable)
    This section contains executable machine instructions.
  • SHF_WRITE( writable)
    This section contains data that should be writable during process execution.
  • SHT_NOBITS(initialized)
    A section of this type occupies no space in the file but otherwise resembles SHT_PROGBITS. Although this section contains no bytes, the sh_offset member contains the conceptual file offset.
  • SHF_TLS(shouldn't be loaded)
    This section holds Thread-Local Storage, meaning that each separate execution flow has its own distinct instance of this data. Implementations need not support this flag.

Symbol

ddisasm skip symbol table (maybe just not all binary can have symbol table)
symbol may have version suffix("@"), delete them

Symbols with special section index do not have an address.

  • SHN_UNDEF:
    This section table index indicates that the symbol is undefined. When the link-editor combines this object file with another object that defines the indicated symbol, this file's references to the symbol is bound to the definition.
  • The system reserves indexes between SHN_LORESERVE and SHN_HIRESERVE, inclusive. The values do not reference the section header table. The section header table does not contain entries for the reserved indexes.

Aux Data

  • binary type (dyn/exec)
  • relocation
    Relocation is the process of connecting symbolic references with symbolic definitions. For example, when a program calls a function, the associated call instruction must transfer control to the proper destination address at execution. Relocatable files must have ``relocation entries'' which are necessary because they contain information that describes how to modify their section contents, thus allowing executable and shared object files to hold the right information for a process's program image.

相关文章

网友评论

      本文标题:DDisasm Code Note

      本文链接:https://www.haomeiwen.com/subject/kfghvktx.html