source: pwntcha/trunk/src/common.h @ 477

Last change on this file since 477 was 477, checked in by Sam Hocevar, 17 years ago
  • crack ourcolony captchas (in the scode decoder)
  • started work on livejournal captchas.
  • Property svn:keywords set to Id
File size: 2.5 KB
2 * commin.h: common stuff
3 * $Id: common.h 477 2005-04-27 08:54:33Z sam $
4 *
5 * Copyright: (c) 2004 Sam Hocevar <>
6 *   This program is free software; you can redistribute it and/or
7 *   modify it under the terms of the Do What The Fuck You Want To
8 *   Public License as published by Banlu Kemiyatorn. See
9 * for more details.
10 */
12/* image structure */
13struct image
15    int width, height, pitch, channels;
16    unsigned char *pixels;
17    void *priv;
20/* font structure */
21struct font
23    struct image *img;
24    struct glyph
25    {
26        int xmin, xmax, ymin, ymax;
27        int count; /* Black pixel count */
28        char c;
29    } *glyphs;
30    int size;
33/* global variables */
34extern char *argv0;
35extern char *share;
37/* debug function */
38void dprintf(const char *fmt, ...);
40/* available CAPTCHA decoders */
41char *decode_authimage(struct image *img);
42char *decode_clubic(struct image *img);
43char *decode_linuxfr(struct image *img);
44char *decode_livejournal(struct image *img);
45char *decode_paypal(struct image *img);
46char *decode_phpbb(struct image *img);
47char *decode_scode(struct image *img);
48char *decode_slashdot(struct image *img);
49char *decode_vbulletin(struct image *img);
50char *decode_xanga(struct image *img);
51char *decode_test(struct image *img);
53/* image operations */
54struct image *image_load(const char *name);
55struct image *image_new(int width, int height);
56struct image *image_dup(struct image *img);
57void image_free(struct image *img);
58void image_save(struct image *img, const char *name);
59void image_swap(struct image *img1, struct image *img2);
60int getgray(struct image *img, int x, int y, int *g);
61int getpixel(struct image *img, int x, int y, int *r, int *g, int *b);
62int setpixel(struct image *img, int x, int y, int r, int g, int b);
64/* font operations */
65struct font *font_load_fixed(char *file, char *chars);
66struct font *font_load_variable(char *file, char *chars);
67void font_free(struct font *font);
69/* image filters */
70void filter_flood_fill(struct image *img, int x, int y, int r, int g, int b);
71void filter_fill_holes(struct image *img);
72void filter_scale(struct image *img, float ratio);
73void filter_black_stuff(struct image *img);
74void filter_detect_lines(struct image *img);
75void filter_equalize(struct image *img, int threshold);
76void filter_trick(struct image *img);
77void filter_smooth(struct image *img);
78void filter_median(struct image *img);
79void filter_contrast(struct image *img);
80void filter_crop(struct image *img, int xmin, int ymin, int xmax, int ymax);
81int filter_count(struct image *img);
Note: See TracBrowser for help on using the repository browser.