-
-
Save Hamz-a/7b0980fc69d4f3e81cba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = file_get_contents('http://www.ssmailsubscription.tk/inc/captcha.php'); | |
$r = 120; $g = 95; $b = 95; | |
file_put_contents('original.png', $data); | |
$img = imagecreatefromstring($data); | |
$width = imagesx($img); | |
$height = imagesy($img); | |
for($i = 0;$i < $width; $i++){ | |
for($j = 0;$j < $height; $j++){ | |
$rgb = imagecolorat($img, $i, $j); | |
$colors = imagecolorsforindex($img, $rgb); | |
if($colors['red'] != 120 || $colors['green'] != 95 || $colors['blue'] != 95){ | |
imagecolorset($img, $rgb, 255, 255, 255); | |
} | |
} | |
} | |
imagepng($img, 'image.png'); | |
exec('tesseract.exe image.png code'); // Let's OCR !!! | |
echo 'The original<br><img src="original.png"><br><br>The filtered<br><img src="image.png"><br>And the code is: '; | |
echo file_get_contents('code.txt'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment