清理未使用导入和局部变量
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
3. 在 _PLATFORM_CREDENTIAL_FIELDS 中定义凭据字段
|
||||
"""
|
||||
|
||||
from typing import Any, Optional, Type, cast
|
||||
from typing import Any, cast
|
||||
|
||||
from .base import BaseWhitelistAdapter, get_exit_ip_via_proxy
|
||||
from .base import BaseWhitelistAdapter
|
||||
from .xiequ import XiequAdapter
|
||||
from .xkdaili import XkdailiAdapter
|
||||
|
||||
|
||||
@@ -248,141 +248,5 @@ def simple_md5(message: str) -> str:
|
||||
def verify_result(msg):
|
||||
return hashlib.md5(msg.encode()).hexdigest()
|
||||
|
||||
# 轮移位常量
|
||||
shifts = [
|
||||
7,
|
||||
12,
|
||||
17,
|
||||
22,
|
||||
7,
|
||||
12,
|
||||
17,
|
||||
22,
|
||||
7,
|
||||
12,
|
||||
17,
|
||||
22,
|
||||
7,
|
||||
12,
|
||||
17,
|
||||
22,
|
||||
5,
|
||||
9,
|
||||
14,
|
||||
20,
|
||||
5,
|
||||
9,
|
||||
14,
|
||||
20,
|
||||
5,
|
||||
9,
|
||||
14,
|
||||
20,
|
||||
5,
|
||||
9,
|
||||
14,
|
||||
20,
|
||||
4,
|
||||
11,
|
||||
16,
|
||||
23,
|
||||
4,
|
||||
11,
|
||||
16,
|
||||
23,
|
||||
4,
|
||||
11,
|
||||
16,
|
||||
23,
|
||||
4,
|
||||
11,
|
||||
16,
|
||||
23,
|
||||
6,
|
||||
10,
|
||||
15,
|
||||
21,
|
||||
6,
|
||||
10,
|
||||
15,
|
||||
21,
|
||||
6,
|
||||
10,
|
||||
15,
|
||||
21,
|
||||
6,
|
||||
10,
|
||||
15,
|
||||
21,
|
||||
]
|
||||
|
||||
# K常数(与JavaScript版本中的常数对应)
|
||||
K = [
|
||||
0xD76AA478,
|
||||
0xE8C7B756,
|
||||
0x242070DB,
|
||||
0xC1BDCEEE,
|
||||
0xF57C0FAF,
|
||||
0x4787C62A,
|
||||
0xA8304613,
|
||||
0xFD469501,
|
||||
0x698098D8,
|
||||
0x8B44F7AF,
|
||||
0xFFFF5BB1,
|
||||
0x895CD7BE,
|
||||
0x6B901122,
|
||||
0xFD987193,
|
||||
0xA679438E,
|
||||
0x49B40821,
|
||||
0xF61E2562,
|
||||
0xC040B340,
|
||||
0x265E5A51,
|
||||
0xE9B6C7AA,
|
||||
0xD62F105D,
|
||||
0x02441453,
|
||||
0xD8A1E681,
|
||||
0xE7D3FBC8,
|
||||
0x21E1CDE6,
|
||||
0xC33707D6,
|
||||
0xF4D50D87,
|
||||
0x455A14ED,
|
||||
0xA9E3E905,
|
||||
0xFCEFA3F8,
|
||||
0x676F02D9,
|
||||
0x8D2A4C8A,
|
||||
0xFFFA3942,
|
||||
0x8771F681,
|
||||
0x6D9D6122,
|
||||
0xFDE5380C,
|
||||
0xA4BEEA44,
|
||||
0x4BDECFA9,
|
||||
0xF6BB4B60,
|
||||
0xBEBFBC70,
|
||||
0x289B7EC6,
|
||||
0xEAA127FA,
|
||||
0xD4EF3085,
|
||||
0x04881D05,
|
||||
0xD9D4D039,
|
||||
0xE6DB99E5,
|
||||
0x1FA27CF8,
|
||||
0xC4AC5665,
|
||||
0xF4292244,
|
||||
0x432AFF97,
|
||||
0xAB9423A7,
|
||||
0xFC93A039,
|
||||
0x655B59C3,
|
||||
0x8F0CCC92,
|
||||
0xFFEFF47D,
|
||||
0x85845DD1,
|
||||
0x6FA87E4F,
|
||||
0xFE2CE6E0,
|
||||
0xA3014314,
|
||||
0x4E0811A1,
|
||||
0xF7537E82,
|
||||
0xBD3AF235,
|
||||
0x2AD7D2BB,
|
||||
0xEB86D391,
|
||||
]
|
||||
|
||||
# 实际实现...
|
||||
return verify_result(message)
|
||||
|
||||
@@ -103,9 +103,7 @@ def restore_geetest_image(input_path: str, output_path: str) -> None:
|
||||
# 打开混淆图像
|
||||
img = Image.open(input_path)
|
||||
new_img = Image.new("RGB", (260, 160))
|
||||
r = 160
|
||||
for _ in range(len(Ut)):
|
||||
a = r / 2
|
||||
c = Ut[_] % 26 * 12 + 1
|
||||
u = 80 if Ut[_] > 25 else 0
|
||||
l = img.crop(box=(c, u, c + 10, u + 80))
|
||||
|
||||
@@ -219,4 +219,4 @@ def run_solver() -> None:
|
||||
w3 = get_w3(str_16, challenge, hkjl, c, s, gt)
|
||||
|
||||
# 最后的验证
|
||||
message = req_end(gt, challenge, w3)
|
||||
req_end(gt, challenge, w3)
|
||||
|
||||
@@ -172,7 +172,6 @@ class Envelope:
|
||||
assert (h & 0x0F) == MAP
|
||||
cnt, p = _read_len_int(d, p)
|
||||
for _ in range(cnt):
|
||||
kh = d[p]
|
||||
p += 1
|
||||
kln = d[p]
|
||||
p += 1
|
||||
|
||||
@@ -180,7 +180,6 @@ def _gen_with_session(st: SessionState, order: dict) -> str:
|
||||
def cmd_gen(args) -> int:
|
||||
st = load_session(args.session)
|
||||
order = load_order(args.order)
|
||||
params = {k: order.get(k, "") for k in ORDER_FIELDS}
|
||||
hex_msg = _gen_with_session(st, order)
|
||||
out = Path(args.output) if args.output else ROOT / "config" / "encrypt_msg.txt"
|
||||
out.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
@@ -842,7 +842,6 @@ class VM:
|
||||
def run(self, fn: JSFunction, call_args):
|
||||
"""执行一个 VM 函数实例(h)。fn 来自 make() 或 op87/58 创建的闭包。"""
|
||||
self.inst_id += 1
|
||||
iid = self.inst_id
|
||||
if self.use_init_c and self.init_c is not None:
|
||||
C = self.init_c
|
||||
self.use_init_c = False
|
||||
@@ -855,7 +854,6 @@ class VM:
|
||||
d = [] # 异常续延栈
|
||||
l = UNDEF # 最近异常(op12 读取)
|
||||
o = self.o
|
||||
cap = None # 外部捕获回调(验证用)
|
||||
if not hasattr(self, "_all_trace"):
|
||||
self._all_trace = []
|
||||
while True:
|
||||
|
||||
Reference in New Issue
Block a user