[오토핫키] 캡챠 구현

2018. 4. 13. 14:23·오토핫키·
  • ; Captcha example by Titan
  •  
  • Gui, + ToolWindow
  • Gui, Add, Text, x10 y10 w75, Enter the code:
  • Pass := Captcha(90, 10)
  • Gui, Add, Edit, vInput x90 y50 w50
  • Gui, Add, Button, gGo default x145 y50 h20, Enter
  • Gui, Show, , Captcha
  • Return
  •  
  • Go:
  • Gui, Submit, NoHide
  • If Input != % Pass
  •   MsgBox, 16, Error, You didnt enter the code correctly!`n`nThe code was: %Pass%
  • else
  •   MsgBox, 64, Cool, done!`n`nThe code was: %Pass%
  • Return
  •  
  • ~* Esc::
  • GuiClose:
  • ExitApp
  •  
  • Captcha(x, y, len=6, lvl=0, gui=1)
  • {
  •   ; Captcha by Titan
  •   w := len * 15 + 10
  •   h := 35
  •   Gui, %gui%: Add, Text, Border Section x%x% y%y% w%w% h%h%
  •   xw := x + 10
  •   Loop, % len
  •   {
  •     Gui, Font, % Random("Styles") "w" Random("Number", 1, 1000) "s" Random("Number", 8, 12) "c" Random("Colour"), Random("Font")
  •     key := Pass(1)
  •     keys = %keys%%key%
  •     yw := "ys+" Random("Number", 3, 10)
  •     Gui, %gui%: Add, Text, BackgroundTrans x%xw% %yw%, % key
  •     xw += % Random("Number", 10, 15)
  •   }
  •   Gui, Font
  •   if (lvl = 1)
  •   {
  •     yw = 5
  •     Loop, % ( Floor(w/3))
  •       dots = %dots%.
  •     Loop, 5
  •     {
  •       Gui, Font, % "w1" "c" Random("Colour")
  •       Gui, %gui%: Add, Text, BackgroundTrans + Wrap x%x% y%yw% w3, % dots
  •       yw += 5
  •     }
  •     Gui, Font
  •   }
  •   Return, % keys
  • }
  •  
  • Pass(len=5, chars=0)
  • {
  •   ; Captcha module by Titan
  •   chAlpha = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  •   chNum = 1234567890
  •   chAlphaNum = %chAlpha%%chNum%
  •   If chars in 0,alphanum
  •     StringSplit, list, chAlphaNum
  •   else If chars in 1, alpha
  •     StringSplit, list, chAlpha
  •   else If chars in 2,num
  •     StringSplit, list, chNum
  •   Loop, % len
  •   {
  •     Random, rnd, 1, % list0
  •     i := list%rnd%
  •     pass = %pass%%i%
  •   }
  •   Return, pass
  • }
  •  
  • Random( type, p1=0, p2=0)
  • {
  •   ; Captcha module by Titan
  •   If type in Number
  •     Random, r, % p1, % p2
  •   else If type in Font
  •   {
  •     Fonts = Arial,Courier,Courier New,Lucida Console,MS Sans Serif,MS Serif,Tahoma,Times New Roman
  •     StringSplit, Fonts, Fonts, `,
  •     Random, r, 1, %Fonts0%
  •     r := Fonts%r%
  •   }
  •   else If type in Colour
  •   {
  •     Colours = Black,Green,Silver,Lime,Gray,Olive,White,Yellow,Maroon,Navy,Red,Blue,Purple,Teal,Fuchsia,Aqua
  •     StringSplit, Colours, Colours, `,
  •     Random, r, 1, %Colours0%
  •     r := Colours%r%
  •   }
  •   else If type in Styles
  •   {
  •     Styles = bold, underline, norm,0x7,0x4,0x1,0x10,0x11,0x8,0x5,0xC,0x80,0x100,0x2,0x1000,0x9,0x6
  •     StringSplit, Styles, Styles, `,
  •     Random, r, 1, %Styles0%
  •     r := Styles%r%
  •   }
  •   Return, % r
  • }


  • 출처: http://nimto.tistory.com/691 [ㄴrㅎnㅂrㄹrㄱi]

    저작자표시 (새창열림)

    '오토핫키' 카테고리의 다른 글

    [오토핫키] XOR 암호화/복호화 예제  (0) 2018.04.18
    [오토핫키] 스톱워치 구현  (0) 2018.04.13
    [오토핫키] 티스토리 블로그 인증  (0) 2018.04.12
    [오토핫키] Edit 창 누르면 공백으로 바뀌기  (0) 2018.04.06
    [오토핫키] 활성화 된 창 제목과 경로 가져오기  (0) 2018.04.06
    '오토핫키' 카테고리의 다른 글
    • [오토핫키] XOR 암호화/복호화 예제
    • [오토핫키] 스톱워치 구현
    • [오토핫키] 티스토리 블로그 인증
    • [오토핫키] Edit 창 누르면 공백으로 바뀌기
    징쟝
    징쟝
    IT 관련 네트워크 및 기타 자료들을 수집하고 공유하는데 목적이 있음.
    • 징쟝
      네트워커의 보안 티스토리
      징쟝
    • 전체
      오늘
      어제
    • 블로그 메뉴

      • 홈
      • 글쓰기
      • 방명록
      • 분류 전체보기 (148) N
        • 정보보안 (54)
        • 리눅스 (10)
        • Windows (6)
        • Cisco (1)
        • Mikrotik (0)
        • Cyberoam (0)
        • Juniper (6)
        • MRTG (0)
        • Sophos (3)
        • SecuWiz (0)
        • Forti (0)
        • SECUI (1)
        • L4 (3)
        • 파이오링크 (0)
        • 오토핫키 (43)
        • 파이썬 (0)
        • 직장 (0)
        • 개인적인 것들 (9)
        • 그 외의 것들 (7) N
        • 영화 (0)
        • 테스트 (1)
        • 일기장 (0)
        • 쓰레기통 (3)
    • 링크

    • 공지사항

    • 인기 글

    • 태그

      정보보안
      웹보안
      php
      웹해킹
      web
      SQL
      HTML
      해킹
      NAT
      CSRF
      인젝션
      MySQL
      spoofing
      보안
      오토핫키
    • 최근 댓글

    • 최근 글

    • hELLO· Designed By정상우.v4.10.3
    징쟝
    [오토핫키] 캡챠 구현
    상단으로

    티스토리툴바