diff --git a/README.md b/README.md index c7cdcf6..3854976 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,14 @@ 打开使用widevine的网站,播放视频后会自动下载一个配置文件 -即`offline_config.json`,把它复制到`wvguesser`目录下即可 +即`offline_config.json`,把它放到当前目录下即可 如果只是测试,可以跳过这一步,已经内置了一个配置文件了 ## 本地破解 +如果是exe版本,直接将`offline_config.json`拖到`wvguesser_v1.0.0.exe`上即可 + 首先安装[`wasmer-python`](https://github.com/wasmerio/wasmer-python) ```bash @@ -34,6 +36,12 @@ pip install wasmer_compiler_cranelift==1.0.0 根据现有算法,只能是单线程 +# 打包 + +```bash +pyinstaller -n wvguesser_v1.0.0 -F wvguesser\__main__.py +``` + # 推荐更好的方案 ~~不太会C++所以就用了python~~ diff --git a/wvguesser/main.exe b/main.exe similarity index 100% rename from wvguesser/main.exe rename to main.exe diff --git a/wvguesser/offline_config.json b/offline_config.json similarity index 100% rename from wvguesser/offline_config.json rename to offline_config.json diff --git a/wvguesser/offline_config_yk.json b/offline_config_yk.json similarity index 100% rename from wvguesser/offline_config_yk.json rename to offline_config_yk.json diff --git a/wvguesser/__main__.py b/wvguesser/__main__.py new file mode 100644 index 0000000..8f8d824 --- /dev/null +++ b/wvguesser/__main__.py @@ -0,0 +1,4 @@ +from wvguesser.mainv2 import main + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/wvguesser/mainv2.py b/wvguesser/mainv2.py index a45d415..decf8a8 100644 --- a/wvguesser/mainv2.py +++ b/wvguesser/mainv2.py @@ -1,20 +1,24 @@ -import subprocess +import os +import sys import json import math import time import binascii +import subprocess from pathlib import Path from Crypto.Cipher import AES from Crypto.Hash import CMAC +MAIN_EXE = (Path('.') / 'main.exe').resolve().as_posix() + def guessInput(text: str): - resp = subprocess.check_output(f'./wvguesser/main.exe guessInput {text}') + resp = subprocess.check_output(f'{MAIN_EXE} guessInput {text}') return resp.decode('utf-8').strip() def getDeoaep(text: str): - resp = subprocess.check_output(f'./wvguesser/main.exe getDeoaep {text}') + resp = subprocess.check_output(f'{MAIN_EXE} getDeoaep {text}') return resp.decode('utf-8').strip() @@ -86,9 +90,14 @@ def decrypt_license_keys(session_key: str, context_enc: str, key_infos: dict): def main(): - config = json.loads(Path('wvguesser/offline_config.json').read_text(encoding='utf-8')) + if len(sys.argv) == 2: + path = sys.argv[1] + else: + path = (Path('.') / 'offline_config.json').resolve().as_posix() + config = json.loads(Path(path).read_text(encoding='utf-8')) clear_session_key = run(config['enc_session_key']) decrypt_license_keys(clear_session_key, config['enc_key'], config['key_infos']) + sys.stdin.read() if __name__ == '__main__':