Results 1 to 7 of 7

Thread: captcha

  1. #1
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default captcha

    I was trying to break this captcha and I got this, anyone want to help me get farther?
    SCAR Code:
    program New;
    var
      b: TBitmap;
      w, h, i: Integer;
      p: TPointArray;
     
    Procedure RemoveTPointFromArray(Index:Integer; Var Arr:TPointArray);
    begin
      tSwap(Arr[Index], Arr[High(Arr)]);
      SetArrayLength(Arr, High(Arr));
    end;

    Procedure FilterPoints(var p:TPointArray; II, III:Integer);
    var
      I, x, y, c:Integer;
    begin
      For I:=0 to high(P)do
      begin
        C:=0;
        for x:= 0 to II do
          for y:= 0 to II do
            if getcolor(p[I].x-x, p[I].y-y) <> 0 then
              Inc(C);
        If C > III then
          RemoveTPointFromArray(I, P);
      end;
    end;

    begin
      b := LoadBitmap('C:\tmp.jpeg');
      GetBitmapSize(b, w, h);

      SetTargetBitmap(b);
      FindColorsTolerance(p, clwhite, 0, 0, w, h, 0);
      for i := 0 to High(p) do
        FastSetPixel(b, p[i].x, p[i].y, clblack);
      FindColorsTolerance(p, clwhite, 0, 0, w, h, 441);
      FilterPoints(P, 1, 3);

      for i := 0 to High(p) do
        FastSetPixel(b, p[i].x, p[i].y, clblack);

      FindColorsTolerance(p, clwhite, 0, 0, w, h, 441);
      for i := 0 to High(p) do
        FastSetPixel(b, p[i].x, p[i].y, clred);

      DisplayDebugImgWindow(w, h);
      SafeDrawBitmap(b, GetDebugCanvas, 0, 0);

      FreeBitmap(b);
    end.

  2. #2
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    So no one cares, double post
    SCAR Code:
    program New;
    var
      b: TBitmap;
      w, h, i: Integer;
      p: TPointArray;

    Procedure RemoveTPointFromArray(Index:Integer; Var Arr:TPointArray);
    begin
      tSwap(Arr[Index], Arr[High(Arr)]);
      SetArrayLength(Arr, High(Arr));
    end;

    Procedure FilterPoints(var p:TPointArray; Color, II, III:Integer);
    var
      I, x, y, c:Integer;
      //TPA:TPointArray;
    begin
      //TPA:=P;
      For I:=0 to high(P)do
      begin
        C:=0;
        for x:= 0 to II do
          for y:= 0 to II do
            if getcolor(p[i].x-x, p[i].y-y) <> Color then
              Inc(C);
        If C > III then
          RemoveTPointFromArray(I, {TPA}P);
      end;
      //P:=TPA;
    end;

    begin
      b := LoadBitmap('C:\tmp.jpeg');
      GetBitmapSize(b, w, h);

      SetTargetBitmap(b);
      FindColorsTolerance(p, clwhite, 0, 0, w, h, 0);
      for i := 0 to High(p) do
        FastSetPixel(b, p[i].x, p[i].y, clblack);
      FindColorsTolerance(p, clwhite, 0, 0, w, h, 441);
      for i := 0 to High(p) do
        FastSetPixel(b, p[i].x, p[i].y, Clwhite);

      FindColorsTolerance(p, clwhite, 0, 0, w, h, 441);
      FilterPoints(P, 0, 1, 3);
      for i := 0 to High(p) do
        FastSetPixel(b, p[i].x, p[i].y, clBlack);
       
      DisplayDebugImgWindow(w, h);
      SafeDrawBitmap(b, GetDebugCanvas, 0, 0);

      FreeBitmap(b);
    end.

  3. #3
    Join Date
    Sep 2008
    Posts
    241
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol, I wouldn't consider it that hard to break.

    You just need to make a right triangle against one of the letters, to figure out the slant of the code.

    Then you just make SCAR shift the pixels to the left or right to make the code upright.

    From there, it's just a piece of cake.
    PM me if you need any help with math.
    I can try to help you with anything!


  4. #4
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by xXxBlender3DxXx View Post
    Lol, I wouldn't consider it that hard to break.

    You just need to make a right triangle against one of the letters, to figure out the slant of the code.

    Then you just make SCAR shift the pixels to the left or right to make the code upright.

    From there, it's just a piece of cake.
    Using some leet trig?

  5. #5
    Join Date
    Sep 2008
    Posts
    241
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Trig ownage!

    So, do you any help?
    PM me if you need any help with math.
    I can try to help you with anything!


  6. #6
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I don't think rotating it is even needed..

  7. #7
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Search for pixel group smaller than 3 pixels (in a 9x9 square) and take those out. That will remove lots of noise

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •