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

Last change on this file since 456 was 456, checked in by Sam Hocevar, 18 years ago
  • Paypal decoder. 64% efficiency.
  • Property svn:keywords set to Id
File size: 2.5 KB
2 * commin.h: common stuff
3 * $Id: common.h 456 2005-01-12 03:42:08Z 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_paypal(struct image *img);
45char *decode_phpbb(struct image *img);
46char *decode_scode(struct image *img);
47char *decode_slashdot(struct image *img);
48char *decode_vbulletin(struct image *img);
49char *decode_xanga(struct image *img);
50char *decode_test(struct image *img);
52/* image operations */
53struct image *image_load(const char *name);
54struct image *image_new(int width, int height);
55struct image *image_dup(struct image *img);
56void image_free(struct image *img);
57void image_save(struct image *img, const char *name);
58void image_swap(struct image *img1, struct image *img2);
59int getgray(struct image *img, int x, int y, int *g);
60int getpixel(struct image *img, int x, int y, int *r, int *g, int *b);
61int setpixel(struct image *img, int x, int y, int r, int g, int b);
63/* font operations */
64struct font *font_load_fixed(char *file, char *chars);
65struct font *font_load_variable(char *file, char *chars);
66void font_free(struct font *font);
68/* image filters */
69void filter_flood_fill(struct image *img, int x, int y, int r, int g, int b);
70void filter_fill_holes(struct image *img);
71void filter_scale(struct image *img, float ratio);
72void filter_black_stuff(struct image *img);
73void filter_detect_lines(struct image *img);
74void filter_equalize(struct image *img, int threshold);
75void filter_trick(struct image *img);
76void filter_smooth(struct image *img);
77void filter_median(struct image *img);
78void filter_contrast(struct image *img);
79void filter_crop(struct image *img, int xmin, int ymin, int xmax, int ymax);
80int filter_count(struct image *img);
Note: See TracBrowser for help on using the repository browser.