Skip to content

Commit

Permalink
fix[ver]ver-checker
Browse files Browse the repository at this point in the history
  • Loading branch information
serfend committed May 19, 2024
1 parent e43ef93 commit 7678133
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pydumpck/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__ = "[email protected]"
__license__ = "MIT Licence"
Expand Down
12 changes: 9 additions & 3 deletions pydumpck/pyc_checker/lib_uncompyle6/requirement_check.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
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():
import xdis.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':
Expand Down

0 comments on commit 7678133

Please sign in to comment.