Files
picoctf/forensics/binary_digits/solve.py
T
2026-07-02 00:45:38 +09:00

19 lines
444 B
Python
Executable File

#!/usr/bin/env python3
from pathlib import Path
from textwrap import wrap
def main():
with (Path(__file__).parent / "digits.bin").open('r') as file:
content = file.read()
chunks = wrap(content, width = 8)
digits = [int(chunk, 2) for chunk in chunks]
# file out.jpg reveals type
with (Path(__file__).parent / "out.jpg").open('wb') as file:
file.write(bytes(digits))
if __name__ == '__main__':
main()