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>
10 * This file is part of rcracki_mt.
12 * rcracki_mt is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 2 of the License, or
15 * (at your option) any later version.
17 * rcracki_mt is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.
26 #if defined(_WIN32) && !defined(__GNUC__)
27 #pragma warning(disable : 4786 4267 4018)
40 void CHashSet::AddHash(string sHash)
42 if (sHash == "aad3b435b51404ee")
46 for (i = 0; i < m_vHash.size(); i++)
48 if (m_vHash[i] == sHash)
52 //printf("debug: adding hash %s\n", sHash.c_str());
54 m_vHash.push_back(sHash);
55 m_vFound.push_back(false);
56 m_vPlain.push_back("");
57 m_vBinary.push_back("");
60 string CHashSet::GetHashInfo(int i)
68 string buffer = m_vHash[i] + ":" + found + ":" + m_vPlain[i] + ":" + m_vBinary[i];
73 bool CHashSet::AnyhashLeft()
76 for (i = 0; i < m_vHash.size(); i++)
85 bool CHashSet::AnyHashLeftWithLen(int nLen)
88 for (i = 0; i < m_vHash.size(); i++)
91 if (m_vHash[i].size() == (unsigned long)nLen * 2)
98 void CHashSet::GetLeftHashWithLen(vector<string>& vHash, int nLen)
103 for (i = 0; i < m_vHash.size(); i++)
106 if (m_vHash[i].size() == (unsigned long)nLen * 2)
107 vHash.push_back(m_vHash[i]);
111 void CHashSet::AddHashInfo(string sHash, bool found, string sPlain, string sBinary)
114 for (i = 0; i < m_vHash.size(); i++)
116 if (m_vHash[i] == sHash)
120 m_vHash.push_back(sHash);
121 m_vFound.push_back(found);
122 m_vPlain.push_back(sPlain);
123 m_vBinary.push_back(sBinary);
126 void CHashSet::SetPlain(string sHash, string sPlain, string sBinary)
129 for (i = 0; i < m_vHash.size(); i++)
131 if (m_vHash[i] == sHash)
134 m_vPlain[i] = sPlain;
135 m_vBinary[i] = sBinary;
141 bool CHashSet::GetPlain(string sHash, string& sPlain, string& sBinary)
143 if (sHash == "aad3b435b51404ee")
151 for (i = 0; i < m_vHash.size(); i++)
153 if (m_vHash[i] == sHash)
157 sPlain = m_vPlain[i];
158 sBinary = m_vBinary[i];
167 int CHashSet::GetStatHashFound()
171 for (i = 0; i < m_vHash.size(); i++)
180 int CHashSet::GetStatHashTotal()
182 return (int) m_vHash.size();