From 381311d4c6654ce5028ab9fd13e7a05d98a15bee Mon Sep 17 00:00:00 2001 From: sam Date: Wed, 12 Jan 2005 03:42:08 +0000 Subject: [PATCH] * Paypal decoder. 64% efficiency. git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/pwntcha/trunk@456 92316355-f0b4-4df1-b90c-862c8a59935f --- share/font_stencil_23_AZ.bmp | Bin 0 -> 26278 bytes share/font_stencil_24_AZ.bmp | Bin 0 -> 27986 bytes src/Makefile.am | 1 + src/common.h | 1 + src/main.c | 7 ++ src/paypal.c | 135 +++++++++++++++++++++++++++++++++++ 6 files changed, 144 insertions(+) create mode 100644 share/font_stencil_23_AZ.bmp create mode 100644 share/font_stencil_24_AZ.bmp create mode 100644 src/paypal.c diff --git a/share/font_stencil_23_AZ.bmp b/share/font_stencil_23_AZ.bmp new file mode 100644 index 0000000000000000000000000000000000000000..34b74f836fcdac9bd4d6129c6119a258b1cec68b GIT binary patch literal 26278 zcmeHPcYIdG(w_8?Mj(^`L4qV9p-2(}(xikIK$?V35L*qRS+qn2-2bi0R;gC zq$2{-HB=E1g9br*AS9GP%6>C*&e^l)O}N*q_x`?r-u)xH=b72rJ+t#{dk;jn|7;L& zs_P68ilrDQfM+mw0C&b;?a!I^$3e@45KvH10Qvd(ke8PSxw*OUB_|;qKkLaOch)$jHcm+qZASty{O?=FOXM zKmQEp&Ygpwe)12jIK! zzJvYy_rtz@`(W?hz3}a~-@=|fd*GXIzJcAlcf+n-yI|+eov>ra4%ohZJ8avw4YqFG z3R|{pfv>;*8a8j<44XD>f{hzD!dG8?1z&#oC2ZKR0oJcy59`*ggD<}L0@kiw3v1S_ zfzLnx96tN(Gg!TPHLO~-3RbRM37>xYDXdtr0#Z^^VEOXp@X05iz{ekd49UsKux!~f zSh{p6ELpMy7B5~5ixw?{k3RYc7A{-}3l=PZ4?p}6=FguGAAIluy#N0DFmK*Gc<;UU zVD8+xFlWvjm_2(o%$hX|-hKC7m^pJMyz|aGFk{9Hm_B_vy#4muFm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^x6b4!ez<&@^399W^KS;uT)!-Pe5j#Z1yJ**I>*)080#sMJWSCL;XM?4%Z6|pdI+bnDg{|(WyYvwcnKA#qdvtfDo zwRdqvdBg)z5SLgWevrozT{w~~6j+8Tl23>9&uB0meonE15t>pU@&hwO#(w$~LQ4sx zhdi1f@^@IGu{d3j;I!9?{wh5Bm7az6FMd=WL351%Y4JQR6AbGBYgrvXi0H$7GV?G-SBhl%`9@az0wMF7D1cu96oogn!zfrf)JF>I$8fvMGVo}VYuB9JZT z(xf5eQL4_PqY96_Y4xMj1}f1=@DDj$2^-|}In1Jbq+w~d28(Fg&m0C%szvJzr@gwc zEyu;j1`IT(Qfdr*$7L*gT8A2@v&@UM!{1pNvNGOXR^)dF$6MkWalbL|G~Dz- zthuRUUFTj?8g5?L+v*VAT>HM&^b%*SCJ*i2Jfez!<>t63D#@k8dj45qEdhQ<{9uXNC=8NC9M}?cRlC{DkA|fMP z3663#alD5gv3usoLkqiBK8!1ekvwXWnc6j+-MC)uAVYw8tKM<(ef#x)$=sKdFtR72 z{rh(^$E;O6>os$LCVfy8NBq!J(IzTzTRb*ZsGGGFPt@vxFWj#`jTsQDiVDOp zwXv3rxnOc?zy6(^ig!m3)->vXyVeShiaQ#Uvys*zf9xA3bM=zd>;=0A>>jXt!0rLN n2kaiOd%*4iy9ewZuzSGn0lNq69>l|4^1%NA7A`$& literal 0 HcmV?d00001 diff --git a/share/font_stencil_24_AZ.bmp b/share/font_stencil_24_AZ.bmp new file mode 100644 index 0000000000000000000000000000000000000000..3756ff985629617f5a6a1a777868d1282ea7ce8c GIT binary patch literal 27986 zcmeHPcYGB^*FHD7A(awC6Vek}LJ>kS(u>pp0)h&NAP}l_P^4WDkzNF(NQo31ARUxm zMKpAz2vR~PJp>4(%y-Vr?#}G>=2KsNzdyd;oj>l*KBvs=>^yVM&Ti7Eb^G^#mzq|9 z@>uKT3J`=x3wUtczaKw{AB#9J#vm^*4{~#JAtxsXva_?{`Sa)S?AbHO%F2SLPoKh*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9F&i?>)X}y4hCO z5XaXOo|A@|W8kwUj}=DvckI1VETbQDIH8*Y>Qy(KOuqUF9S4)+$9FDWOnrvWhO)R$ z$Y9;KvE*^etpccfxdJVbPdD`HdqL{rXTc|UzuDdp6%E;iyUWq|v2KKlQay-TWy(Gv zVlQ!w|AisT+He2ZQu`R*x0&qvCp+&O&f0QPl11WbQ`~numXw^5mYxxM1OG>6rt&iH ztHk7#)bxzzTM1Vl_`q{PHcJi09;Dw_IX3oQQc7xCM*5LjSE-Voex`ulx|>LJ7@Msl z;wX5JJH-+ftfMdD`|@kd@i%0KmpKN673=ATqMukVOI^*(IA_?r@K6lYdVs?Bv6`z+ zivqTEejV4}QT@Gm8n2tiyn&82BinngQ&&M$FBV0P}r=+F4shc!SNJ_>r%{cB^!I92oGO}09R-nBlG8E{>H2kf zpXLtbhXsUMqTeeP+r)IWLb*_A%@!td5F8fkF}_cfx-4;R+Q-lKR0w~@Jd2%9P}g% z|G{OrzHn*UenG(@A)z7G@UT*UY!)Y5_d1OlxIoxzx^w*4GB`LS6fNxMfYkWwwSd8k zi?0}3%Qa|+gR67o#ygO@8y4td7P|OTr@{i2ODG(|Awidth == 208 && img->height == 26) + { + dprintf("autodetected Paypal captcha\n"); + result = decode_paypal(img); + } else if(img->width == 320 && img->height == 50) { dprintf("autodetected phpBB captcha\n"); diff --git a/src/paypal.c b/src/paypal.c new file mode 100644 index 0000000..310a3c2 --- /dev/null +++ b/src/paypal.c @@ -0,0 +1,135 @@ +/* + * paypal.c: decode Paypal captchas + * $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 + +#include "config.h" +#include "common.h" + +static void find_glyphs(struct image *img); + +/* Our macros */ +char *result; + +/* Main function */ +char *decode_paypal(struct image *img) +{ + struct image *tmp; + + /* paypal captchas have 8 characters */ + result = malloc(9 * sizeof(char)); + strcpy(result, " "); + + tmp = image_dup(img); + find_glyphs(tmp); + + image_free(tmp); + + return result; +} + +static void find_glyphs(struct image *img) +{ +#define DELTA 2 +#define FONTS 2 + static struct font *fonts[FONTS]; + static char *files[] = + { + "font_stencil_23_AZ.bmp", "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "font_stencil_24_AZ.bmp", "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", + }; + int x, y, i = 0, f; + int r, g, b; + int xmin, xmax, ymin, ymax, startx = 0, cur = 0; + int bestdist, bestfont, bestx, besty, bestch; + + for(f = 0; f < FONTS; f++) + { + if(!fonts[f]) + { + fonts[f] = font_load_variable(files[f * 2], files[f * 2 + 1]); + if(!fonts[f]) + exit(1); + } + } + + while(cur < 8) + { + /* Try to find 1st letter */ + bestdist = INT_MAX; + for(f = 0; f < FONTS; f++) for(i = 0; i < fonts[f]->size; i++) + { + int localmin = INT_MAX, localx, localy; + xmin = fonts[f]->glyphs[i].xmin - DELTA; + ymin = fonts[f]->glyphs[i].ymin; + xmax = fonts[f]->glyphs[i].xmax + DELTA; + ymax = fonts[f]->glyphs[i].ymax; + for(y = -3; y < 1; y++) + { + for(x = startx; x < startx + 15; x++) + { + int z, t, dist; + dist = 0; + for(t = 0; t < ymax - ymin; t++) + for(z = 0; z < xmax - xmin; z++) + { + int r2; + getgray(fonts[f]->img, xmin + z, ymin + t, &r); + getgray(img, x + z, y + t, &r2); + if(r < r2) + dist += abs(r - r2); + else + dist += abs(r - r2) * 3 / 4; + } + //dist = dist * 128 / fonts[f]->glyphs[i].count; + dist = dist * 1024 / (xmax - xmin - 2 * DELTA); + if(dist < localmin) + { + localmin = dist; + localx = x; + localy = y; + } + } + } + if(localmin < bestdist) + { + bestdist = localmin; + bestfont = f; + bestx = localx; + besty = localy; + bestch = i; + } + } + + /* Print min glyph */ +#if 0 + xmin = fonts[bestfont]->glyphs[bestch].xmin - DELTA; + ymin = fonts[bestfont]->glyphs[bestch].ymin; + xmax = fonts[bestfont]->glyphs[bestch].xmax + DELTA; + ymax = fonts[bestfont]->glyphs[bestch].ymax; + for(y = 0; y < ymax - ymin; y++) + for(x = 0; x < xmax - xmin; x++) + { + getpixel(fonts[bestfont]->img, xmin + x, ymin + y, &r, &g, &b); + if(r > 128) + continue; + setpixel(img, bestx + x, besty + y, r, g, b); + } +#endif + + startx = bestx + xmax - xmin; + result[cur++] = fonts[bestfont]->glyphs[bestch].c; + } +} +