forensics/binary_digits
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
picoCTF{h1dd3n_1n_th3_b1n4ry_d4e39e9e}
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/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()
|
||||
Reference in New Issue
Block a user