From 767813369be3042f8bf7a8298ad2fd5a1e814d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=89=E5=B9=BF?= Date: Sun, 19 May 2024 09:40:13 +0800 Subject: [PATCH] fix[ver]ver-checker --- pydumpck/__version__.py | 2 +- .../pyc_checker/lib_uncompyle6/requirement_check.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pydumpck/__version__.py b/pydumpck/__version__.py index 8faf7f4..20ec8a4 100644 --- a/pydumpck/__version__.py +++ b/pydumpck/__version__.py @@ -2,7 +2,7 @@ __description__ = "pydumpck is a multi-threads tool for decompile exe,elf,pyz,pyc packed by python which is base on pycdc and uncompyle6.sometimes its py-file result not exactly right ,maybe could use uncompyle6." __keywords__ = ['pydumpck', 'decomplier', 'pe', 'elf', 'pyc', 'pyz'] __url__ = "https://github.com/serfend/pydumpck" -__version__ = "1.19.10" +__version__ = "1.20.1" __author__ = "serfend" __author_email__ = "serfend@foxmail.com" __license__ = "MIT Licence" diff --git a/pydumpck/pyc_checker/lib_uncompyle6/requirement_check.py b/pydumpck/pyc_checker/lib_uncompyle6/requirement_check.py index 3520d34..7c33602 100644 --- a/pydumpck/pyc_checker/lib_uncompyle6/requirement_check.py +++ b/pydumpck/pyc_checker/lib_uncompyle6/requirement_check.py @@ -1,9 +1,14 @@ from ... import logger + + def check(v_expected: str, v_current: str) -> bool: def get_ver_value(v): v = [int(x) for x in v.split('.')] - return v[0] << 24 + v[1] << 12 + v[2] - return get_ver_value(v_expected) <= get_ver_value(v_current) + return (v[0] << 24) + (v[1] << 12) + v[2] + cur_value = get_ver_value(v_current) + exp_value = get_ver_value(v_expected) + result = exp_value <= cur_value + return result, exp_value, cur_value def check_version(): @@ -11,7 +16,8 @@ def check_version(): v_expected = '6.0.4' v_current = xdis.version.__version__ - if not check(v_expected, v_current): + fit, exp, cur = check(v_expected, v_current) + if not fit: logger.warning( f'require xdis version greater than {v_expected},current is {v_current}') if input('install package online? yes(*)/no(n)') == 'n':