import sys image_path = r"D:\Yuzu-GCA\screen.png" with open(image_path, 'rb') as f: header = f.read(32) print(f"File size check: first 32 bytes hex:") print(' '.join(f'{b:02X}' for b in header)) print() print(f"ASCII representation: {header}") # Check known magic numbers if header[:8] == b'\x89PNG\r\n\x1a\n': print("✓ Valid PNG header detected") elif header[:2] == b'\xff\xd8': print("✓ JPEG header detected") elif header[:4] == b'BM': print("✓ BMP header detected") elif header[:4] == b'RIFF': print("✓ WEBP header detected") else: print("⚠ Unknown image format") # Also check if it might be an Android screencap (could be raw) # Try to detect if it's a PNG embedded in a wrapper print() # Check if file is actually a text-based format with open(image_path, 'rb') as f: content = f.read(200) # Check if mostly printable ASCII printable = sum(1 for b in content if 32 <= b <= 126 or b in (9, 10, 13)) if printable > len(content) * 0.8: print("Note: File appears to be mostly text!") print(content.decode('utf-8', errors='replace'))