Files
xczjhk/_sa_hanhua_out/_tmp/scan_reload.py
T
2026-10-04 21:07:49 +08:00

33 lines
1.1 KiB
Python

import zipfile, re
base = r'e:\MCStudioDownload\work\3027246179@qq.com\Cpp\AddOn\309c2d420bc84ee986db9cdd070ff02a\_sa_hanhua_out'
jars = {
'essentials': base + r'\sa_essentials-forge-1.20.1-1.0.0.jar',
'lib': base + r'\sa_lib-forge-1.20.1-1.0.1.jar',
'decor': base + r'\sa_decor-forge-1.20.1-1.0.3.jar',
}
pat = re.compile(r"Reloading", re.IGNORECASE)
for name, jar in jars.items():
hits = []
with zipfile.ZipFile(jar) as z:
for n in z.namelist():
if n.endswith('/') or n.endswith('.png') or n.endswith('.jpg') or n.endswith('.ogg'):
continue
try:
b = z.read(n)
except Exception:
continue
if n.endswith('.class'):
s = ''.join(chr(c) for c in b if 32 <= c < 127 or c in (9, 10, 13))
else:
try:
s = b.decode('utf-8', errors='ignore')
except Exception:
continue
if pat.search(s):
hits.append(n)
print(f'[{name}] Reloading 命中: {len(hits)}')
for h in hits:
print(' ', h)