一次二进制漏洞检测工具开发遇到的问题解决
本文最后更新于1619天前,其中的信息可能已经有所发展或是发生改变。

项目基于Python语言开发

在开发初期使用python2测试。在进入Linux进一步测试时发现python3执行后会有如下报错,鉴于python2.7已于2020年1月1日 停止支持。所以着手解决

root@Mondayice:~/桌面/测试# python3 Main.py -f stack_overflow
Namespace(File='stack_overflow')
Traceback (most recent call last):
  File "Main.py", line 28, in <module>
    main()
  File "Main.py", line 17, in main
    p = angr.Project(filename, load_options={"auto_load_libs": False})
  File "/usr/local/lib/python3.7/dist-packages/angr/project.py", line 128, in __init__
    self.loader = cle.Loader(self.filename, concrete_target=concrete_target, **load_options)
  File "/usr/local/lib/python3.7/dist-packages/cle/loader.py", line 134, in __init__
    self.initial_load_objects = self._internal_load(main_binary, *preload_libs, preloading=True)
  File "/usr/local/lib/python3.7/dist-packages/cle/loader.py", line 664, in _internal_load
    main_obj = self._load_object_isolated(main_spec)
  File "/usr/local/lib/python3.7/dist-packages/cle/loader.py", line 767, in _load_object_isolated
    return backend_cls(full_spec, is_main_bin=self.main_object is None, loader=self, **options)
  File "/usr/local/lib/python3.7/dist-packages/cle/backends/elf/elf.py", line 33, in __init__
    super(ELF, self).__init__(binary, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/cle/backends/elf/metaelf.py", line 27, in __init__
    super(MetaELF, self).__init__(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/cle/backends/__init__.py", line 96, in __init__
    self.symbols = sortedcontainers.SortedKeyList(key=self._get_symbol_relative_addr)
AttributeError: module 'sortedcontainers' has no attribute 'SortedKeyList'

报错提示:

AttributeError: module 'sortedcontainers' has no attribute 'SortedKeyList'

模块“ sortedcontainers”没有属性“ SortedKeyList“

sortedcontainers 是python的 一款纯python写的对列表、字典、集合排序的模块。在这里不做过多的介绍有兴趣的可以来这里了解。

在 sortedcontainers 发布历史中发现2.0.0(2018-05-18)版本中有这样的更新:

2.0.0(2018-05-18) 版本之后SortedListWithKey不再使用。由SortedKeyList代替 。

升级 sortedcontainers 到2.0.0版本以上即可兼容。

pip3 install  sortedcontainers==2.0.5

此错误angr官方也给出同样的解决方案

SortedKeyList is only provided by certain versions of sortedcontainers. We have a pin sortedcontainers>=2.0 to ensure that this is satisfied. Can you please post the output of pip freeze | grep sortedcontainers to ensure you have the right version installed?

附兼容成功的图片

点击数:209

    暂无评论

    发送评论 编辑评论

    
    				
    |´・ω・)ノ
    ヾ(≧∇≦*)ゝ
    (☆ω☆)
    (╯‵□′)╯︵┴─┴
     ̄﹃ ̄
    (/ω\)
    ∠( ᐛ 」∠)_
    (๑•̀ㅁ•́ฅ)
    →_→
    ୧(๑•̀⌄•́๑)૭
    ٩(ˊᗜˋ*)و
    (ノ°ο°)ノ
    (´இ皿இ`)
    ⌇●﹏●⌇
    (ฅ´ω`ฅ)
    (╯°A°)╯︵○○○
    φ( ̄∇ ̄o)
    ヾ(´・ ・`。)ノ"
    ( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
    (ó﹏ò。)
    Σ(っ °Д °;)っ
    ( ,,´・ω・)ノ"(´っω・`。)
    ╮(╯▽╰)╭
    o(*////▽////*)q
    >﹏<
    ( ๑´•ω•) "(ㆆᴗㆆ)
    😂
    😀
    😅
    😊
    🙂
    🙃
    😌
    😍
    😘
    😜
    😝
    😏
    😒
    🙄
    😳
    😡
    😔
    😫
    😱
    😭
    💩
    👻
    🙌
    🖕
    👍
    👫
    👬
    👭
    🌚
    🌝
    🙈
    💊
    😶
    🙏
    🍦
    🍉
    😣
    Source: github.com/k4yt3x/flowerhd
    颜文字
    Emoji
    小恐龙
    花!
    上一篇
    下一篇