2 RainbowCrack - a general propose implementation of Philippe Oechslin's faster time-memory trade-off technique.
4 Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
8 #pragma warning(disable : 4786)
21 void CHashSet::AddHash(string sHash)
23 if (sHash == "aad3b435b51404ee")
27 for (i = 0; i < m_vHash.size(); i++)
29 if (m_vHash[i] == sHash)
33 //printf("debug: adding hash %s\n", sHash.c_str());
35 m_vHash.push_back(sHash);
36 m_vFound.push_back(false);
37 m_vPlain.push_back("");
38 m_vBinary.push_back("");
41 bool CHashSet::AnyhashLeft()
44 for (i = 0; i < m_vHash.size(); i++)
53 bool CHashSet::AnyHashLeftWithLen(int nLen)
56 for (i = 0; i < m_vHash.size(); i++)
59 if (m_vHash[i].size() == nLen * 2)
66 void CHashSet::GetLeftHashWithLen(vector<string>& vHash, int nLen)
71 for (i = 0; i < m_vHash.size(); i++)
74 if (m_vHash[i].size() == nLen * 2)
75 vHash.push_back(m_vHash[i]);
79 void CHashSet::SetPlain(string sHash, string sPlain, string sBinary)
82 for (i = 0; i < m_vHash.size(); i++)
84 if (m_vHash[i] == sHash)
88 m_vBinary[i] = sBinary;
94 bool CHashSet::GetPlain(string sHash, string& sPlain, string& sBinary)
96 if (sHash == "aad3b435b51404ee")
104 for (i = 0; i < m_vHash.size(); i++)
106 if (m_vHash[i] == sHash)
110 sPlain = m_vPlain[i];
111 sBinary = m_vBinary[i];
120 int CHashSet::GetStatHashFound()
124 for (i = 0; i < m_vHash.size(); i++)
133 int CHashSet::GetStatHashTotal()
135 return m_vHash.size();