免费教程_免费网赚教程_破解版软件-寂涯网络学习基地

当前位置: 主页 > 系统综合 > 各类编程 > 深入跟踪 Hello World 执行(11)

深入跟踪 Hello World 执行(11)

时间:2012-04-08 14:21来源:未知 整理:寂涯网络 点击:


.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

本页地址 http://www.jybase.net/biancheng/20120408819.html

百度搜索更多

谷歌搜索更多

顶一下
(1)
100%
踩一下
(0)
0%
------分隔线----------------------------

评价:
昵称: 验证码:点击我更换图片
推荐内容
赞助商
赞助商


关于本站免责声明视频更新google百度地图视频地图RRS订阅

如有什么问题请在本站留言,或发邮件到 hxt167#foxmail.com