]> git.sesse.net Git - freerainbowtables/blob - Client Applications/rcracki_mt/ChainWalkSet.h
05622cfd8e867c728b41e5558276758d8ad2b217
[freerainbowtables] / Client Applications / rcracki_mt / ChainWalkSet.h
1 /*
2    RainbowCrack - a general propose implementation of Philippe Oechslin's faster time-memory trade-off technique.
3
4    Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
5 */
6
7 #ifndef _CHAINWALKSET_H
8 #define _CHAINWALKSET_H
9
10 #include "Public.h"
11
12 struct ChainWalk
13 {
14         unsigned char Hash[MAX_HASH_LEN];
15         //int nHashLen;         // Implied
16         uint64* pIndexE;        // mapStartPosIndexE, Len = nRainbowChainLen - 1
17 };
18
19 class CChainWalkSet
20 {
21 public:
22         CChainWalkSet();
23         virtual ~CChainWalkSet();
24
25 private:
26         string m_sHashRoutineName;              // Discard all if not match
27         string m_sPlainCharsetName;             // Discard all if not match
28         int    m_nPlainLenMin;                  // Discard all if not match
29         int    m_nPlainLenMax;                  // Discard all if not match
30         int    m_nRainbowTableIndex;    // Discard all if not match
31         int    m_nRainbowChainLen;              // Discard all if not match
32         list<ChainWalk> m_lChainWalk;
33         bool   debug;
34         string sPrecalcPathName;
35         int    preCalcPart;
36         vector<string> vPrecalcFiles;
37
38 private:
39         void DiscardAll();
40         bool FindInFile(uint64* pIndexE, unsigned char* pHash, int nHashLen);
41         string CheckOrRotatePreCalcFile();
42         void updateUsedPrecalcFiles();
43
44 public:
45         uint64* RequestWalk(unsigned char* pHash, int nHashLen,
46                                                 string sHashRoutineName,
47                                                 string sPlainCharsetName, int nPlainLenMin, int nPlainLenMax, 
48                                                 int nRainbowTableIndex, 
49                                                 int nRainbowChainLen,
50                                                 bool& fNewlyGenerated,
51                                                 bool setDebug,
52                                                 string sPrecalc);
53         void DiscardWalk(uint64* pIndexE);
54         void StoreToFile(uint64* pIndexE, unsigned char* pHash, int nHashLen);
55         void removePrecalcFiles();
56 };
57
58 #endif