]> git.sesse.net Git - freerainbowtables/blobdiff - Client Applications/converti2/converti2.cpp
Merge branch 'master' of git@gitorious.org:freerainbowtables-applications/freerainbow...
[freerainbowtables] / Client Applications / converti2 / converti2.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 1d8d5e7..da728c3
@@ -1,7 +1,8 @@
 #include <string>
 #include <vector>
 #ifdef _WIN32
-#include <io.h>
+       #include <io.h>
+       #include <conio.h>
 #else
        #include <sys/types.h>
        #include <sys/stat.h>
@@ -13,7 +14,6 @@
 #include <time.h>
 #include <math.h>
 #include <vector>
-#include <conio.h>
 #include <sstream>
 #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
+}