X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=Client%20Applications%2Frti2rto%2Frti2rto.cpp;h=760a7f56a552b429bb583cf993dd138661f7631f;hb=47c71901e7a97c226c8f1df749e3606d43656f32;hp=e4ee4fc740cfd88cd60e7c0322a3f00252ad95a7;hpb=12e9c3bd02b40f9c8d6d2f88166201abd59b01b1;p=freerainbowtables diff --git a/Client Applications/rti2rto/rti2rto.cpp b/Client Applications/rti2rto/rti2rto.cpp index e4ee4fc..760a7f5 100644 --- a/Client Applications/rti2rto/rti2rto.cpp +++ b/Client Applications/rti2rto/rti2rto.cpp @@ -87,6 +87,7 @@ void ConvertRainbowTable(string sPathName, string sResultFileName, string sType) sFileName = sPathName.substr(nIndex + 1); else sFileName = sPathName; + // Info printf("%s:\n", sFileName.c_str()); FILE *fResult = fopen(sResultFileName.c_str(), "wb"); @@ -96,9 +97,8 @@ void ConvertRainbowTable(string sPathName, string sResultFileName, string sType) return; } static CMemoryPool mp; - unsigned int nAllocatedSize; + uint64 nAllocatedSize; BaseRTReader *reader = NULL; - if(sType == "RTI2") reader = (BaseRTReader*)new RTI2Reader(sFileName); else if(sType == "RTI") @@ -108,16 +108,28 @@ 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); + uint64 size = reader->GetChainsLeft() * sizeof(RainbowChain); +#ifdef _MEMORYDEBUG + printf("Starting allocation of %i bytes\n", size); +#endif + RainbowChain* pChain = (RainbowChain*)mp.Allocate(size, nAllocatedSize); +#ifdef _MEMORYDEBUG + printf("Finished. Got %i bytes\n", nAllocatedSize); +#endif if (pChain != NULL) { - nAllocatedSize = nAllocatedSize / sizeof(RainbowChainCP) * sizeof(RainbowChainCP); // Round to boundary - unsigned int nChains = nAllocatedSize / sizeof(RainbowChainCP); + nAllocatedSize = nAllocatedSize / sizeof(RainbowChain) * sizeof(RainbowChain); // Round to boundary + unsigned int nChains = nAllocatedSize / sizeof(RainbowChain); while(reader->GetChainsLeft() > 0) { +#ifdef _MEMORYDEBUG + printf("Grabbing %i chains from file\n", nChains); +#endif reader->ReadChains(nChains, pChain); - for(UINT4 i = 0; i < nChains; i++) +#ifdef _MEMORYDEBUG + printf("Recieved %i chains from file\n", nChains); +#endif + for(uint32 i = 0; i < nChains; i++) { fwrite(&pChain[i], 1, 16, fResult); } @@ -158,7 +170,7 @@ int main(int argc, char* argv[]) printf("no rainbow table found\n"); return 0; } - for (UINT4 i = 0; i < vPathName.size(); i++) + for (uint32 i = 0; i < vPathName.size(); i++) { string sResultFile, sType;