AlmarM Posted April 8, 2010 Share Posted April 8, 2010 (edited) Hiya!This is my first time EVER creating such thing, any suggestions, tips, etc. would be helpfull.I have no idea how hard it is to crack such thing... Oh well.Syntax_CaptchaCode($iNumOfTries)ScreenshotExampleexpandcollapse popup#include <EditConstants.au3> #include "CaptchaCode.au3" $GUI = GUICreate("Register Form", 210, 110) GUICtrlCreateLabel("Userame:", 10, 10) GUICtrlCreateLabel("Email:", 10, 30) GUICtrlCreateLabel("Password:", 10, 50) $Username = GUICtrlCreateInput("", 100, 7, 100) $Email = GUICtrlCreateInput("", 100, 27, 100) $Password = GUICtrlCreateInput("", 100, 47, 100, 20, $ES_PASSWORD) $Register = GUICtrlCreateButton("Register", 10, 75, 90) $Clear = GUICtrlCreateButton("Clear", 110, 75, 90) GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit Case $Register If GUICtrlRead($Username) <> "" And GUICtrlRead($Email) <> "" And GUICtrlRead($Password) <> "" Then If _CaptchaCode(3) Then MsgBox(64, Default, "Registration done!") $Data = "" $Data &= "Username : " & GUICtrlRead($Username) & @CRLF $Data &= "Email : " & GUICtrlRead($Email) & @CRLF $Data &= "Password : " & GUICtrlRead($Password) & @CRLF FileWrite(@DesktopDir & "\register_form.txt", $Data) Else MsgBox(16, Default, "Tries maxed out, exiting program.") Exit EndIf Else MsgBox(16, Default, "Please fill in every information.") EndIf Case $Clear GUICtrlSetData($Username, "") GUICtrlSetData($Email, "") GUICtrlSetData($Password, "") EndSwitch WEndCaptchaCode.au3expandcollapse popup#include <GUIConstantsEx.au3> ; MD5 UDF: http://www.autoitscript.com/forum/index.php?showtopic=10590 $iOptOld = Opt("GUIEventOptions",0) Opt("GUIEventOptions", $iOptOld) Global $__CaptchaCode_cCharacter[6], $c__CaptchaCode_Label[5], $c__CaptchaCode_Line[2], $a__CaptchaCode_Font[6] Global $__CaptchaCode_Tries Func _CaptchaCode($iNumOfTries) Local $sCaptchaCode $__CaptchaCode_Tries = 0 $hWnd = GUICreate(" * ENTER CODE *", 175, 150, -1, -1, 0x00080000) $cBg = GUICtrlCreateLabel("", 10, 10, 150, 50) GUICtrlSetState($cBg, 128) GUICtrlSetBkColor($cBg, 0x000000) $cInput = GUICtrlCreateInput("", 10, 70, 150, 20) $cCheck = GUICtrlCreateButton("Check", 10, 95, 70) $cNew = GUICtrlCreateButton("New", 90, 95, 70) $sCaptchaCode = __CaptchaCode_Create() $cFg = GUICtrlCreateLabel("", 10, 10, 150, 50) GUICtrlSetBkColor($cFg, -2) GUISetState() While 1 Switch GUIGetMsg() Case -3 Case $cNew __CaptchaCode_Delete() $sCaptchaCode = __CaptchaCode_Create() GUICtrlSetData($cInput, "") Case $cCheck If $__CaptchaCode_Tries == $iNumOfTries - 1 Then __CaptchaCode_Delete() GUIDelete($hWnd) Return False ExitLoop Else If (GUICtrlRead($cInput) == $sCaptchaCode) Then __CaptchaCode_Delete() GUIDelete($hWnd) Return True ExitLoop Else $__CaptchaCode_Tries += 1 MsgBox(16, "* ERROR *", "Wrong Code!") __CaptchaCode_Delete() $sCaptchaCode = __CaptchaCode_Create() GUICtrlSetData($cInput, "") EndIf EndIf EndSwitch WEnd EndFunc Func __CaptchaCode_Create() Local $sCaptcha = __CaptchaCode_Generate() Local $iX = Random(15, 25, 1) Local $iY = Random(15, 40, 1) $a__CaptchaCode_Font[0] = "Arial Black" $a__CaptchaCode_Font[1] = "Comic Sans MS" $a__CaptchaCode_Font[2] = "Impact" $a__CaptchaCode_Font[3] = "Tahoma" $a__CaptchaCode_Font[4] = "System" $a__CaptchaCode_Font[5] = "Verdama" $aSplit = StringSplit($sCaptcha, "") For $x = 0 To 5 $__CaptchaCode_cCharacter[$x] = GUICtrlCreateLabel($aSplit[$x + 1], $iX, $iY) $iX += 20 + Random(1, 5, 1) $iY = Random(15, 40, 1) GUICtrlSetBkColor($__CaptchaCode_cCharacter[$x], -2) GUICtrlSetColor($__CaptchaCode_cCharacter[$x], Random(0x808080, 0xC0C0C0)) $iNum = Random(1, 7, 1) Switch $iNum Case 1 $iStyle = 2 ;2 Case 2 $iStyle = 4 ;4 Case 3 $iStyle = 8 ;8 Case 4 $iStyle = 2 + 4 ;6 Case 5 $iStyle = 4 + 8 ;12 Case 6 $iStyle = 2 + 8 ;10 Case 7 $iStyle = 2 + 4 + 8 ;16 EndSwitch GUICtrlSetFont($__CaptchaCode_cCharacter[$x], 13, Random(350, 450, 1), $iStyle, $a__CaptchaCode_Font[Random(0, 5, 1)]) Sleep(10) Next $iX = 15 + Random(1, 10, 1) $iY = 5 + Random(1, 10, 1) For $z = 0 To 4 $c__CaptchaCode_Label[$z] = GUICtrlCreateLabel("", $iX, $iY, 1, 30) $iX += 25 + Random(1, 10, 1) $iY = 5 + Random(1, 30, 1) GUICtrlSetBkColor($c__CaptchaCode_Label[$z], Random(0x808080, 0xC0C0C0)) Next $iX = 5 + Random(1, 25, 1) $iY = 20 + Random(1, 10, 1) For $b = 0 To 1 $c__CaptchaCode_Line[$b] = GUICtrlCreateLabel("", $iX, $iY, 130, 1) $iX = 5 + Random(1, 10, 1) $iY += 10 + Random(1, 10, 1) GUICtrlSetBkColor($c__CaptchaCode_Line[$b], Random(0x808080, 0xC0C0C0)) Next Return $sCaptcha EndFunc Func __CaptchaCode_Delete() For $y = 0 To 5 GUICtrlDelete($__CaptchaCode_cCharacter[$y]) Next For $a = 0 To 4 GUICtrlDelete($c__CaptchaCode_Label[$a]) Next For $c = 0 To 1 GUICtrlDelete($c__CaptchaCode_Line[$c]) Next EndFunc Func __CaptchaCode_Generate() Local $sCharacters = StringSplit("BCDFGHJKLMNPQRSTVWXYZ1234567890", "") Local $sCode = "" For $i = 1 To 6 $sCode &= $sCharacters[Random(1, $sCharacters[0], 1)] Next Return $sCode EndFuncUPDATE 09-04-10: Changed variable names, function names, added a tries system Edited April 9, 2010 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
KaFu Posted April 8, 2010 Share Posted April 8, 2010 (edited) Looks nice ... I recommend that you add $iOptOld = Opt("GUIEventOptions",0) Opt("GUIEventOptions",$iOptOld) at the beginning and end of the _CreateCaptcha() function. Edit: And also you should rename the global variables used to a more UDF related name, something like Global $__CaptchaCode_cCharacter[6], $c__CaptchaCode_Label[5], $c__CaptchaCode_Line[2], $a__CaptchaCode_Font[6] And maybe the functions too... _CaptchaCode() __CaptchaCode_Create() __CaptchaCode_Delete() __CaptchaCode_Generate() Edited April 8, 2010 by KaFu  OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Mat Posted April 8, 2010 Share Posted April 8, 2010 I would make it have a return type of true / false rather than calling a function. Just opinion. I would also work on the spelling of 'success' . If you intend to use this properly then lots of labels will not work, as simply going through all the windows children looking for controls with the class 'Static' and reading those will crack it. An easy solution is to give the lines their own text, but that will also be easy enough to figure out from the size. Ultimately, GUICtrlCreateGraphic is the solution... Or disable all the labels and put another label over the top. I haven't tried that but it could work.... (I had to try it out see spoiler)expandcollapse popup#include <GUIConstantsEx.au3> Global $cCharacter[6], $cLabel[5], $cLine[2], $aFont[6] _CaptchaCode("Succes") Func Succes() MsgBox(0, "Succes!", "Captcha was correct!") EndFunc Func _CaptchaCode($sFunctionName) Local $sCaptchaCode $hWnd = GUICreate(" * ENTER CODE *", 175, 150, -1, -1, 0x00080000) $cBg = GUICtrlCreateLabel("", 10, 10, 150, 50) GUICtrlSetBkColor($cBg, 0x000000) GUICtrlSetState($cBg, 128) $cInput = GUICtrlCreateInput("", 10, 70, 150, 20) $cCheck = GUICtrlCreateButton("Check", 10, 95, 70) $cNew = GUICtrlCreateButton("New", 90, 95, 70) $sCaptchaCode = _CreateCaptcha() $cFg = GUICtrlCreateLabel("", 10, 10, 150, 50) GUICtrlSetBkColor($cFg, -2) GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit Case $cNew _DeleteCaptcha() $sCaptchaCode = _CreateCaptcha() Case $cCheck If (GUICtrlRead($cInput) == $sCaptchaCode) Then _DeleteCaptcha() GUIDelete($hWnd) Call($sFunctionName) ExitLoop Else MsgBox(16, "* ERROR *", "Wrong Code!") _DeleteCaptcha() $sCaptchaCode = _CreateCaptcha() GUICtrlSetData($cInput, "") EndIf EndSwitch WEnd EndFunc Func _CreateCaptcha() Local $sCaptcha = _GenerateCaptcha() Local $iX = Random(15, 25, 1) Local $iY = Random(15, 40, 1) $aFont[0] = "Arial Black" $aFont[1] = "Comic Sans MS" $aFont[2] = "Impact" $aFont[3] = "Tahoma" $aFont[4] = "System" $aFont[5] = "Verdama" $aSplit = StringSplit($sCaptcha, "") For $x = 0 To 5 $cCharacter[$x] = GUICtrlCreateLabel($aSplit[$x + 1], $iX, $iY) $iX += 20 + Random(1, 5, 1) $iY = Random(15, 40, 1) GUICtrlSetBkColor($cCharacter[$x], -2) GUICtrlSetColor($cCharacter[$x], Random(0x808080, 0xC0C0C0)) $iNum = Random(1, 7, 1) Switch $iNum Case 1 $iStyle = 2 Case 2 $iStyle = 2 Case 3 $iStyle = 4 Case 4 $iStyle = 2 + 4 Case 5 $iStyle = 4 + 8 Case 6 $iStyle = 2 + 8 Case 7 $iStyle = 2 + 4 + 8 EndSwitch GUICtrlSetFont($cCharacter[$x], "", Random(350, 450, 1), $iStyle, $aFont[Random(0, 5, 1)]) Sleep(10) Next $iX = 15 + Random(1, 10, 1) $iY = 5 + Random(1, 10, 1) For $z = 0 To 4 $cLabel[$z] = GUICtrlCreateLabel("", $iX, $iY, 1, 30) $iX += 25 + Random(1, 10, 1) $iY = 5 + Random(1, 30, 1) GUICtrlSetBkColor($cLabel[$z], Random(0x808080, 0xC0C0C0)) Next $iX = 5 + Random(1, 25, 1) $iY = 20 + Random(1, 10, 1) For $b = 0 To 1 $cLine[$b] = GUICtrlCreateLabel("", $iX, $iY, 130, 1) $iX = 5 + Random(1, 10, 1) $iY += 10 + Random(1, 10, 1) GUICtrlSetBkColor($cLine[$b], Random(0x808080, 0xC0C0C0)) Next Return $sCaptcha EndFunc Func _DeleteCaptcha() For $y = 0 To 5 GUICtrlDelete($cCharacter[$y]) Next For $a = 0 To 4 GUICtrlDelete($cLabel[$a]) Next For $c = 0 To 1 GUICtrlDelete($cLine[$c]) Next EndFunc Func _GenerateCaptcha() Local $sCharacters = StringSplit("BCDFGHJKLMNPQRSTVWXYZ1234567890", "") Local $sCode = "" For $i = 1 To 6 $sCode &= $sCharacters[Random(1, $sCharacters[0], 1)] Next Return $sCode EndFuncIn answer to your remark of: 'I have no idea how hard it is to crack such thing... Oh well.', it would be easy enough. But it looks impressive. AutoIt Project Listing Link to comment Share on other sites More sharing options...
KaFu Posted April 8, 2010 Share Posted April 8, 2010 Well, I tinkered around a PHP captcha a while ago. To make that work, one way is to create a captach from a string, then encypt this string with a one-way algo. (e.g. md5()), send that as a cookie, and finally compare the md5() value of the users input with the value of the cookie... might be an issue here too, if you want to make it hacker proof (I guess it might be possible to read the unencrypted string directly from memory). Â OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13)Â BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16)Â ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
MrCreatoR Posted April 8, 2010 Share Posted April 8, 2010 Nice, there is few similar examples of generating captcha: http://www.autoitscript.com/forum/index.php?showtopic=85143  Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1  AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ==================================================    AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
Beege Posted April 8, 2010 Share Posted April 8, 2010 Pretty cool! Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator Link to comment Share on other sites More sharing options...
AlmarM Posted April 9, 2010 Author Share Posted April 9, 2010 (edited) Looks nice ... I recommend that you add $iOptOld = Opt("GUIEventOptions",0) Opt("GUIEventOptions",$iOptOld) at the beginning and end of the _CreateCaptcha() function. Edit: And also you should rename the global variables used to a more UDF related name, something like Global $__CaptchaCode_cCharacter[6], $c__CaptchaCode_Label[5], $c__CaptchaCode_Line[2], $a__CaptchaCode_Font[6] And maybe the functions too... _CaptchaCode() __CaptchaCode_Create() __CaptchaCode_Delete() __CaptchaCode_Generate() Thanks! And, yeah... Probably a good idea. I would make it have a return type of true / false rather than calling a function. True... *changes* Well, I tinkered around a PHP captcha a while ago. To make that work, one way is to create a captach from a string, then encypt this string with a one-way algo. (e.g. md5()), send that as a cookie, and finally compare the md5() value of the users input with the value of the cookie... might be an issue here too, if you want to make it hacker proof (I guess it might be possible to read the unencrypted string directly from memory). I wanted to encrypt it at first thought, not a good idea though, so I will try your way. Nice, there is few similar examples of generating captcha: http://www.autoitscript.com/forum/index.php?showtopic=85143 Oh, thanks for showing! Pretty cool! Thanks! Edited April 9, 2010 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
AlmarM Posted April 9, 2010 Author Share Posted April 9, 2010 (edited) Updated! See first post. Well, I tinkered around a PHP captcha a while ago. To make that work, one way is to create a captach from a string, then encypt this string with a one-way algo. (e.g. md5()), send that as a cookie, and finally compare the md5() value of the users input with the value of the cookie... might be an issue here too, if you want to make it hacker proof (I guess it might be possible to read the unencrypted string directly from memory). Eh, I failed at that part. Or disable all the labels and put another label over the top.Thanks for that! Ouch. I actualy DO need graphics... If WinExists(WinGetTitle("", "New")) Then $Text = WinGetText(WinGetTitle("", "New")) $Split = StringSplit($Text, Chr(10)) For $i = 3 To $Split[0] ControlSend(WinGetTitle("", "New"), "", "[CLASS:Edit; INSTANCE:1]", StringUpper($Split[$i])) Next EndIf Edited April 9, 2010 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
KaFu Posted April 9, 2010 Share Posted April 9, 2010 You've put the $iOptOld = Opt("GUIEventOptions", 0) and Opt("GUIEventOptions", $iOptOld) at the wrong place. Additionally I added the md5 crypt I meant... expandcollapse popup#include <GUIConstantsEx.au3> #include <Crypt.au3> Global $__CaptchaCode_cCharacter[6], $c__CaptchaCode_Label[5], $c__CaptchaCode_Line[2], $a__CaptchaCode_Font[6] Global $__CaptchaCode_Tries Func _CaptchaCode($iNumOfTries) $iOptOld = Opt("GUIEventOptions", 0) Local $sCaptchaCode $__CaptchaCode_Tries = 0 $hWnd = GUICreate("ENTER CODE", 175, 160, -1, -1, 0x00080000) $cBg = GUICtrlCreateLabel("", 10, 10, 150, 50) GUICtrlSetState($cBg, 128) GUICtrlSetBkColor($cBg, 0x000000) $cInput = GUICtrlCreateInput("", 10, 70, 150, 20) $cCheck = GUICtrlCreateButton("Check", 10, 95, 70) $cNew = GUICtrlCreateButton("New", 90, 95, 70) $sCaptchaCode = __CaptchaCode_Create() $cFg = GUICtrlCreateLabel("", 10, 10, 150, 50) GUICtrlSetBkColor($cFg, -2) GUISetState() While 1 Switch GUIGetMsg() Case -3 ExitLoop Case $cNew __CaptchaCode_Delete() $sCaptchaCode = __CaptchaCode_Create() GUICtrlSetData($cInput, "") Case $cCheck If $__CaptchaCode_Tries == $iNumOfTries - 1 Then ExitLoop Else If (_Crypt_HashData(GUICtrlRead($cInput),$CALG_MD5) == $sCaptchaCode) Then __CaptchaCode_Delete() GUIDelete($hWnd) Opt("GUIEventOptions", $iOptOld) Return True Else $__CaptchaCode_Tries += 1 MsgBox(16, "* ERROR *", "Wrong Code!") __CaptchaCode_Delete() $sCaptchaCode = __CaptchaCode_Create() GUICtrlSetData($cInput, "") EndIf EndIf EndSwitch WEnd __CaptchaCode_Delete() GUIDelete($hWnd) Opt("GUIEventOptions", $iOptOld) Return False EndFunc ;==>_CaptchaCode Func __CaptchaCode_Create() Local $sCaptcha = __CaptchaCode_Generate() Local $iX = Random(15, 25, 1) Local $iY = Random(15, 40, 1) $a__CaptchaCode_Font[0] = "Arial Black" $a__CaptchaCode_Font[1] = "Comic Sans MS" $a__CaptchaCode_Font[2] = "Impact" $a__CaptchaCode_Font[3] = "Tahoma" $a__CaptchaCode_Font[4] = "System" $a__CaptchaCode_Font[5] = "Verdama" $aSplit = StringSplit($sCaptcha, "") For $x = 0 To 5 $__CaptchaCode_cCharacter[$x] = GUICtrlCreateLabel($aSplit[$x + 1], $iX, $iY) $iX += 20 + Random(1, 5, 1) $iY = Random(15, 40, 1) GUICtrlSetBkColor($__CaptchaCode_cCharacter[$x], -2) GUICtrlSetColor($__CaptchaCode_cCharacter[$x], Random(0x808080, 0xC0C0C0)) $iNum = Random(1, 7, 1) Switch $iNum Case 1 $iStyle = 2 ;2 Case 2 $iStyle = 4 ;4 Case 3 $iStyle = 8 ;8 Case 4 $iStyle = 2 + 4 ;6 Case 5 $iStyle = 4 + 8 ;12 Case 6 $iStyle = 2 + 8 ;10 Case 7 $iStyle = 2 + 4 + 8 ;16 EndSwitch GUICtrlSetFont($__CaptchaCode_cCharacter[$x], 13, Random(350, 450, 1), $iStyle, $a__CaptchaCode_Font[Random(0, 5, 1)]) Sleep(10) Next $iX = 15 + Random(1, 10, 1) $iY = 5 + Random(1, 10, 1) For $z = 0 To 4 $c__CaptchaCode_Label[$z] = GUICtrlCreateLabel("", $iX, $iY, 1, 30) $iX += 25 + Random(1, 10, 1) $iY = 5 + Random(1, 30, 1) GUICtrlSetBkColor($c__CaptchaCode_Label[$z], Random(0x808080, 0xC0C0C0)) Next $iX = 5 + Random(1, 25, 1) $iY = 20 + Random(1, 10, 1) For $b = 0 To 1 $c__CaptchaCode_Line[$b] = GUICtrlCreateLabel("", $iX, $iY, 130, 1) $iX = 5 + Random(1, 10, 1) $iY += 10 + Random(1, 10, 1) GUICtrlSetBkColor($c__CaptchaCode_Line[$b], Random(0x808080, 0xC0C0C0)) Next Return _Crypt_HashData($sCaptcha,$CALG_MD5) EndFunc ;==>__CaptchaCode_Create Func __CaptchaCode_Delete() For $y = 0 To 5 GUICtrlDelete($__CaptchaCode_cCharacter[$y]) Next For $a = 0 To 4 GUICtrlDelete($c__CaptchaCode_Label[$a]) Next For $c = 0 To 1 GUICtrlDelete($c__CaptchaCode_Line[$c]) Next EndFunc ;==>__CaptchaCode_Delete Func __CaptchaCode_Generate() Local $sCharacters = StringSplit("BCDFGHJKLMNPQRSTVWXYZ1234567890", "") Local $sCode = "" For $i = 1 To 6 $sCode &= $sCharacters[Random(1, $sCharacters[0], 1)] Next Return $sCode EndFunc ;==>__CaptchaCode_Generate Ouch. I actualy DO need graphics... Definitly, maybe Yashied has something in his vault for you ... Â OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13)Â BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16)Â ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
ptrex Posted April 9, 2010 Share Posted April 9, 2010 Indead has been done before http://www.autoitscript.com/forum/index.php?showtopic=104580&pid=739784&st=0&#entry739784 rgds ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
James Posted April 9, 2010 Share Posted April 9, 2010 send that as a cookie, and finally compare the md5() value of the users input with the value of the cookie...Why would you store such data in a cookie? Sessions are much better for this type of thing. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
KaFu Posted April 9, 2010 Share Posted April 9, 2010 Why would you store such data in a cookie? Sessions are much better for this type of thing.If I remember correctly I've had some trouble with Session ID at that time. But why not use a one way encrypted / hashed value instead in a cookie? At least I can't see no security risk there, worst possible case is that cookie's blocked... users fault. Â OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13)Â BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16)Â ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
James Posted April 10, 2010 Share Posted April 10, 2010 If I remember correctly I've had some trouble with Session ID at that time. But why not use a one way encrypted / hashed value instead in a cookie? At least I can't see no security risk there, worst possible case is that cookie's blocked... users fault.Not very user accessible is it. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
KaFu Posted April 10, 2010 Share Posted April 10, 2010 Harry, you're talking bullshit... Â OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13)Â BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16)Â ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
James Posted April 10, 2010 Share Posted April 10, 2010 Harry, you're talking bullshit...Pardon? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
AlmarM Posted April 10, 2010 Author Share Posted April 10, 2010 Ah yes, thanks for the MD5 version! Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
AutoProgramming Posted April 10, 2010 Share Posted April 10, 2010 Btw it's not to hard to crack if you are trying to extract the string from the image because it does just use standard fonts and no distortion, etc [u]My OpenSource Projects:[/u]- [BEEP] proMusiX- Search autorun.inf Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted April 10, 2010 Share Posted April 10, 2010 Btw it's not to hard to crack if you are trying to extract the string from the image because it does just use standard fonts and no distortion, etc Oh well... it's still pretty cool. Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now