Skip to content
This repository has been archived by the owner on Aug 29, 2021. It is now read-only.

Commit

Permalink
调整配置文件位置 请放置于根目录
Browse files Browse the repository at this point in the history
  • Loading branch information
xhlove committed Jul 30, 2021
1 parent 4d9ed8e commit a51eb72
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 5 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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~~
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions wvguesser/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from wvguesser.mainv2 import main

if __name__ == '__main__':
main()
17 changes: 13 additions & 4 deletions wvguesser/mainv2.py
Original file line number Diff line number Diff line change
@@ -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()


Expand Down Expand Up @@ -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__':
Expand Down

0 comments on commit a51eb72

Please sign in to comment.