From: Martin Westergaard Date: Mon, 1 Nov 2010 18:38:05 +0000 (+0100) Subject: merged paths X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=3d42602c1f746b5768f0e6c9d22884a9806eadc0;hp=-c;p=freerainbowtables merged paths --- 3d42602c1f746b5768f0e6c9d22884a9806eadc0 diff --combined Client Applications/rcracki_mt/CrackEngine.cpp index 7640a63,8d3981e..0a4b181 --- a/Client Applications/rcracki_mt/CrackEngine.cpp +++ b/Client Applications/rcracki_mt/CrackEngine.cpp @@@ -1044,7 -1044,12 +1044,12 @@@ void CCrackEngine::SearchRainbowTable(s } static CMemoryPool mp(bytesForChainWalkSet, debug, maxMem); - RainbowChainO* pChain = (RainbowChainO*)mp.Allocate(nFileLen, nAllocatedSize); + RainbowChainO* pChain = NULL; + if(doRti2Format) { + pChain = (RainbowChainO*)mp.Allocate(pReader->GetChainsLeft() * 16, nAllocatedSize); + } else { + pChain = (RainbowChainO*)mp.Allocate(nFileLen, nAllocatedSize); + } #ifdef _WIN32 if (debug) printf("Allocated %I64u bytes, filelen %lu\n", nAllocatedSize, (unsigned long)nFileLen); #else @@@ -1064,13 -1069,14 +1069,15 @@@ // Load table chunk if (debug) printf("reading...\n"); - unsigned int nDataRead = 0, nDataToRead = 0; + unsigned int nDataRead = 0; gettimeofday( &tv, NULL ); if ( doRti2Format ) { - nDataToRead = nAllocatedSize / 16; - nDataRead = nDataToRead; - pReader->ReadChains(nDataRead, pChain); + nDataRead = nAllocatedSize / 16; + if(pReader->GetChainsLeft() <= 0) // No more data + break; + pReader->ReadChains(nDataRead, (RainbowChain*)pChain); ++ nDataRead *= 8; // Convert from chains read to bytes } else @@@ -1085,7 -1091,9 +1092,11 @@@ m_fTotalDiskAccessTime += fTime; int nRainbowChainCountRead = nDataRead / 16; + + if(doRti2Format) { + nRainbowChainCountRead = nDataRead / 8; + } ++ // Verify table chunk if (!fVerified) { @@@ -1136,13 -1144,6 +1147,6 @@@ // Already finished? if (!hs.AnyHashLeftWithLen(CChainWalkContext::GetHashLen())) break; - - // finished the current table - if( doRti2Format && nDataToRead > (nDataRead / 8) ) - { - delete pReader; - break; - } } } else