]> git.sesse.net Git - freerainbowtables/blob - Client Applications/rcracki_mt/RTI2Reader.h
test
[freerainbowtables] / Client Applications / rcracki_mt / RTI2Reader.h
1 /*
2  * rcracki_mt is a multithreaded implementation and fork of the original 
3  * RainbowCrack
4  *
5  * Copyright 2010 Martin Westergaard Jørgensen <martinwj2005@gmail.com>
6  * Copyright 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
7  * Copyright 2010 James Nobis <frt@quelrod.net>
8  *
9  * This file is part of rcracki_mt.
10  *
11  * rcracki_mt 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  * rcracki_mt 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 rcracki_mt.  If not, see <http://www.gnu.org/licenses/>.
23  */
24
25 #ifndef __RTI2READER_H__
26 #define __RTI2READER_H__
27
28 #include "Public.h"
29 #include <string>
30
31 #if defined(_WIN32) && !defined(__GNUC__)
32         #include <io.h>
33 #endif
34
35 #include <vector>
36 #include "BaseRTReader.h"
37
38 using namespace std;
39
40 typedef struct 
41 {
42         char header[4];
43         unsigned char rti_startptlength, rti_endptlength, rti_cplength, rti_index_numchainslength;
44         uint64 prefixstart;
45         unsigned int *m_cppos;
46 } RTI2Header;
47
48 class RTI2Reader : BaseRTReader
49 {
50 private:
51         FILE *m_pFile;
52         UINT4 m_chainPosition;
53         unsigned char *m_pPos, *m_pChainPos;
54         static RTI2Header *m_pHeader;
55         unsigned char *m_pIndex;
56         UINT4 m_chainsizebytes;
57         UINT4 m_indexrowsizebytes;
58         
59
60 public:
61         RTI2Reader(string Filename);
62         ~RTI2Reader(void);
63         int ReadChains(unsigned int &numChains, RainbowChainO *pData);
64         unsigned int GetChainsLeft();
65         static RTI2Header *GetHeader() { return m_pHeader; }
66 };
67
68
69 #endif