Debian Codegraph @

src/core/ophcrack.h

raw symbols SCIP
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 OPHCRACK_H
33 #define OPHCRACK_H
34
35 #include "misc.h"
36 #include "scheduler.h"
37 #include "list.h"
38 #include "table.h"
39 #include "hash.h"
40 #include "ophtask.h"
41 #include "ophstat.h"
42 #include "arg.h"
43
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47
48 typedef struct ophcrack_t_ {
49 scheduler_t *sched;
50
51 list_t *tables;
52 list_t *hashes;
53 list_t *active;
54 list_t *enabled;
55 list_t *remaining;
56
57 list_nd_t *hnd;
58 ophstat_t *stat;
59
60 int maxtid;
61 int maxhid;
62 table_kind_t maxtkind;
63
64 int npwds_total;
65 int npwds_found;
66
67 uint64_t (*find_freeram)(void);
68 uint64_t freeram;
69
70 arg_t *arg;
71 } ophcrack_t;
72
73 ophcrack_t *ophcrack_alloc(int nthreads, arg_t *arg);
74 void ophcrack_free(ophcrack_t *crack);
75 void ophcrack_start(ophcrack_t *crack);
76 void ophcrack_stop(ophcrack_t *crack);
77
78 int ophcrack_setup_table(table_t *tbl);
79 void ophcrack_add_table(ophcrack_t *crack, table_t *tbl);
80 void ophcrack_add_hash(ophcrack_t *crack, hash_t *hsh);
81 void ophcrack_associate(ophcrack_t *crack, hash_t *hsh, table_t *tbl);
82 void ophcrack_reset(ophcrack_t *crack, int kind_mask, int remove);
83
84 void *ophcrack_run(void *arg);
85 void ophcrack_preload_check(ophcrack_t *crack);
86
87 ophtask_t *ophcrack_find(ophcrack_t *crack, ophtask_t *task, int id);
88 ophtask_t *ophcrack_lookup_idx(ophcrack_t *crack, ophtask_t *task, int id);
89 ophtask_t *ophcrack_lookup_end(ophcrack_t *crack, ophtask_t *task, int id);
90 ophtask_t *ophcrack_lookup_srt(ophcrack_t *crack, ophtask_t *task, int id);
91 ophtask_t *ophcrack_check(ophcrack_t *crack, ophtask_t *task, int id);
92 ophtask_t *ophcrack_preload_all(ophcrack_t *crack, ophtask_t *task, int id);
93 ophtask_t *ophcrack_preload_one(ophcrack_t *crack, ophtask_t *task, int id);
94 ophtask_t *ophcrack_bforce_all(ophcrack_t *crack, ophtask_t *task, int id);
95 ophtask_t *ophcrack_resolve_nt(ophcrack_t *crack, ophtask_t *task, int id);
96 ophtask_t *ophcrack_bforce_nt(ophcrack_t *crack, ophtask_t *task, int id);
97 ophtask_t *ophcrack_bforce_lm(ophcrack_t *crack, ophtask_t *task, int id);
98 ophtask_t *ophcrack_unload(ophcrack_t *crack, ophtask_t *task, int id);
99
100 void ophcrack_update(ophcrack_t *crack);
101 void ophcrack_found(ophcrack_t *crack, hash_t *hsh, table_t *tbl, int col, char *pwd);
102 void ophcrack_notfound(ophcrack_t *crack, hash_t *hsh);
103
104 int ophcrack_has_next(ophcrack_t *crack);
105 ophtask_t *ophcrack_next(ophcrack_t *crack);
106 void ophcrack_save(ophcrack_t *crack, FILE *file, int nice, int status);
107 void ophcrack_export_csv(ophcrack_t *crack, FILE *file, int *fields, char separator, char quote);
108
109 int ophcrack_pwd_cmp(const void *a, const void *b);
110 int ophcrack_col_cmp(const void *a, const void *b);
111 char *lm_from_nt(const char *pwd, int n, const uchar_t *lmhash);
112
113 #ifdef __cplusplus
114 }
115 #endif
116 #endif