Ignore:
Timestamp:
Jan 10, 2005, 4:31:33 PM (18 years ago)
Author:
Sam Hocevar
Message:
  • Use font_load_* for all decoders.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pwntcha/trunk/src/xanga.c

    r445 r448  
    2121static void fill_white_holes(struct image *img);
    2222
    23 /* Our macros */
    24 #define FACTOR 1
    25 #define FONTNAME "font_xanga.png" // use with FACTOR = 1
    26 //#define FONTNAME "font.png" // use with FACTOR = 2
    27 //#define FONTNAME "font_dilated.png" // use with FACTOR = 2
    28 static struct image *font = NULL;
    29 
    30 /* Global stuff */
    31 struct { int xmin, ymin, xmax, ymax; } objlist[100];
    32 int objects, first, last;
    33 char *result;
    34 
    3523/* Main function */
    3624char *decode_xanga(struct image *img)
    3725{
     26    static struct font *font1 = NULL, *font2 = NULL, *font3 = NULL;
    3827    struct image *tmp;
     28    char *result;
    3929
    40     /* Initialise local data */
    41     objects = 0;
    42     first = -1;
    43     last = -1;
     30    if(!font1)
     31    {
     32        font1 = font_load_variable("font_freemonobold_32_az.bmp",
     33                                   "abcdefghijklmnopqrstuvwxyz");
     34        if(!font1)
     35            exit(1);
     36    }
     37
     38    if(!font2)
     39    {
     40        font2 = font_load_variable("font_freemonobold_32_az.bmp",
     41                                   "abcdefghijklmnopqrstuvwxyz");
     42        if(!font2)
     43            exit(1);
     44    }
     45
     46    if(!font3)
     47    {
     48        font3 = font_load_variable("font_freemonobold_32_az.bmp",
     49                                   "abcdefghijklmnopqrstuvwxyz");
     50        if(!font3)
     51            exit(1);
     52    }
    4453
    4554    /* Xanga captchas have 7 characters */
     
    6978
    7079    /* Invert rotation and find glyphs */
    71     rotate(tmp);
    7280    filter_median(tmp);
    7381
     
    8795{
    8896    struct image *tmp;
    89     int x, y, i;
     97    int x, y;
    9098    int r, g, b;
    9199
Note: See TracChangeset for help on using the changeset viewer.