/gist:b85d0cb344a1b39fe74e Secret
Created
May 14, 2013 02:04
recover photos snippet 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
#open the tec file (first command line argument) in binary mode | |
fin = open(sys.argv[1], 'rb') | |
#open the jpg file for output (second command line argument) in binary mode | |
fout = open(sys.argv[2], 'wb') | |
#Read in the file | |
data = fin.read() | |
#The important part: remove the first 8 bytes and remove the last byte | |
fout.write(data[6:-1]) | |
#close the file | |
fin.close() | |
fout.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment