2 * freerainbowtables is a project for generating, distributing, and using
3 * perfect rainbow tables
5 * Copyright 2010, 2011 Martin Westergaard Jørgensen <martinwj2005@gmail.com>
6 * Copyright 2010, 2011 James Nobis <frt@quelrod.net>
8 * This file is part of freerainbowtables.
10 * freerainbowtables is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 2 of the License, or
13 * (at your option) any later version.
15 * freerainbowtables is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with freerainbowtables. If not, see <http://www.gnu.org/licenses/>.
26 RTReader::RTReader(string Filename)
28 m_pFile = fopen(Filename.c_str(), "rb");
31 RTReader::~RTReader(void)
35 int RTReader::ReadChains(uint32 &numChains, RainbowChain *pData)
37 unsigned int numRead = fread(pData, 1, 16 * numChains, m_pFile);
38 numChains = numRead / 16;
39 m_chainPosition += numChains;
42 uint32 RTReader::GetChainsLeft()
44 return (GetFileLen(m_pFile) / 16) - m_chainPosition;