BTW nasao sam ovu skriptu na netu pa moze li netko obajsniti jer je ovo meni prekomplicirano!To je za jednu stranicu ali moze li se primjeniti na nekoj drugoj?
001 002// CAPTCHA Bypass Code (Works 99%)
003// by Napalm
004//
005// License: http://creativecommons.org/licenses/by-sa/2.0/uk/
006//
007// CAPTCHA Location: http://www.xovie.us/captcha/captcha.php
008//
009
010function imageconverttruecolor(&$image)
011{
012 $width = imagesx($image);
013 $height = imagesy($image);
014 $final = imagecreatetruecolor($width, $height);
015 imagecopy($final, $image, 0, 0, 0, 0, $width, $height);
016 imagedestroy($image); $image = $final;
017}
018
019// load images
020
021$background = imagecreatefrompng("captcha.png");
022$lettersimg = imagecreatefrompng("letters.png");
023$captcha = imagecreatefrompng("http://www.xovie.us/captcha/captcha.php");
024imageconverttruecolor($background);imageconverttruecolor($lettersimg);
025imageconverttruecolor($captcha);
026// first parse - difference test and pixel save
027$pixels = array();
028for($x = 0; $x < imagesx($captcha); $x++)
029{
030 for($y = 0; $y < imagesy($captcha); $y++)
031 {
032 $src = imagecolorat($background, $x, $y);
033 $dst = imagecolorat($captcha, $x, $y);
034 if(!($src == 0 && $dst == 0) && ($src == $dst))
035 $pixels[$x][$y] = 0xFFFFFF;
036 else $pixels[$x][$y] = 0x000000;
037 }
038}
039imagedestroy($background);
040
041// second parse - filter out pixel noise
042
043for($p = 0; $p < 3; $p++)
044{
045 // 3 noise parses
046 for($x = 0; $x < imagesx($captcha); $x++)
047 {
048 for($y = 0; $y < imagesy($captcha); $y++)
049 {
050 $filterpixel = true;
051 if(!$pixels[$x-1][$y-1] && !$pixels[$x+0][$y-1] && !$pixels[$x+1][$y-1])
052 $filterpixel = false;
053 // top
054 if(!$pixels[$x+1][$y-1] && !$pixels[$x+1][$y+0] && !$pixels[$x+1][$y+1])
055 $filterpixel = false;
056 // right
057 if(!$pixels[$x-1][$y+1] && !$pixels[$x+0][$y+1] && !$pixels[$x+1][$y+1])
058 $filterpixel = false;
059 // bottom
060 if(!$pixels[$x-1][$y-1] && !$pixels[$x-1][$y+0] && !$pixels[$x-1][$y+1])
061 $filterpixel = false;
062 // left
063 if($filterpixel) $pixels[$x][$y] = 0xFFFFFF;
064 }
065 }
066}
067for($x = 0; $x < imagesx($captcha); $x++)
068{
069 $pixels[$x][0] = 0xFFFFFF;
070 $pixels[$x][1] = 0xFFFFFF;
071 $pixels[$x][imagesy($captcha) - 1] = 0xFFFFFF;
072 $pixels[$x][imagesy($captcha) - 2] = 0xFFFFFF;
073}
074for($y = 0; $y < imagesy($captcha); $y++)
075{
076 $pixels[0][$y] = 0xFFFFFF; $pixels[1][$y] = 0xFFFFFF;
077 $pixels[imagesx($captcha) - 1][$y] = 0xFFFFFF;
078 $pixels[imagesx($captcha) - 2][$y] = 0xFFFFFF;
079}
080for($x = 50; $x < 54; $x++)
081{
082 for($y = 2; $y < 5; $y++)
083 {
084 $pixels[$x][$y] = 0xFFFFFF;
085 }
086}
087// third parse - rebuild image (just for show)
088for($x = 0; $x < imagesx($captcha); $x++)
089{
090 for($y = 0; $y < imagesy($captcha); $y++)
091 {
092 imagesetpixel($captcha, $x, $y, 0xFFFFFF);
093 if(($x % 3) == 0 && ($y % 3) == 0 && $pixels[$x][$y] == 0)
094 {
095 imagesetpixel($captcha, $x, $y, 0xFF0000);
096 }
097 }
098}
099// fourth parse - basic ocr (slow) :-(
100$letters = 'ABCE';
101$ocr = '';
102for($x1 = 0; $x1 < imagesx($captcha) - 25; $x1++)
103{
104 for($y1 = 0; $y1 < imagesy($captcha) - 27; $y1++)
105 {
106 $score = array();
107 for($letter = 0; $letter < 4; $letter++)
108 {
109 for($x2 = 0; $x2 < 25; $x2++)
110 {
111 for($y2 = 0; $y2 < 27; $y2++)
112 {
113 $color = imagecolorat($lettersimg, ($letter * 25) + $x2, $y2);
114 if($pixels[$x1 + $x2][$y1 + $y2] == $color && $color == 0)
115 $score[$letter][0]++;
116 if($color == 0) $score[$letter][1]++;
117 }
118 }
119 }
120 $found = -1; $highest = 0;
121 for($letter = 0; $letter < 4; $letter++)
122 {
123 $result = (($score[$letter][1] / 100) * 90);
124 if($score[$letter][0] >= $result)
125 {
126 $result = ($score[$letter][0] - $result);
127 if($result > $highest)
128 {
129 $highest = $result;
130 $found = $letter;
131 }
132 }
133 }
134 if($found > -1)
135 {
136 $ocr .= $letters[$found];
137 $x1 += 10;
138 }
139 unset($score);
140 }
141}
142imagedestroy($lettersimg);unset($pixels);
143// last of all output
144header('Content-Type: image/png');
145imagestring($captcha, 2, 0, 0, $ocr, 0);
146imagepng($captcha);
147imagedestroy($captcha);
148?>

One line gives the other one // http://bfbc2.statsverse.com/stats/pc/Perkan777 -BF:BC 2 status
