X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=Client%20Applications%2Frti2rto%2Frti2rto.cpp;h=e4ee4fc740cfd88cd60e7c0322a3f00252ad95a7;hb=12e9c3bd02b40f9c8d6d2f88166201abd59b01b1;hp=bf08be3a58a1909cf49b77c053e55f6f6897057d;hpb=bcfd4a8e2d07b3a0fce0bc8e471d8562b142b7e0;p=freerainbowtables diff --git a/Client Applications/rti2rto/rti2rto.cpp b/Client Applications/rti2rto/rti2rto.cpp index bf08be3..e4ee4fc 100644 --- a/Client Applications/rti2rto/rti2rto.cpp +++ b/Client Applications/rti2rto/rti2rto.cpp @@ -98,6 +98,7 @@ void ConvertRainbowTable(string sPathName, string sResultFileName, string sType) static CMemoryPool mp; unsigned int nAllocatedSize; BaseRTReader *reader = NULL; + if(sType == "RTI2") reader = (BaseRTReader*)new RTI2Reader(sFileName); else if(sType == "RTI") @@ -107,6 +108,7 @@ void ConvertRainbowTable(string sPathName, string sResultFileName, string sType) printf("Invalid table type '%s'", sType.c_str()); return ; } + RainbowChainCP* pChain = (RainbowChainCP*)mp.Allocate(reader->GetChainsLeft() * sizeof(RainbowChainCP), nAllocatedSize); if (pChain != NULL) { @@ -115,7 +117,7 @@ void ConvertRainbowTable(string sPathName, string sResultFileName, string sType) while(reader->GetChainsLeft() > 0) { reader->ReadChains(nChains, pChain); - for(int i = 0; i < nChains; i++) + for(UINT4 i = 0; i < nChains; i++) { fwrite(&pChain[i], 1, 16, fResult); } @@ -156,7 +158,7 @@ int main(int argc, char* argv[]) printf("no rainbow table found\n"); return 0; } - for (int i = 0; i < vPathName.size(); i++) + for (UINT4 i = 0; i < vPathName.size(); i++) { string sResultFile, sType; @@ -179,4 +181,4 @@ int main(int argc, char* argv[]) printf("\n"); } return 0; -} \ No newline at end of file +}