"""在 lldb 上下文中运行,动态枚举内存区域搜索密钥""" import hashlib, hmac, struct, os DB_BASE = '/Users/yibo/Library/Containers/com.tencent.xinWeChat/Data/Documents/xwechat_files/yibooo_ac07/db_storage/' def load_header(relpath): path = DB_BASE + relpath if os.path.exists(path): with open(path, 'rb') as f: return f.read(4096) return None def make_verifier(header): salt = header[:16] mac_salt = bytes(b ^ 0x3A for b in salt) stored = header[4064:4096] content = header[16:4048] iv = header[4048:4064] def verify_raw(key): if len(set(key)) < 10: return False hk = hashlib.pbkdf2_hmac('sha256', key, mac_salt, 2, dklen=32) h = hmac.new(hk, digestmod='sha256') h.update(content) h.update(iv) h.update(struct.pack(' 0x7fffffffffff: # user space limit break print(f"[DONE] regions={region_count}, readable={readable_count}, scanned={total_scanned//1024//1024}MB, found={found}") if not found: print("[FAIL] Salt not found in any memory region")