From a257c902d638d6f7e18b3b554c1e54b5a9b81535 Mon Sep 17 00:00:00 2001 From: sam Date: Mon, 29 Aug 2005 15:18:29 +0000 Subject: [PATCH] * easter eggs git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/pwntcha/trunk@499 92316355-f0b4-4df1-b90c-862c8a59935f --- src/Makefile.am | 1 + src/easter-eggs.c | 26 ++++++++++++++++++++++++++ src/main.c | 29 +++++++++++++++++------------ 3 files changed, 44 insertions(+), 12 deletions(-) create mode 100644 src/easter-eggs.c diff --git a/src/Makefile.am b/src/Makefile.am index f538626..c6d077e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,6 +19,7 @@ pwntcha_SOURCES = \ tickets.c \ vbulletin.c \ xanga.c \ + easter-eggs.c \ test.c pwntcha_CFLAGS = $(ADDITIONAL_CFLAGS) -Wall -O6 pwntcha_LDFLAGS = $(ADDITIONAL_LDFLAGS) diff --git a/src/easter-eggs.c b/src/easter-eggs.c new file mode 100644 index 0000000..9976dce --- /dev/null +++ b/src/easter-eggs.c @@ -0,0 +1,26 @@ +/* + * easter-eggs.c: captcha decoder for well known pictures + * $Id$ + * + * Copyright: (c) 2005 Sam Hocevar + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Do What The Fuck You Want To + * Public License as published by Banlu Kemiyatorn. See + * http://sam.zoy.org/projects/COPYING.WTFPL for more details. + */ + +#include +#include +#include + +#include "config.h" +#include "common.h" + +/* Main function */ +char *decode_easter_eggs(struct image *img) +{ + char *result = strdup("OMFG GOATSERY"); + + return result; +} + diff --git a/src/main.c b/src/main.c index 8191580..b89a5aa 100644 --- a/src/main.c +++ b/src/main.c @@ -158,64 +158,69 @@ int main(int argc, char *argv[]) { if(img->width == 155 && img->height == 50) { - dprintf("autodetected authimage captcha\n"); + dprintf("probably an authimage captcha\n"); result = decode_authimage(img); } else if(img->width == 175 && img->height == 35) { - dprintf("autodetected livejournal captcha\n"); + dprintf("probably a livejournal captcha\n"); result = decode_livejournal(img); } else if(img->width == 100 && img->height == 40 && count < 6) { - dprintf("autodetected linuxfr captcha\n"); + dprintf("probably a linuxfr captcha\n"); result = decode_linuxfr(img); } else if(img->width == 69 && img->height == 35) { - dprintf("autodetected lmt.lv captcha\n"); + dprintf("probably a lmt.lv captcha\n"); result = decode_lmt(img); } else if(img->width == 208 && img->height == 26) { - dprintf("autodetected Paypal captcha\n"); + dprintf("probably a Paypal captcha\n"); result = decode_paypal(img); } else if(img->width == 320 && img->height == 50) { - dprintf("autodetected phpBB captcha\n"); + dprintf("probably a phpBB captcha\n"); result = decode_phpbb(img); } else if(img->width == 170 && img->height == 50) { - dprintf("autodetected Xanga captcha\n"); + dprintf("probably a Xanga captcha\n"); result = decode_xanga(img); } else if(img->height <= 40 && count < 10) { - dprintf("autodetected scode/trencaspammers captcha\n"); + dprintf("probably a scode/trencaspammers captcha\n"); result = decode_scode(img); } else if(img->height <= 30 && count < 100) { - dprintf("autodetected clubic captcha\n"); + dprintf("probably a clubic captcha\n"); result = decode_clubic(img); } else if(img->height == 69) { - dprintf("autodetected slashdot captcha\n"); + dprintf("probably a slashdot captcha\n"); result = decode_slashdot(img); } else if(img->width == 200 && img->height == 40) { - dprintf("autodetected tickets.com captcha\n"); + dprintf("probably a tickets.com captcha\n"); result = decode_tickets(img); } else if(img->height == 61) { - dprintf("autodetected vbulletin captcha\n"); + dprintf("probably a vbulletin captcha\n"); result = decode_vbulletin(img); } + else if(img->width == 480 && img->height == 360 && count == 253) + { + dprintf("probably not a captcha\n"); + result = decode_easter_eggs(img); + } else { dprintf("could not guess captcha type\n");