forensics/corrupted_file
This commit is contained in:
Binary file not shown.
@@ -0,0 +1 @@
|
||||
picoCTF{r3st0r1ng_th3_by73s_efd8c6c0}
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
def main():
|
||||
with (Path(__file__).parent / "file").open('rb') as file:
|
||||
content = file.read()
|
||||
|
||||
JFIF_MAGIC_BYTES = b"\xFF\xD8"
|
||||
new_content = JFIF_MAGIC_BYTES + content[2:]
|
||||
|
||||
with (Path(__file__).parent / "file.jpg").open('wb') as file:
|
||||
file.write(new_content)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user