Why even when I correct the header, the gif still doesn't open ?
not just file signature br
echo ZmxhZ3tnMWZfb3JfajFmfQ== | base64 --decode
echo ZmxhZ3tnMWZfb3JfajFmfQ== | base64 --decode
Great
Why even when I correct the header, the gif still doesn't open ?
not just file signature br
too simple!
Check file - file unopenable.gif : File isn't recognized as GIF
Chck file header - xxd unopenable.gif | head : head - output the first part of files
} What's wrong: File starts with 39 61 Valid GIF should start with 47 49 46 38 39 61 ("GIF89a") Missing first 4 bytes: 47 49 46 38 ("GIF8")
Fix the header
echo -n "47494638" | xxd -r -p > fixed.gif cat unopenable.gif >> fixed.gif == [ header bytes ] + [ original file data ]
Verify the fix - file fixed.gif : Output: fixed.gif: GIF image data = to make sure it's a gif file
Open, decode, next challenge
1 day ago
Check file - file unopenable.gif : File isn't recognized as GIF
Chck file header - xxd unopenable.gif | head : head - output the first part of files
} What's wrong: File starts with 39 61 Valid GIF should start with 47 49 46 38 39 61 ("GIF89a") Missing first 4 bytes: 47 49 46 38 ("GIF8")
Fix the header
Create fixed GIF by prepending missing bytes
echo -n "47494638" | xxd -r -p > fixed.gif cat unopenable.gif >> fixed.gif == [ header bytes ] + [ original file data ]
Verify the fix - file fixed.gif : Output: fixed.gif: GIF image data = to make sure it's a gif file
Open, decode, next challenge