36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
"""
|
|
Search for readable ASCII strings in the decoded text from screen.png.
|
|
"""
|
|
import sys
|
|
import re
|
|
|
|
path = r"D:\Yuzu-GCA\screen.png"
|
|
|
|
with open(path, 'rb') as f:
|
|
raw = f.read()
|
|
|
|
# Decode as UTF-16 LE
|
|
text = raw.decode('utf-16-le')
|
|
|
|
# Find all printable ASCII sequences of length >= 4
|
|
matches = re.findall(r'[ -~]{4,}', text)
|
|
print(f"Found {len(matches)} ASCII strings of length >= 4")
|
|
print("\n=== First 60 matches ===")
|
|
for i, m in enumerate(matches[:60]):
|
|
print(f" [{i}] '{m}'")
|
|
|
|
# Also search for specific patterns
|
|
patterns = ['OTA', 'update', 'download', 'install', 'version', 'error', 'fail',
|
|
'success', 'manifest', 'SHA256', 'verify', 'check', '完成', '下载',
|
|
'安装', '校验', '版本', '测试', '日志']
|
|
print("\n=== Pattern search ===")
|
|
for p in patterns:
|
|
count = text.count(p)
|
|
if count > 0:
|
|
# Find context around first occurrence
|
|
idx = text.find(p)
|
|
start = max(0, idx - 30)
|
|
end = min(len(text), idx + len(p) + 50)
|
|
ctx = text[start:end].encode('ascii', errors='replace').decode('ascii')
|
|
print(f" '{p}' found {count} times. First context: ...{ctx}...")
|