v3 = __readfsqword(0x28u); printf("Where would you like to sign(after the content): "); __isoc99_scanf("%u", &v1); if ( qword_4130[v1] ) { printf("You will overwrite some content: "); write(1, &qword_4130[v1], 8uLL); } printf("Enter your name: "); sub_17E9(src, 80LL); strncpy(&qword_4130[v1], src, 0x10uLL); return v3 - __readfsqword(0x28u); }
structlink_map { /* These first few members are part of the protocol with the debugger. This is the same format used in SVR4. */ //模块的基地址 ElfW(Addr) l_addr; /* Difference between the address in the ELF file and the addresses in memory. *///模块的基地址 char *l_name; /* Absolute file name object was found in. *///模块的文件名 ElfW(Dyn) *l_ld; /* Dynamic section of the shared object. *///指向elf的dyn节 structlink_map *l_next, *l_prev;/* Chain of loaded objects. */
/* All following members are internal to the dynamic linker. They may change without notice. */
/* This is an element which is only ever different from a pointer to the very same copy of this type for ld.so when it is used in more than one namespace. */ structlink_map *l_real;
/* Number of the namespace this link map belongs to. */ Lmid_t l_ns; //模块所属命名空间的idx
structlibname_list *l_libname; /* Indexed pointers to dynamic section. [0,DT_NUM) are indexed by the processor-independent tags. [DT_NUM,DT_NUM+DT_THISPROCNUM) are indexed by the tag minus DT_LOPROC. [DT_NUM+DT_THISPROCNUM,DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM) are indexed by DT_VERSIONTAGIDX(tagvalue). [DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM, DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM) are indexed by DT_EXTRATAGIDX(tagvalue). [DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM, DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM+DT_VALNUM) are indexed by DT_VALTAGIDX(tagvalue) and [DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM+DT_VALNUM, DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM+DT_VALNUM+DT_ADDRNUM) are indexed by DT_ADDRTAGIDX(tagvalue), see <elf.h>. */ /* l_info是ELF节描述符组成的的数组 ELF中一个节, 使用一个ElfW(Dyn)描述 各个类型的节在l_info中的下标固定, 因此可以通过下标来区分节的类型 */ ElfW(Dyn) *l_info[DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM + DT_ADDRNUM]; constElfW(Phdr) *l_phdr; /* Pointer to program header table in core. *///elf的头表 ElfW(Addr) l_entry; /* Entry point location. *///elf的入口 ElfW(Half) l_phnum; /* Number of program header entries. *///头表的节数 ElfW(Half) l_ldnum; /* Number of dynamic segment entries. *///dyn中的描述符数量