Skip to content

Instantly share code, notes, and snippets.

@Tony3-sec
Last active December 7, 2015 15:44
Show Gist options
  • Save Tony3-sec/58dd0e04dae70950bce9 to your computer and use it in GitHub Desktop.
Save Tony3-sec/58dd0e04dae70950bce9 to your computer and use it in GitHub Desktop.
Reference
http://blog.asial.co.jp/iphone/820
http://www.w3.org/Graphics/GIF/spec-gif89a.txt
0000000: 4749 4638 3961 3303 cc01 f700 00ff ffff GIF89a3.........
0000010: ffff ffff ffff ffff ffff ffff ffff ffff ................
0000020: ffff ffff ffff ffff ffff ffff ffff ffff ................
0000030: ffff ffff ffff ffff ffff ffff ffff ffff ................
0000040: ffff ffff ffff ffff ffff ffff ffff ffff ................
0000050: ffff ffff ffff ffff ffff ffff ffff ffff ................
0000060: ffff ffff ffff ffff ffff ffff ffff ffff ................
0000070: ffff ffff ffff ffff ffff ffff ffff ffff ................
0000080: ffff ffff ffff ffff ffff ffff ffff ffff ................
0000090: ffff ffff ffff ffff ffff ffff ffff ffff ................
You have to look into first 14 bytes
4749 4638 3961 3303 cc01 f700 00ff
4749 4638 3961
- GIF version (GIF89a)
3303
- Size of width (It's little endian so it's acctually 3033. Width is 12339px)
cc01
- Size of height (It's little endian so it's acctually 01cc. Height is 460px)
f7
- Flag value
- Decimal of f7 is 247
- Binary of 247 is 11110111
11110111
- First one bit tells you whether it has color table or not
- Next three bits tell you the depth of color
- Next one bit tells you whether color in the table is sorted or not
- Next three bits tell you the size of the color table
So in this case....(11110111)
1 : It has color table
111 : Depth of color is 7+1
0 : Color table is not sorted
111 : Size of color table is 768 [ (2**(7+1)) * 3 ]
00
- BackGround color index
- The Background Color is the color used for those pixels on the screen that are not covered by an image.
00
- Pixel Aspect Ratio
ff
- Global color table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment