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