1 /*
2  *
3  *   Ophcrack is a Lanmanager/NTLM hash cracker based on the faster time-memory
4  *   trade-off using rainbow tables.
5  *
6  *   Created with the help of: Maxime Mueller, Luca Wullschleger, Claude
7  *   Hochreutiner, Andreas Huber and Etienne Dysli.
8  *
9  *   Copyright (c) 2008 Philippe Oechslin, Cedric Tissieres, Bertrand Mesot
10  *
11  *   Ophcrack is free software; you can redistribute it and/or modify
12  *   it under the terms of the GNU General Public License as published by
13  *   the Free Software Foundation; either version 2 of the License, or
14  *   (at your option) any later version.
15  *
16  *   Ophcrack is distributed in the hope that it will be useful,
17  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *   GNU General Public License for more details.
20  *
21  *   You should have received a copy of the GNU General Public License
22  *   along with Ophcrack; if not, write to the Free Software
23  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24  *
25  *   This program is released under the GPL with the additional exemption
26  *   that compiling, linking, and/or using OpenSSL is allowed.
27  *
28  *
29  *
30  *
31 */
32 #ifndef OPHTASK_H
33 #define OPHTASK_H
34 
35 #include "hash.h"
36 #include "table.h"
37 #include "ophel.h"
38 #include "ophstat.h"
39 
40 #ifdef  __cplusplus
41 extern "C" {
42 #endif
43 
44 #define BLOOM_SIZE 32768 /* 2^20 positions */
45 
46 typedef enum { preload_all = 0x001,
47 	       preload_one = 0x002,
48 	       unload      = 0x004,
49 	       find        = 0x008,
50 	       lookup_idx  = 0x010,
51 	       lookup_end  = 0x020,
52 	       lookup_srt  = 0x040,
53 	       check       = 0x080,
54 	       bforce_all  = 0x100,
55 	       bforce_nt   = 0x200,
56 	       bforce_lm   = 0x400,
57 	       resolve_nt  = 0x800,
58 	       all         = 0xfff } ophkind_t;
59 
60 typedef struct ophload_t_ {
61   list_t *tables;
62   table_t *tbl;
63   table_preload_t preload;
64 } ophload_t;
65 
66 typedef struct ophwork_t_ {
67   hash_t *hsh;
68   htbl_t *htbl;
69 
70   int cmin;
71   int cmax;
72 
73   ophel_t **tosearch;
74 } ophwork_t;
75 
76 typedef struct ophbforce_t_ {
77   int nhashes;
78 
79   hash_t **hashes;
80   uchar_t **hash;
81   int *found;
82 
83   int idx[8];
84   int len;
85 
86   int count;
87 
88   int bloom[BLOOM_SIZE];
89 } ophbforce_t;
90 
91 typedef struct ophtask_t_ {
92   ophkind_t kind;
93   void *data;
94   ophstat_t *stat;
95 } ophtask_t;
96 
97 ophtask_t *ophtask_alloc(ophkind_t kind);
98 void ophtask_free(ophtask_t *task);
99 void ophtask_convert(ophtask_t *task, ophkind_t from, ophkind_t to);
100 
101 #ifdef  __cplusplus
102 }
103 #endif
104 #endif
105