]> git.sesse.net Git - freerainbowtables/blob - Client Applications/rcracki_mt/ChainWalkSet.h
test
[freerainbowtables] / Client Applications / rcracki_mt / ChainWalkSet.h
1 /*
2  * rcracki_mt is a multithreaded implementation and fork of the original 
3  * RainbowCrack
4  *
5  * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
6  * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>
7  * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
8  * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
9  *
10  * This file is part of rcracki_mt.
11  *
12  * rcracki_mt is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation, either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * rcracki_mt is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with rcracki_mt.  If not, see <http://www.gnu.org/licenses/>.
24  */
25
26 #ifndef _CHAINWALKSET_H
27 #define _CHAINWALKSET_H
28
29 #include "Public.h"
30
31 struct ChainWalk
32 {
33         unsigned char Hash[MAX_HASH_LEN];
34         //int nHashLen;         // Implied
35         uint64* pIndexE;        // mapStartPosIndexE, Len = nRainbowChainLen - 1
36 };
37
38 class CChainWalkSet
39 {
40 public:
41         CChainWalkSet();
42         virtual ~CChainWalkSet();
43
44 private:
45         string m_sHashRoutineName;              // Discard all if not match
46         string m_sPlainCharsetName;             // Discard all if not match
47         int    m_nPlainLenMin;                  // Discard all if not match
48         int    m_nPlainLenMax;                  // Discard all if not match
49         int    m_nRainbowTableIndex;    // Discard all if not match
50         int    m_nRainbowChainLen;              // Discard all if not match
51         list<ChainWalk> m_lChainWalk;
52         bool   debug;
53         string sPrecalcPathName;
54         int    preCalcPart;
55         vector<string> vPrecalcFiles;
56
57 private:
58         void DiscardAll();
59         bool FindInFile(uint64* pIndexE, unsigned char* pHash, int nHashLen);
60         string CheckOrRotatePreCalcFile();
61         void updateUsedPrecalcFiles();
62
63 public:
64         uint64* RequestWalk(unsigned char* pHash, int nHashLen,
65                                                 string sHashRoutineName,
66                                                 string sPlainCharsetName, int nPlainLenMin, int nPlainLenMax, 
67                                                 int nRainbowTableIndex, 
68                                                 int nRainbowChainLen,
69                                                 bool& fNewlyGenerated,
70                                                 bool setDebug,
71                                                 string sPrecalc);
72         void DiscardWalk(uint64* pIndexE);
73         void StoreToFile(uint64* pIndexE, unsigned char* pHash, int nHashLen);
74         void removePrecalcFiles();
75 };
76
77 #endif