.text:08048444 call ds:( 8049FF4h)[ebx+esi*4] .text:0804844B add esi, 1 .text:0804844E cmp esi, edi .text:08048450 jb short loc_8048430 .text:08048452 CTOR_LIST -
.text:08048452 loc_8048452: ; CODE XREF: libc_csu_init+2C j .text:08048452 add esp, 0Ch .text:08048455 pop ebx .text:08048456 pop esi .text:08048457 pop edi .text:08048458 pop ebp .text:08048459 retn .text:08048459 libc_csu_init endp 我们对比看一下 glibc 源代码中 libc_cus_init,如下所示: 63 void 64 libc_csu_init (int argc, char **argv, char **envp) 65 { 66 /** For dynamically linked executables the preinit array is executed by 67 the dynamic linker (before initializing any shared object. */ 68 69 #ifndef LIBC_NONSHARED 70 /** For static executables, preinit happens rights before init. */ 71 { 72 const size_t size = preinit_array_end - preinit_array_start; 73 size_t i; 74 for (i = 0; i < size; i++) 75 (* preinit_array_start [i]) (argc, argv, envp); 76 } 77 #endif 78 79 _init (); 80 81 const size_t size = __init_array_end - init_array_start; 82 for (size_t i = 0; i < size; i++) 83 (* init_array_start [i]) (argc, argv, envp); 84 } 我们可以看到它最后调用了 init 这个函数,这个 init 也就是我们 ida 图中.init_proc, 如下 .init:08048294 ; Attributes: bp-based frame .init:08048294 .init:08048294 public _init_proc .init:08048294 _init_proc proc near ; CODE XREF: libc_csu_init+14 p .init:08048294 push ebp ; _init .init:08048295 mov ebp, esp .init:08048297 push ebx .init:08048298 sub esp, 4 .init:0804829B call $+5 .init:080482A0 pop ebx |