Debian Codegraph @

src/core/hash.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 HASH_H
33 #define HASH_H
34
35 #include <stdio.h>
36
37 #include "misc.h"
38 #include "list.h"
39 #include "table.h"
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 static const uchar_t empty_lmhash[8] = {0xaa, 0xd3, 0xb4, 0x35, 0xb5, 0x14, 0x04, 0xee};
46 static const uchar_t empty_nthash[16] = {0x31, 0xd6, 0xcf, 0xe0, 0xd1, 0x6a, 0xe9, 0x31,
47 0xb7, 0x3c, 0x59, 0xd7, 0xe0, 0xc0, 0x89, 0xc0 };
48 static const char pwdump_nopwd[33] = "NO PASSWORD*********************";
49 static const char samdump_nopwd[33] = "00000000000000000000000000000000";
50 static const char empty_pwd[8] = "/EMPTY/";
51
52 typedef enum { lm1, lm2, nt } hash_kind_t;
53
54 typedef struct htbl_t_ {
55 table_t *tbl;
56 int col;
57 int covered;
58 } htbl_t;
59
60 typedef struct hash_t_ {
61 hash_kind_t kind;
62 int id;
63
64 int uid;
65 int done;
66
67 uchar_t *hash;
68 char *pwd;
69 char *str;
70 char *status;
71 char info[64];
72
73 int length;
74 int category;
75 int time;
76 char *table;
77
78 list_t *tables;
79 list_nd_t *tnd;
80
81 struct hash_t_ *lmhsh1;
82 struct hash_t_ *lmhsh2;
83 } hash_t;
84
85 uchar_t *hash_alloc_hash(hash_kind_t kind);
86 char *hash_alloc_pwd(hash_kind_t kind);
87
88 hash_t *hash_alloc(hash_kind_t kind, int hlen, int plen, int idx);
89 void hash_free(hash_t *hsh);
90
91 void hash_add_table(hash_t *hsh, table_t *tbl);
92 int hash_extract_lmnt(char *buff, list_t *hashes, int id);
93 int hash_load_pwdump(list_t *hashes, FILE *file, int id);
94 int hash_load_sam(list_t *hashes, const char *dir, int id);
95 int hash_dump_sam(list_t *hashes, int id);
96 void hash_print(hash_t *hsh, FILE *file, int nice, int status, int hide);
97
98 #ifdef __cplusplus
99 }
100 #endif
101 #endif