MrSonicMaster / vHackXT-MoneyBot

vHack Money Bot - Automatically hack people and get money all day long. outdated!
MIT License
35 stars 12 forks source link

Captcha #19

Open Lord-Evil opened 7 years ago

Lord-Evil commented 7 years ago

Btw, instead of using complex image recognition algos there's simpler way I've discoverd, Python method:

import base64
from PIL import Image
import io
def readPort(base64str):
    tablePort={75:"0",36:"1",48:"2",56:"3",55:"4",58:"5",47:"6",44:"7",62:"8",69:"9"}
    pic=base64.b64decode(base64str)
    i=Image.open(io.BytesIO(pic))
    digits=list()
    digit=0
    for x in range(0,i.width):
        row=0
        for y in range(0,i.height):
            p=i.getpixel((x,y))
            if(p==1):
                digit+=p
                row=1
        if(not row):
            if(digit):digits.append(digit)
            digit=0
    try:
        captcha=""
        for d in digits:
            captcha+=tablePort[d]   
        return int(captcha)
    except:
        return digits

Each digit has always the same amount of pixels excluding some noise pixels with values >1

MrSonicMaster commented 7 years ago

Cool, thanks for the suggestion. The image recognition I use is Tesseract OCR, and its loaded on my VPS. It takes less a very short amount of time to process such a small image, and also doesn't use up many resources on my vps, but it would still be good to not have it rely on my server staying online.

Lord-Evil commented 7 years ago

I never had much experience with image recognition software and the one I've tried to use at fist didn't do a good job solving this "captcha", so it just hit me that chars might have the same amount of pixels if noises are removed :-D