#!/usr/bin/env python3 """Проверить что за файлы в slp/V/en-GB/*.htm""" import zlib, re, os, struct path = "/home/naeel/nubes/data/elsa/docs/slp/V/en-GB/000502200001.htm" with open(path, "rb") as f: raw = f.read() print(f"File size: {len(raw)} bytes") print(f"First 64 hex: {raw[:64].hex()}") # PE check if raw[:2] == b"MZ": print(">>> It's a PE/EXE/DLL file!") elif raw[:2] == b"\x48\xc7": print(">>> Starts with 48 c7 - could be x64 machine code!") # Look for ELF if raw[:4] == b"\x7fELF": print(">>> It's an ELF binary!") # Try full zlib decompress at different offsets for offset in range(0, min(500, len(raw))): if raw[offset] == 0x78 and raw[offset+1] in [0x01, 0x9c, 0xda]: try: decomp = zlib.decompress(raw[offset:]) print(f">>> zlib at offset {offset}: {len(decomp)} bytes decompressed") # Try decode as UTF-16LE text = decomp.decode("utf-16-le", errors="replace") m = re.search(r"