mars python脚本 找不到ECC

zzlelutf  于 4个月前  发布在  Python
关注(0)|答案(4)|浏览(58)

Traceback (most recent call last):
File "/home/xx/data/scripts/decode_mars_crypt_log_file.py", line 133, in DecodeBuffer
svr = pyelliptic.ECC(curve='secp256k1')
AttributeError: 'module' object has no attribute 'ECC'
Traceback (most recent call last):
File "/home/xx/data/scripts/decode_mars_crypt_log_file.py", line 133, in DecodeBuffer
svr = pyelliptic.ECC(curve='secp256k1')
AttributeError: 'module' object has no attribute 'ECC'
Traceback (most recent call last):
File "/home/xx/data/scripts/decode_mars_crypt_log_file.py", line 133, in DecodeBuffer
svr = pyelliptic.ECC(curve='secp256k1')
AttributeError: 'module' object has no attribute 'ECC'

我安装了 pyelliptic ecc,运行的时候提示找不到ECC, 难道因为我用的版本太高了?
我装的是 pyelliptic-1.5.8
希望大佬能解答下,网上查阅资料没发现谁遇到我这个问题

xtupzzrd

xtupzzrd1#

你应该下载这个: https://github.com/mfranciszkiewicz/pyelliptic/releases 的1.5.10版本。因为1.5.7需要使用旧的openssl版本。

gkn4icbw

gkn4icbw2#

我用的是 https://github.com/mfranciszkiewicz/pyelliptic/releases/tag/1.5.10 已经安装好了 不再报告ECC找不到的问题了
运行 python2.7 ./log/crypt/decode_mars_crypt_log_file.py MM_20211024.xlog解析微信的备份数据文件 但是还是遇到很多报错
Traceback (most recent call last):
File "./log/crypt/decode_mars_crypt_log_file.py", line 160, in DecodeBuffer
tmpbuffer = decompressor.decompress(str(tmpbuffer))
error: Error -3 while decompressing: invalid stored block lengths
Traceback (most recent call last):
File "./log/crypt/decode_mars_crypt_log_file.py", line 160, in DecodeBuffer
tmpbuffer = decompressor.decompress(str(tmpbuffer))
error: Error -3 while decompressing: invalid code lengths set
Traceback (most recent call last):
File "./log/crypt/decode_mars_crypt_log_file.py", line 160, in DecodeBuffer
tmpbuffer = decompressor.decompress(str(tmpbuffer))
error: Error -3 while decompressing: invalid distance too far back
Traceback (most recent call last):
File "./log/crypt/decode_mars_crypt_log_file.py", line 160, in DecodeBuffer
tmpbuffer = decompressor.decompress(str(tmpbuffer))
error: Error -3 while decompressing: invalid stored block lengths
Traceback (most recent call last):
File "./log/crypt/decode_mars_crypt_log_file.py", line 160, in DecodeBuffer
tmpbuffer = decompressor.decompress(str(tmpbuffer))
error: Error -3 while decompressing: invalid distance too far back
Traceback (most recent call last):
File "./log/crypt/decode_mars_crypt_log_file.py", line 160, in DecodeBuffer
tmpbuffer = decompressor.decompress(str(tmpbuffer))
error: Error -3 while decompressing: invalid block type

请问 当初数据进行压缩是 用到的zlib.decompressobj(-zlib.MAX_WBITS) 这个wbits用的是什么值?

8mmmxcuj

8mmmxcuj3#

我也是一直遇到这个错误,下面是我运行的命令:

$ python2.7 ~/dev/klogdecrypt/decode_crypt_log_file.py ~/dev/klog-android/logs/logs__com-lingyunxiao-klogapp_2022_04_22_15_56.txt
Traceback (most recent call last):
  File "~/dev/klogdecrypt/decode_crypt_log_file.py", line 144, in DecodeBuffer
svr = pyelliptic.ECC(curve='secp256k1')
AttributeError: 'module' object has no attribute 'ECC'

我切换了所有能切换的 pyelliptic 版本,从 1.5.10 开始一路降到 1.5.4,还是有问题,然后我想,我是不是没权限?于是加了个 sudo

$ sudo python2.7 ~/dev/klogdecrypt/decode_crypt_log_file.py ~/dev/klog-android/logs/logs__com-lingyunxiao-klogapp_2022_04_22_15_56.txt

发现还是有问题,但问题变了,报 AttributeError: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: undefined symbol: ECDH_OpenSSL 的错误。

眼前一亮,再根据 https://github.com/Tencent/mars/wiki/Xlog-%E5%8A%A0%E5%AF%86%E4%BD%BF%E7%94%A8%E6%8C%87%E5%BC%95 里的提示,安装 1.5.10 补丁版本

安装前,清理此前安装的 pyelliptic 版本:

$ sudo rm -fr /usr/local/lib/python2.7/dist-packages/pyelliptic-1.5.7-py2.7.egg
$ wget https://github.com/mfranciszkiewicz/pyelliptic/archive/1.5.10.tar.gz
$ tar fx 1.5.10.tar.gz
$ cd 1.5.10/pyelliptic-1.5.10
$ sudo python2.7 setup.py install

确认目录下已经生成 egg 文件:

$ ls /usr/local/lib/python2.7/dist-packages/
easy-install.pth  easy_install.py  easy_install.pyc  pip  pip-20.3.4.dist-info  pkg_resources  pyelliptic-1.5.10-py2.7.egg

再跑此前的带 sudo 命令就没问题了。

ndasle7k

ndasle7k4#

pip install bloxroute-pyelliptic

相关问题