A Facebook application that was written 2008-09-27. Shorty after, they discontinued the feature which makes it work.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

313 lines
17 KiB

/* I was looking though old code, and the one is genius, if a do say so myself.
I cleaned it up.
Multi-byte fields are LSB first
header: 6 bytes (one header per data stream)
Signature: 3 bytes, 'GIF'
Version: 3 bytes, '87a' or '89a'
logical screen descriptor (one per data stream, follow header)
Logical screen width: 2 bytes
Logical screen height: 2 bytes
Packed Data: 1 byte
Global colour table flag: 1 bit (global table follows?)
Colour resolution - 1: 3 bits
Sort flag: 1 bit (important colours first? 0 in 87a)
Size of global colour table: 3 bits (size is 2^(x+1))
Background colour: 1 byte
Pixel aspect ratio: 1 byte (0 = ignore 0 in 87a)
global colour table: 3 * 2 ^ (size of table + 1) bytes if table flag
RGB: 3 bytes
image descriptor: (one per image)
Image separator: 1 byte 0x2C
Image left position: 2 bytes
Image top position: 2 bytes
Image width: 2 bytes
Image height: 2 bytes
Packed data:
Local colour table?: 1 bit
Interlace?: 1 bit
Sorted palette?: 1 bit
Reserved = 0: 2 bits
Local colour table size: 3 bits
local colour table: 3 * 2 ^ (size of table + 1) bytes if table flag
RGB: 3 bytes
code size: 1 byte
repeated data sub-blocks: terminated by zero-size sub-block
Size: 1 byte
Data: Size bytes
trailer: (one per data stream)
GIF trailer: 1 byte, 0x3B ';'
#include <stdlib.h> /* getenv(), atoi() */
#include <stdio.h> /* printf(), putchar(), fwrite() */
#include <string.h> /* strcmp() */
typedef struct tagCode Code;
struct tagCode {
Code *child;
Code *next;
unsigned char suffix;
unsigned long code;
unsigned int code_size;
static void print_gif(unsigned char parm);
int main(int argc, char **argv) {
char *env;
if(!(env = getenv("REQUEST_METHOD"))
|| (strcmp(env, "get") && strcmp(env, "GET"))
|| !(env = getenv("QUERY_STRING"))) {
printf("Status: 400 Missing required argument.\n\n");
printf("Content-type: image/gif\n\n");
/* may need to set STDOUT to binary mode to avoid line feed translation
if your OS sucks (you know who you are!)
if(setmode(stdout, O_BINARY) == -1) return 1; */
static void print_gif(unsigned char parm) {
/* this is the gif binary output; mine, you could use whatever and paste it
here from the hex editor, just make it 00-FF as it goes across the image */
static unsigned char image_data[] = {
0x08, 0xFE, 0x00, 0x5B, 0x38, 0x18, 0x80, 0xC0, 0x02, 0x8A, 0x18, 0x39,
0x8A, 0x20, 0xA9, 0xB1, 0xA1, 0xC2, 0x05, 0x0C, 0x16, 0x24, 0x38, 0x60,
0xD0, 0xE0, 0x41, 0x84, 0x09, 0x15, 0x34, 0x98, 0xE8, 0xC1, 0xA4, 0x09,
0x13, 0x23, 0x3A, 0x5E, 0x98, 0xF8, 0xD0, 0x01, 0x04, 0x8B, 0x24, 0x56,
0x9C, 0x10, 0x21, 0x72, 0x85, 0x4C, 0x19, 0x30, 0x54, 0x96, 0xF0, 0xA0,
0x81, 0x83, 0xC7, 0x8E, 0x21, 0x59, 0xB4, 0x14, 0xD9, 0x81, 0xE3, 0xC6,
0x0D, 0x1C, 0x39, 0x72, 0xE8, 0xD8, 0xD1, 0x83, 0x67, 0x8E, 0x1E, 0x3D,
0x74, 0x00, 0xE5, 0x11, 0x44, 0x88, 0x10, 0x22, 0x47, 0x8E, 0x00, 0xE1,
0xC1, 0xA3, 0xC7, 0x8F, 0x1F, 0x42, 0x9E, 0xB8, 0xC9, 0xA3, 0xA6, 0x4B,
0x95, 0x27, 0x4B, 0x9A, 0x40, 0xB9, 0xD2, 0x65, 0xCC, 0x18, 0x2E, 0x5F,
0x3B, 0x42, 0xB1, 0xD2, 0x45, 0x0C, 0x1A, 0x39, 0x7F, 0x18, 0x05, 0x22,
0xB3, 0xA5, 0x0B, 0x98, 0x32, 0x79, 0x22, 0x59, 0x42, 0x14, 0x67, 0x4D,
0x9B, 0x3C, 0x89, 0x1A, 0xED, 0x49, 0x43, 0x86, 0x4D, 0x20, 0x49, 0x96,
0x3A, 0x95, 0x2A, 0x95, 0x09, 0x50, 0x1C, 0x37, 0x6E, 0xDE, 0xC0, 0x89,
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0x02, 0x13, 0x95, 0xE0, 0x04, 0x2C, 0x80,
0xA1, 0x0B, 0x5A, 0xCC, 0x22, 0x16, 0xB3, 0x38, 0x46, 0x34, 0x8C, 0x71,
0x0B, 0xC3, 0xBD, 0xA2, 0x17, 0xD1, 0x88, 0x86, 0x2D, 0x4A, 0xD1, 0xBA,
0x66, 0x61, 0x4E, 0x76, 0xA0, 0x10, 0x05, 0x29, 0x52, 0x11, 0x8B, 0xF7,
0xC0, 0x22, 0x77, 0xBA, 0x6B, 0x05, 0x2C, 0x6A, 0xE1, 0x8B, 0x6C, 0xBC,
0x83, 0x3F, 0x05, 0x68, 0xC0, 0x05, 0x54, 0xC0, 0x32, 0x14, 0x54, 0x40,
0x79, 0x12, 0xB0, 0x57, 0xBC, 0x18, 0xA4, 0x3C, 0xE5, 0x55, 0x60, 0x04,
0x25, 0x23, 0x41, 0x06, 0x24, 0xA4, 0x82, 0x10, 0x68, 0x00, 0x7B, 0x2C,
0x18, 0x42, 0x07, 0xC3, 0x14, 0x85, 0x1B, 0xB4, 0xC0, 0x05, 0x30, 0x80,
0xC1, 0x0A, 0x4C, 0x80, 0x82, 0x17, 0xE4, 0x40, 0x09, 0x47, 0xB0, 0x01,
0x0C, 0x62, 0x40, 0x83, 0x8B, 0x2D, 0xB3, 0x99, 0x31, 0xA8, 0x91, 0x8B,
0x78, 0x54, 0x83, 0x1B, 0x54, 0xCF, 0x07, 0x40, 0xEA, 0x81, 0x11, 0xA4,
0x42, 0x15, 0xAB, 0x14, 0x81, 0x0A, 0x6D, 0x70, 0x43, 0x18, 0xAC, 0xD0,
0x04, 0xF8, 0x29, 0x41, 0x0A, 0x5B, 0x00, 0x43, 0x17, 0xAE, 0x00, 0x85,
0x25, 0x54, 0x69, 0x09, 0x4E, 0x98, 0x42, 0x16, 0xBA, 0xF0, 0x05, 0x33,
0x08, 0xC2, 0x11, 0x7C, 0xFE, 0x10, 0x83, 0x16, 0xB2, 0x90, 0x4E, 0x33,
0x8C, 0xD0, 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08, 0x43, 0x17, 0xB1, 0x81, 0x85, 0x2C, 0xB6, 0x53,
0x0B, 0x53, 0x88, 0x62, 0x14, 0xAE, 0x58, 0x46, 0x33, 0x64, 0x71, 0x8A,
0x51, 0xB0, 0x22, 0x19, 0xD1, 0x9A, 0x56, 0xB5, 0x40, 0x11, 0x49, 0x46,
0xBE, 0xE2, 0x16, 0xBD, 0xB8, 0xC5, 0x6C, 0x5A, 0x01, 0x53, 0x59, 0xEC,
0x02, 0x1A, 0xEA, 0xA0, 0xC7, 0x59, 0x1D, 0xC0, 0x02, 0x22, 0x20, 0x01,
0x08, 0x2C, 0xE0, 0x40, 0x05, 0x96, 0x47, 0x01, 0x81, 0x5D, 0x00, 0x02,
0xF4, 0xB2, 0xAB, 0x04, 0x34, 0xD0, 0x82, 0x24, 0x44, 0xA1, 0x08, 0x22,
0x89, 0xAC, 0x0B, 0x50, 0x10, 0x82, 0x0F, 0x84, 0x20, 0x05, 0x39, 0x90,
0x82, 0x61, 0xC1, 0xB2, 0x03, 0x17, 0xAC, 0xC0, 0x05, 0x32, 0x88, 0xC1,
0x0A, 0x54, 0xE0, 0x82, 0x1C, 0x4C, 0x61, 0x0A, 0x39, 0x78, 0x81, 0x0B,
0xC6, 0x0C, 0x83, 0x15, 0xD9, 0x2F, 0x9A, 0x2B, 0xC2, 0xC1, 0xFE, 0x0E,
0x78, 0x04, 0x5A, 0x20, 0x24, 0x85, 0x07, 0x43, 0x48, 0xC2, 0x11, 0x4E,
0x9B, 0x24, 0x02, 0x76, 0xA1, 0x0D, 0x5E, 0xC9, 0x02, 0x16, 0xA0, 0x60,
0x25, 0x2A, 0x60, 0xC1, 0x0A, 0x27, 0x84, 0x42, 0x13, 0x96, 0xB0, 0x41,
0x9C, 0x81, 0xA1, 0x30, 0x7A, 0x28, 0x84, 0x22, 0xFA, 0xB0, 0x86, 0x33,
0x9C, 0xC1, 0x0C, 0x61, 0xF0, 0x42, 0x19, 0x04, 0x81, 0x88, 0x36, 0x94,
0x01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0B, 0x5E, 0xDC, 0x46, 0x18, 0xBF, 0x38, 0x06, 0x33, 0x92, 0x71, 0x0C,
0x67, 0x10, 0x23, 0x15, 0x9F, 0x08, 0xC5, 0x2B, 0x9C, 0x71, 0x8D, 0x61,
0x94, 0xE6, 0xDC, 0xDD, 0x58, 0xC6, 0x2A, 0xE2, 0xAD, 0x1E, 0xAB, 0xFA,
0x1B, 0x19, 0xC0, 0xA8, 0x45, 0xE5, 0x5F, 0x01, 0x0B, 0x70, 0x0D, 0x23,
0x1C, 0xF1, 0xA8, 0x47, 0x40, 0x00 };
int i, r, g, b, colour_change;
/* GIF header */
printf("GIF"); /* signature */
printf("87a"); /* version */
/* logical screen descriptor */
putchar(0); putchar(1); /* width */
putchar(8); putchar(0); /* height */
putchar(0xF7); /* 256 colours with table to follow */
putchar(0); /* background colour */
putchar(0); /* reserved (aspect ratio in 89a) */
/* global colour table - do'n't mess the colours up, just the colour table;
like the old trick with 256-colour games where they do animation with
colour cycling */
r = 0xF0, g = 0x00, b = 0x32; /* aiming for 0x50 0xA0 0xC0 */
if(parm < 40) {
colour_change = (40 - parm) << 1;
r -= colour_change;
g += colour_change;
b += colour_change;
for(i = 0; i <= 0xFF; i++) {
if(i >= parm - 40 && i < parm + 40) {
r -= 2; g += 2; b += 2;
putchar(r); putchar(g); putchar(b);
/* image descriptor */
putchar(','); /* image separator */
putchar(0); putchar(0); /* image left position */
putchar(0); putchar(0); /* image top position */
putchar(0); putchar(1); /* image width */
putchar(8); putchar(0); /* image height */
putchar(0); /* packed flags - use global table */
/* image data block, *ptr, size, ntimes, stream */
if(fwrite(image_data, sizeof(char), sizeof(image_data), stdout) != sizeof(image_data))
{ perror("stdout"); }
putchar(0); /* terminating empty sub-block */
/* GIF trailer */
putchar(';'); /* trailer */