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

Last change on this file since 1003 was 1003, checked in by Sam Hocevar, 11 years ago
  • Started working on ticketmaster captcha.
  • Property svn:keywords set to Id
File size: 2.6 KB
2 * commin.h: common stuff
3 * $Id: common.h 1003 2006-07-16 15:07:04Z 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 pwnprint(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_tickets(struct image *img);
50char *decode_ticketmaster(struct image *img);
51char *decode_vbulletin(struct image *img);
52char *decode_xanga(struct image *img);
53char *decode_test(struct image *img);
55/* image operations */
56struct image *image_load(const char *name);
57struct image *image_new(int width, int height);
58struct image *image_dup(struct image *img);
59void image_free(struct image *img);
60void image_save(struct image *img, const char *name);
61void image_swap(struct image *img1, struct image *img2);
62int getgray(struct image *img, int x, int y, int *g);
63int getpixel(struct image *img, int x, int y, int *r, int *g, int *b);
64int setpixel(struct image *img, int x, int y, int r, int g, int b);
66/* font operations */
67struct font *font_load_fixed(char *file, char *chars);
68struct font *font_load_variable(char *file, char *chars);
69void font_free(struct font *font);
71/* image filters */
72void filter_flood_fill(struct image *img, int x, int y, int r, int g, int b);
73void filter_fill_holes(struct image *img);
74void filter_scale(struct image *img, float ratio);
75void filter_black_stuff(struct image *img);
76void filter_detect_lines(struct image *img);
77void filter_threshold(struct image *img, int threshold);
78void filter_trick(struct image *img);
79void filter_smooth(struct image *img);
80void filter_median(struct image *img);
81void filter_contrast(struct image *img);
82void filter_crop(struct image *img, int xmin, int ymin, int xmax, int ymax);
83int filter_count(struct image *img);
Note: See TracBrowser for help on using the repository browser.