2 * rcracki_mt is a multithreaded implementation and fork of the original
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 * Copyright 2010 uroskn
11 * This file is part of rcracki_mt.
13 * rcracki_mt is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation, either version 2 of the License, or
16 * (at your option) any later version.
18 * rcracki_mt is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.
27 #ifndef _CRACKENGINE_H
28 #define _CRACKENGINE_H
32 #include "ChainWalkContext.h"
33 #include "MemoryPool.h"
34 #include "ChainWalkSet.h"
35 #include "rcrackiThread.h"
46 virtual ~CCrackEngine();
55 string sSessionPathName;
56 string sProgressPathName;
57 string sPrecalcPathName;
58 //string sPrecalcIndexPathName;
60 bool keepPrecalcFiles;
63 float m_fTotalDiskAccessTime;
64 float m_fTotalCryptanalysisTime;
65 float m_fTotalPrecalculationTime;
66 int m_nTotalChainWalkStep;
67 int m_nTotalFalseAlarm;
68 int m_nTotalChainWalkStepDueToFalseAlarm;
72 void ResetStatistics();
73 RainbowChain *BinarySearch(RainbowChain *pChain, int nChainCountRead, uint64 nIndex, IndexChain *pIndex, int nIndexSize, int nIndexStart);
74 int BinarySearchOld(RainbowChainO* pChain, int nRainbowChainCount, uint64 nIndex);
75 void GetChainIndexRangeWithSameEndpoint(RainbowChainO* pChain,
76 int nRainbowChainCount,
80 void SearchTableChunk(RainbowChain* pChain, int nRainbowChainLen, int nRainbowChainCount, CHashSet& hs, IndexChain *pIndex, int nIndexSize, int nChainStart);
81 void SearchTableChunkOld(RainbowChainO* pChain, int nRainbowChainLen, int nRainbowChainCount, CHashSet& hs);
82 //bool CheckAlarm(RainbowChain* pChain, int nGuessedPos, unsigned char* pHash, CHashSet& hs);
83 //bool CheckAlarmOld(RainbowChainO* pChain, int nGuessedPos, unsigned char* pHash, CHashSet& hs);
86 void SearchRainbowTable(string sPathName, CHashSet& hs);
87 void Run(vector<string> vPathName, CHashSet& hs, int i_maxThreads, uint64 i_maxMem, bool resume, bool bDebug);
88 float GetStatTotalDiskAccessTime();
89 float GetStatTotalCryptanalysisTime();
90 float GetStatTotalPrecalculationTime();
91 int GetStatTotalChainWalkStep();
92 int GetStatTotalFalseAlarm();
93 int GetStatTotalChainWalkStepDueToFalseAlarm();
94 void setOutputFile(string sPathName);
95 void setSession(string sSessionPathName, string sProgressPathName, string sPrecalcPathName, bool keepPrecalc);