readelf的demo

查看整体结构

这里写图片描述

查看文件头

这里写图片描述

用file大概看一下

这里写图片描述

查看节表

这里写图片描述

查看符号表

root@kali:~/repos/apk# readelf -s libweibosdkcore.so

Symbol table '.dynsym' contains 76 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 00000000     0 FUNC    GLOBAL DEFAULT  UND __cxa_finalize
     2: 00000000     0 FUNC    GLOBAL DEFAULT  UND __cxa_atexit
     3: 00003900     8 FUNC    GLOBAL DEFAULT    7 __aeabi_unwind_cpp_pr0
     4: 00000000     0 FUNC    GLOBAL DEFAULT  UND __stack_chk_fail
     5: 00000000     0 OBJECT  GLOBAL DEFAULT  UND __stack_chk_guard
     6: 00001a85   148 FUNC    GLOBAL DEFAULT    7 MDString
     7: 00000000     0 FUNC    GLOBAL DEFAULT  UND memset
     8: 00000000     0 FUNC    GLOBAL DEFAULT  UND strlen
     9: 00000000     0 FUNC    GLOBAL DEFAULT  UND sprintf
    10: 00000000     0 FUNC    GLOBAL DEFAULT  UND memcpy
    11: 00000000     0 FUNC    GLOBAL DEFAULT  UND malloc
    12: 00000000     0 FUNC    GLOBAL DEFAULT  UND strtol
    13: 00000000     0 FUNC    GLOBAL DEFAULT  UND free
    14: 00000000     0 FUNC    GLOBAL DEFAULT  UND tolower
    15: 00000000     0 FUNC    GLOBAL DEFAULT  UND strcpy
    16: 000038f8     8 FUNC    WEAK   DEFAULT    7 __aeabi_unwind_cpp_pr1
    17: 00002331    84 FUNC    GLOBAL DEFAULT    7 getDirFileObj
    18: 000023dd    88 FUNC    GLOBAL DEFAULT    7 getFileObj
    19: 00000000     0 FUNC    GLOBAL DEFAULT  UND strcasecmp
    20: 00000000     0 FUNC    GLOBAL DEFAULT  UND strcat
    21: 00002c15   116 FUNC    GLOBAL DEFAULT    7 Java_com_sina_deviceidjni
    22: 00002c89   396 FUNC    GLOBAL DEFAULT    7 Java_com_sina_deviceidjni
    23: 00000000     0 FUNC    GLOBAL DEFAULT  UND time
    24: 00000000     0 FUNC    GLOBAL DEFAULT  UND localtime
    25: 00002e15   188 FUNC    GLOBAL DEFAULT    7 Java_com_sina_weibo_sdk_n
    26: 00002ed1   112 FUNC    GLOBAL DEFAULT    7 Java_com_sina_deviceidjni
    27: 00002f41   380 FUNC    GLOBAL DEFAULT    7 Java_com_sina_deviceidjni
    28: 00000000     0 FUNC    WEAK   DEFAULT  UND __gnu_Unwind_Find_exidx
    29: 000038f0     8 FUNC    WEAK   DEFAULT    7 __aeabi_unwind_cpp_pr2
    30: 00003ebc     0 FUNC    GLOBAL DEFAULT    7 __gnu_Unwind_Restore_VFP_
    31: 00003eac     0 FUNC    GLOBAL DEFAULT    7 __gnu_Unwind_Restore_VFP
    32: 00003ecc     0 FUNC    GLOBAL DEFAULT    7 __gnu_Unwind_Restore_VFP_
    33: 00003edc     0 FUNC    GLOBAL DEFAULT    7 __gnu_Unwind_Restore_WMMX
    34: 00003f64     0 FUNC    GLOBAL DEFAULT    7 __gnu_Unwind_Restore_WMMX
    35: 00003e98    20 FUNC    GLOBAL DEFAULT    7 restore_core_regs
    36: 00000000     0 FUNC    GLOBAL DEFAULT  UND abort
    37: 00003480    68 FUNC    GLOBAL DEFAULT    7 _Unwind_VRS_Get
    38: 000034ec    68 FUNC    GLOBAL DEFAULT    7 _Unwind_VRS_Set
    39: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __cxa_begin_cleanup
    40: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __cxa_type_match
    41: 00004098   916 FUNC    GLOBAL DEFAULT    7 __gnu_unwind_execute
    42: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __cxa_call_unexpected
    43: 00003908   856 FUNC    GLOBAL DEFAULT    7 _Unwind_VRS_Pop
    44: 00003ec4     0 FUNC    GLOBAL DEFAULT    7 __gnu_Unwind_Save_VFP_D
    45: 00003eb4     0 FUNC    GLOBAL DEFAULT    7 __gnu_Unwind_Save_VFP
    46: 00003ed4     0 FUNC    GLOBAL DEFAULT    7 __gnu_Unwind_Save_VFP_D_1
    47: 00003f20     0 FUNC    GLOBAL DEFAULT    7 __gnu_Unwind_Save_WMMXD
    48: 00003f78     0 FUNC    GLOBAL DEFAULT    7 __gnu_Unwind_Save_WMMXC
    49: 00003c60     8 FUNC    GLOBAL DEFAULT    7 _Unwind_GetCFA
    50: 00003c68   164 FUNC    GLOBAL DEFAULT    7 __gnu_Unwind_RaiseExcepti
    51: 00003d0c    28 FUNC    GLOBAL DEFAULT    7 __gnu_Unwind_ForcedUnwind
    52: 00003d28   108 FUNC    GLOBAL DEFAULT    7 __gnu_Unwind_Resume
    53: 00003d94    32 FUNC    GLOBAL DEFAULT    7 __gnu_Unwind_Resume_or_Re
    54: 00003db4     4 FUNC    GLOBAL DEFAULT    7 _Unwind_Complete
    55: 00003db8    32 FUNC    GLOBAL DEFAULT    7 _Unwind_DeleteException
    56: 00003dd8   192 FUNC    GLOBAL DEFAULT    7 __gnu_Unwind_Backtrace
    57: 00003e98    20 FUNC    GLOBAL DEFAULT    7 __restore_core_regs
    58: 00003f8c    36 FUNC    GLOBAL DEFAULT    7 ___Unwind_RaiseException
    59: 00003f8c    36 FUNC    GLOBAL DEFAULT    7 _Unwind_RaiseException
    60: 00003fb0    36 FUNC    GLOBAL DEFAULT    7 ___Unwind_Resume
    61: 00003fb0    36 FUNC    GLOBAL DEFAULT    7 _Unwind_Resume
    62: 00003fd4    36 FUNC    GLOBAL DEFAULT    7 ___Unwind_Resume_or_Rethr
    63: 00003fd4    36 FUNC    GLOBAL DEFAULT    7 _Unwind_Resume_or_Rethrow
    64: 00003ff8    36 FUNC    GLOBAL DEFAULT    7 ___Unwind_ForcedUnwind
    65: 00003ff8    36 FUNC    GLOBAL DEFAULT    7 _Unwind_ForcedUnwind
    66: 0000401c    36 FUNC    GLOBAL DEFAULT    7 ___Unwind_Backtrace
    67: 0000401c    36 FUNC    GLOBAL DEFAULT    7 _Unwind_Backtrace
    68: 0000442c    64 FUNC    GLOBAL DEFAULT    7 __gnu_unwind_frame
    69: 0000446c    44 FUNC    GLOBAL DEFAULT    7 _Unwind_GetRegionStart
    70: 00004498    56 FUNC    GLOBAL DEFAULT    7 _Unwind_GetLanguageSpecif
    71: 000044d0     8 FUNC    GLOBAL DEFAULT    7 _Unwind_GetDataRelBase
    72: 000044d8     8 FUNC    GLOBAL DEFAULT    7 _Unwind_GetTextRelBase
    73: 00007044     0 NOTYPE  GLOBAL DEFAULT  ABS _edata
    74: 00007044     0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start
    75: 0000704d     0 NOTYPE  GLOBAL DEFAULT  ABS _end

符号表和动态符号表

符号表

是给人看的。
符号表中的符号要比动态符号表中的符号要全面,程序中所使用到的变量以及函数的符号都存到这个表中。

动态符号表

是给程序看的
动态符号表中只有当前so的导出符号以及要导入的符号。其目的是提供给加载器使用。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值