* Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
* Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>
* Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
- * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
+ * Copyright 2009, 2010, 2011 James Nobis <frt@quelrod.net>
* Copyright 2010 Yngve AAdlandsvik
*
- * This file is part of rcracki_mt.
+ * This file is part of freerainbowtables.
*
* freerainbowtables is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
int CChainWalkContext::m_nPlainLenMinTotal = 0;
int CChainWalkContext::m_nPlainLenMaxTotal = 0;
int CChainWalkContext::m_nHybridCharset = 0;
+bool CChainWalkContext::isOldRtFormat = false;
+bool CChainWalkContext::isRti2RtFormat = false;
vector<stCharset> CChainWalkContext::m_vCharset;
uint64 CChainWalkContext::m_nPlainSpaceUpToX[MAX_PLAIN_LEN + 1];
uint64 CChainWalkContext::m_nPlainSpaceTotal;
printf("%s is not a rainbow table\n", sPathName.c_str());
return false;
}
- /*
- if (sPathName.substr(sPathName.size() - 4) != ".rti")
+ if (sPathName.substr(sPathName.size() - 5) == ".rti2")
+ {
+ isRti2RtFormat = true;
+ }
+ else if (sPathName.substr(sPathName.size() - 4) == ".rti")
+ {
+ isOldRtFormat = false;
+ }
+ else if (sPathName.substr(sPathName.size() - 3) == ".rt")
+ {
+ isOldRtFormat = true;
+ }
+ else
{
printf("%s is not a rainbow table\n", sPathName.c_str());
return false;
}
-*/
+
// Parse
vector<string> vPart;
if (!SeperateString(sPathName, "___x_", vPart))
printf("hash routine: %s\n", m_sHashRoutineName.c_str());
printf("hash length: %d\n", m_nHashLen);
+ printf( "m_vCharset[0].m_nPlainCharSetLen: %d\n", m_vCharset[0].m_nPlainCharsetLen );
+ printf( "m_vCharset[1].m_nPlainCharSetLen: %d\n", m_vCharset[1].m_nPlainCharsetLen );
+
printf("plain charset: ");
unsigned int i;
+
for (i = 0; i < m_vCharset[0].m_nPlainCharsetLen; i++)
{
if (isprint(m_vCharset[0].m_PlainCharset[i]))
}
}
}
+
#elif defined(_M_X64) || defined(_M_IX86) || defined(__i386__) || defined(__x86_64__)
// Fast ia32 version
if (nIndexOfX < 0x100000000llu)
break;
#endif
+
int nCharsetLen = 0;
for(uint32 j = 0; j < m_vCharset.size(); j++)
{
}
m_Plain[i] = m_vCharset[j].m_PlainCharset[nTemp];
#else
- __asm__ __volatile__ ( "mov %2, %%eax;"
- "xor %%edx, %%edx;"
+ __asm__ __volatile__ ("xor %%edx, %%edx;"
"divl %3;"
- "mov %%eax, %0;"
- "mov %%edx, %1;"
- : "=m"(nIndexOfX32), "=m"(nTemp)
- : "m"(nIndexOfX32), "m"(m_vCharset[j].m_nPlainCharsetLen)
- : "%eax", "%edx"
- );
+ : "=a"(nIndexOfX32), "=d"(nTemp)
+ : "a"(nIndexOfX32), "rm"(m_vCharset[j].m_nPlainCharsetLen)
+ : );
m_Plain[i] = m_vCharset[j].m_PlainCharset[nTemp];
#endif
break;
{
return HexToStr(m_Plain, m_nPlainLen);
}
-/*
-string CChainWalkContext::GetPlainBinary()
-{
- string sRet;
- sRet += GetPlain();
- int i;
- for (i = 0; i < m_nPlainLenMax - m_nPlainLen; i++)
- sRet += ' ';
-
- sRet += "|";
- sRet += GetBinary();
- for (i = 0; i < m_nPlainLenMax - m_nPlainLen; i++)
- sRet += " ";
-
- return sRet;
-}
-*/
string CChainWalkContext::GetHash()
{
return HexToStr(m_Hash, m_nHashLen);
return false;
}
+
+bool CChainWalkContext::isOldFormat()
+{
+ return isOldRtFormat;
+}
+
+bool CChainWalkContext::isRti2Format()
+{
+ return isRti2RtFormat;
+}