X-Git-Url: https://git.sesse.net/?p=freerainbowtables;a=blobdiff_plain;f=Client%20Applications%2Fconverti2%2Fconverti2.cpp;fp=Client%20Applications%2Fconverti2%2Fconverti2.cpp;h=da728c319c8d762f44d9b02834729ad6c7158375;hp=1d8d5e79619444325b3bea2cda1c423df42190a3;hb=86bbf0fd5ba4e07d3279b4179fd8fc808198eaae;hpb=3d42602c1f746b5768f0e6c9d22884a9806eadc0 diff --git a/Client Applications/converti2/converti2.cpp b/Client Applications/converti2/converti2.cpp old mode 100644 new mode 100755 index 1d8d5e7..da728c3 --- a/Client Applications/converti2/converti2.cpp +++ b/Client Applications/converti2/converti2.cpp @@ -1,7 +1,8 @@ #include #include #ifdef _WIN32 -#include + #include + #include #else #include #include @@ -13,7 +14,6 @@ #include #include #include -#include #include #include "Public.h" #include "MemoryPool.h" @@ -319,7 +319,7 @@ void ConvertRainbowTable(string sPathName, string sResultFileName, unsigned int static CMemoryPool mp; unsigned int nAllocatedSize; RainbowChain* pChain = (RainbowChain*)mp.Allocate(size, nAllocatedSize); - unsigned int chainrowsize = ceil((float)(rti_startptlength + rti_endptlength + rti_cplength) / 8) * 8 ; // The size in bits (in whole bytes) + uint32 chainrowsize = (uint32)ceil((float)(rti_startptlength + rti_endptlength + rti_cplength) / 8) * 8 ; // The size in bits (in whole bytes) unsigned int chainrowsizebytes = chainrowsize / 8; if (pChain != NULL) { @@ -333,7 +333,7 @@ void ConvertRainbowTable(string sPathName, string sResultFileName, unsigned int /* if (ftell(file) == nFileLen) break;*/ printf("%u chains left to read\n", chainsLeft); - int nReadThisRound; + //int nReadThisRound; clock_t t1 = clock(); printf("reading...\n"); #ifdef _MEMORYDEBUG @@ -348,7 +348,7 @@ void ConvertRainbowTable(string sPathName, string sResultFileName, unsigned int printf("reading time: %.2f s\n", fTime); printf("converting %i chains...\n", nChains); t1 = clock(); - for(int i = 0; i < nChains; i++) { + for(unsigned int i = 0; i < nChains; i++) { if(showDistribution == 1) { distribution[GetMaxBits(pChain[i].nIndexS)-1]++; } @@ -417,7 +417,7 @@ void ConvertRainbowTable(string sPathName, string sResultFileName, unsigned int // unsigned int m_rti_index_prefixlength = GetMaxBits(high.prefix); unsigned int m_rti_index_numchainslength = GetMaxBits(high.numchains); // unsigned int m_rti_index_indexlength = GetMaxBits(high.prefixstart); - unsigned int m_indexrowsize = ceil((float)(/*m_rti_index_indexlength + */m_rti_index_numchainslength) / 8) * 8; // The size in bits (in whole bytes) + uint32 m_indexrowsize = (uint32)ceil((float)(/*m_rti_index_indexlength + */m_rti_index_numchainslength) / 8) * 8; // The size in bits (in whole bytes) unsigned int m_indexrowsizebytes = m_indexrowsize / 8; FILE *pFileIndex = fopen(sResultFileName.append(".index").c_str(), "wb"); fwrite("RTI2", 1, 4, pFileIndex); @@ -438,7 +438,7 @@ void ConvertRainbowTable(string sPathName, string sResultFileName, unsigned int if(i == 0) { lastPrefix = indexes[0].prefix; } - unsigned int indexrow = 0; + //unsigned int indexrow = 0; // Checks how big a distance there is between the current and the next prefix. eg cur is 3 and next is 10 = 7. unsigned int diffSize = indexes[i].prefix - lastPrefix; if(i > 0 && diffSize > 1) { @@ -617,4 +617,4 @@ int main(int argc, char* argv[]) printf("\n"); } return 0; -} \ No newline at end of file +}