+++ /dev/null
-// This file is part of BOINC.
-// http://boinc.berkeley.edu
-// Copyright (C) 2008 University of California
-//
-// BOINC is free software; you can redistribute it and/or modify it
-// under the terms of the GNU Lesser General Public License
-// as published by the Free Software Foundation,
-// either version 3 of the License, or (at your option) any later version.
-//
-// BOINC is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-// See the GNU Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
-
-// Modified by Martin Westergaard for the chain check usage
-#ifdef _WIN32
-#include "boinc_win.h"
-#else
-#include "config.h"
-#include <cstdio>
-#include <cctype>
-#include <ctime>
-#include <cstring>
-#include <cstdlib>
-#include <csignal>
-#include <unistd.h>
-#endif
-
-#include <string>
-#include <fstream>
-
-#include "str_util.h"
-#include "util.h"
-#include "filesys.h"
-#include "boinc_api.h"
-#include "Public.h"
-// Rainbowcrack code
-#include "ChainWalkContext.h"
-#include "chain_checker.h"
-
-typedef unsigned int uint32;
-
-
-using std::string;
-
-int main(int argc, char **argv) {
- int retval;
- char output_path[512], chkpt_path[512];
- string sHashRoutineName, sCharsetName, sHash;
- uint32 nPlainLenMin, nPlainLenMax, nRainbowTableIndex;
- FILE* state, *infile, *outfile;
- retval = boinc_init();
- if (retval) {
- fprintf(stderr, "boinc_init returned %d\n", retval);
- exit(retval);
- }
-
- if(argc < 7)
- {
- std::cerr << "Not enough parameters";
- return -1;
- }
-
- // Initialize the args
- sHashRoutineName = argv[1];
- sCharsetName = argv[2];
- nPlainLenMin = atoi(argv[3]);
- nPlainLenMax = atoi(argv[4]);
- nRainbowTableIndex = atoi(argv[5]);
- sHash = argv[6];
-
-
- // Setup the ChainWalkContext
- if (!CChainWalkContext::SetHashRoutine(sHashRoutineName))
- {
- std::cerr << "hash routine " << sHashRoutineName << " not supported" << std::endl;
- return 1;
- }
-
- if (!CChainWalkContext::SetPlainCharset(sCharsetName, nPlainLenMin, nPlainLenMax))
- {
- std::cerr << "charset " << sCharsetName << " not supported" << std::endl;
- return 2;
- }
-
- if (!CChainWalkContext::SetRainbowTableIndex(nRainbowTableIndex))
- {
- std::cerr << "invalid rainbow table index " << nRainbowTableIndex << std::endl;
- return 3;
- }
-
-
- // Open the file containing the chains we have to check.
- boinc_resolve_filename("chains", output_path, sizeof(output_path));
- infile = boinc_fopen(output_path, "rb");
- if (infile == NULL)
- {
- std::cerr << "failed to open " << output_path << std::endl;
- return 4;
- }
-
- // Open the resulting file. This will *maybe* contain the password (if found)
- boinc_resolve_filename("result", output_path, sizeof(output_path));
- outfile = boinc_fopen(output_path, "wb");
- if (outfile == NULL)
- {
- std::cerr << "failed to create " << output_path << std::endl;
- return 5;
- }
-
- // Read the chains from the input file
- int len = GetFileLen(infile);
- int numchains = len / 12; // Each chain is 12 bytes. 8 bytes startpoint and 4 bytes for the guessed position
- fseek(infile, 0, SEEK_SET);
- ChainCheckChain *pChain = new ChainCheckChain[numchains];
- int totalread = 0, read;
- for(int i = 0; i < numchains; i++)
- {
- int read = fread(&pChain[i].nIndexS, sizeof(pChain[i].nIndexS), 1, infile);
- if(read != 1)
- {
- std::cerr << "Error reading chaincheck file" << std::endl;
- return 6;
- }
- read = fread(&pChain[i].nGuessedPos, sizeof(pChain[i].nGuessedPos), 1, infile);
- if(read != 1)
- {
- std::cerr << "Error reading chaincheck file" << std::endl;
- return 7;
- }
-
- }
- fclose(infile);
-
-
- // Start checking the chains for false alarms
- CChainWalkContext cwc;
- int found = 0;
- for(int i = 0; i < numchains; i++)
- {
- cwc.SetIndex(pChain[i].nIndexS);
- int nPos;
- for (nPos = 0; nPos < pChain[i].nGuessedPos; nPos++)
- {
- cwc.IndexToPlain();
- cwc.PlainToHash();
- cwc.HashToIndex(nPos);
- }
- cwc.IndexToPlain();
- cwc.PlainToHash();
- std::string sHashme = cwc.GetHash();
- // Check if this is a matching chain
- if(sHashme.compare(sHash) == 0)
- {
- fwrite(cwc.GetPlain().c_str(), 1, cwc.GetPlain().length(), outfile);
- std::cout << "Password is " << cwc.GetPlain() << std::endl;
- found = 1;
- break; // Password is found. Lets break out.
- }
- // This chain didn't contain the password, so we update the progress
- boinc_fraction_done((double)i / (double)numchains);
-
- }
- if(found == 0)
- fwrite("0x00", 4, 1, outfile);
- // Last step: Clean up
- fclose(outfile);
- boinc_fraction_done(1);
- boinc_finish(0);
-}
-
-#ifdef _WIN32
-int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR Args, int WinMode) {
- LPSTR command_line;
- char* argv[100];
- int argc;
-
- command_line = GetCommandLine();
- argc = parse_command_line( command_line, argv );
- return main(argc, argv);
-}
-#endif
-
-const char *BOINC_RCSID_33ac47a071 = "$Id: chain_checker.cpp 2008-11-28 Martin Westergaard $";
-
+++ /dev/null
-#include "boinc_api.h"
-
-struct UC_SHMEM {
- double update_time;
- double fraction_done;
- double cpu_time;
- BOINC_STATUS status;
- int countdown;
- // graphics app sets this to 5 repeatedly,
- // main program decrements it once/sec.
- // If it's zero, don't bother updating shmem
-};
+++ /dev/null
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chain_checker", "chain_checker.vcproj", "{74C09EAC-2EA2-4548-9B61-0FEE56147DFE}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {74C09EAC-2EA2-4548-9B61-0FEE56147DFE}.Debug|Win32.ActiveCfg = Debug|Win32
- {74C09EAC-2EA2-4548-9B61-0FEE56147DFE}.Debug|Win32.Build.0 = Debug|Win32
- {74C09EAC-2EA2-4548-9B61-0FEE56147DFE}.Release|Win32.ActiveCfg = Release|Win32
- {74C09EAC-2EA2-4548-9B61-0FEE56147DFE}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="chain_checker"
- ProjectGUID="{74C09EAC-2EA2-4548-9B61-0FEE56147DFE}"
- RootNamespace="chain_checker"
- Keyword="Win32Proj"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- WholeProgramOptimization="false"
- AdditionalIncludeDirectories="/boinc/lib;/boinc/api;"/boinc/zip";"/boinc/client/win";"/boinc/";../distrrtgen;../../rt api"
- PreprocessorDefinitions="WIN32;_DEBUG;_MT;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- EnableEnhancedInstructionSet="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="libcmtd.lib libcpmtd.lib kernel32.lib user32.lib ole32.lib delayimp.lib ..\lib_debug\libboinc_staticcrt.lib ..\lib_debug\libboincapi_staticcrt.lib c:/openssl/lib/libeay32.lib"
- LinkIncremental="2"
- IgnoreAllDefaultLibraries="true"
- GenerateDebugInformation="true"
- SubSystem="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="2"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="1"
- AdditionalIncludeDirectories="/boinc/lib;/boinc/api;"/boinc/zip";"/boinc/client/win";"/boinc/";../distrrtgen;../../rt api"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_MT"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="false"
- EnableEnhancedInstructionSet="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="odbc32.lib odbccp32.lib libcmt.lib libcpmt.lib ..\lib_release\libboinc_staticcrt.lib ..\lib_release\libboincapi_staticcrt.lib c:/openssl/lib/libeay32.lib"
- LinkIncremental="1"
- IgnoreAllDefaultLibraries="true"
- GenerateDebugInformation="true"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- RandomizedBaseAddress="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath=".\chain_checker.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\ChainWalkContext.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\des_enc.c"
- >
- </File>
- <File
- RelativePath="..\..\rt api\des_setkey.c"
- >
- </File>
- <File
- RelativePath="..\..\rt api\ecb_enc.c"
- >
- </File>
- <File
- RelativePath="..\..\rt api\HashAlgorithm.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\HashRoutine.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\md4.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\md5.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\Public.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath=".\chain_checker.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\ChainWalkContext.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\des.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\des_locl.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\HashAlgorithm.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\HashRoutine.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\md4.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\md5.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\podd.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\Public.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\sk.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\spr.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- </Filter>
- <File
- RelativePath=".\ReadMe.txt"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+++ /dev/null
-# charset configuration file for DistrRTgen v3.2 by Martin Westergaard (martinwj2005@gmail.com)
-
-byte = []
-alpha = [ABCDEFGHIJKLMNOPQRSTUVWXYZ]
-alpha-space = [ABCDEFGHIJKLMNOPQRSTUVWXYZ ]
-alpha-numeric = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]
-alpha-numeric-space = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ]
-alpha-numeric-symbol14 = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=]
-alpha-numeric-symbol14-space= [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+= ]
-all = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/]
-all-space = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/ ]
-alpha-numeric-symbol32-space = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/ ]
-lm-frt-cp437 = [ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`{|}~\80\8e\8f\90\92\99\9a\9b\9c\9d\9e\9f¥àáâãäæçèéêëî]
-lm-frt-cp850 = [ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`{|}~\80\8e\8f\90\92\99\9a\9c\9d\9f¥µ¶·½¾ÇÏÑÒÓÔÕÖ×ØÞàáâãåæèéêëíï]
-lm-frt-cp437-850 = [ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`{|}~\80\8e\8f\90\92\99\9a\9b\9c\9d\9e\9f¥µ¶·½¾ÇÏÑÒÓÔÕÖ×ØÞàáâãäåæçèéêëíîï]
-
-numeric = [0123456789]
-numeric-space = [0123456789 ]
-loweralpha = [abcdefghijklmnopqrstuvwxyz]
-loweralpha-space = [abcdefghijklmnopqrstuvwxyz ]
-loweralpha-numeric = [abcdefghijklmnopqrstuvwxyz0123456789]
-loweralpha-numeric-space = [abcdefghijklmnopqrstuvwxyz0123456789 ]
-loweralpha-numeric-symbol14 = [abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_+=]
-loweralpha-numeric-all = [abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/]
-loweralpha-numeric-symbol32-space= [abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/ ]
-
-mixalpha = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]
-mixalpha-space = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ]
-mixalpha-numeric = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]
-mixalpha-numeric-space = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ]
-mixalpha-numeric-symbol14 = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=]
-mixalpha-numeric-all = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/]
-mixalpha-numeric-symbol32-space = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/ ]
-mixalpha-numeric-all-space = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/ ]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+++ /dev/null
-mklink /H ChainWalkContext.cpp "../../../Common/rt api/ChainWalkContext.cpp"
-mklink /H ChainWalkContext.h "../../../Common/rt api/ChainWalkContext.h"
-mklink /H des.h "../../../Common/rt api/des.h"
-mklink /H des_enc.c "../../../Common/rt api/des_enc.c"
-mklink /H des_locl.h "../../../Common/rt api/des_locl.h"
-mklink /H des_setkey.c "../../../Common/rt api/des_setkey.c"
-mklink /H ecb_enc.c "../../../Common/rt api/ecb_enc.c"
-mklink /H global.h "../../../Common/rt api/global.h"
-mklink /H HashAlgorithm.h "../../../Common/rt api/HashAlgorithm.h"
-mklink /H HashAlgorithm.cpp "../../../Common/rt api/HashAlgorithm.cpp"
-mklink /H HashRoutine.cpp "../../../Common/rt api/HashRoutine.cpp"
-mklink /H HashRoutine.h "../../../Common/rt api/HashRoutine.h"
-mklink /H md4.cpp "../../../Common/rt api/md4.cpp"
-mklink /H md4.h "../../../Common/rt api/md4.h"
-mklink /H md5.cpp "../../../Common/rt api/md5.cpp"
-mklink /H md5.h "../../../Common/rt api/md5.h"
-mklink /H podd.h "../../../Common/rt api/podd.h"
-mklink /H Public.cpp "../../../Common/rt api/Public.cpp"
-mklink /H Public.h "../../../Common/rt api/Public.h"
-mklink /H sk.h "../../../Common/rt api/sk.h"
-mklink /H spr.h "../../../Common/rt api/spr.h"
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "distrrtgen", "distrrtgen.vcproj", "{A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}"
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "distrrtgen", "distrrtgen.vcxproj", "{A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "index_calculator", "..\index_calculator\index_calculator.vcproj", "{C7A957CF-9FDC-4C72-9C3E-7C029E915D1E}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "index_calculator", "..\index_calculator\index_calculator.vcxproj", "{C7A957CF-9FDC-4C72-9C3E-7C029E915D1E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rti2rto", "..\..\standalone\rti2rto\rti2rto.vcproj", "{E0FBC06A-C902-4468-A614-CBF9F591AA7C}"
EndProject
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rcracki", "..\..\standalone\rcracki\rcracki.vcproj", "{966DA4B4-E13C-449D-9A93-303C6FEA25C4}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chain_checker", "..\chain_checker\chain_checker.vcproj", "{74C09EAC-2EA2-4548-9B61-0FEE56147DFE}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chain_checker", "..\chain_checker\chain_checker.vcxproj", "{74C09EAC-2EA2-4548-9B61-0FEE56147DFE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>/boinc/lib;/boinc/api;/boinc/zip;/boinc/client/win;/boinc/;../../rt api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_MT;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>../../../common/rt api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>BOINC;WIN32;_DEBUG;_MT;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WholeProgramOptimization>true</WholeProgramOptimization>
- <AdditionalIncludeDirectories>C:\Users\mwj\git\Common\rt api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_MT;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\..\Common\rt api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>BOINC;WIN32;NDEBUG;_MT;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
- <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<BufferSecurityCheck>false</BufferSecurityCheck>
</ClCompile>
<Link>
- <AdditionalDependencies>odbc32.lib;odbccp32.lib;libcmt.lib;libcpmt.lib;libboinc_staticcrt.lib;libboincapi_staticcrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>odbc32.lib;odbccp32.lib;libcmt.lib;libcpmt.lib;C:\lib\boinc\Win32\Release\2010\libboinc_staticcrt.lib;C:\lib\boinc\Win32\Release\2010\libboincapi_staticcrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<ClInclude Include="..\..\..\Common\rt api\ChainWalkContext.h" />
<ClInclude Include="..\..\..\Common\rt api\des.h" />
<ClInclude Include="..\..\..\Common\rt api\des_locl.h" />
+ <ClInclude Include="..\..\..\Common\rt api\global.h" />
<ClInclude Include="distrrtgen.h" />
<ClInclude Include="..\..\..\Common\rt api\HashAlgorithm.h" />
<ClInclude Include="..\..\..\Common\rt api\HashRoutine.h" />
<ClInclude Include="..\..\..\Common\rt api\spr.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\..\Common\rt api\global.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
+++ /dev/null
-# This should work on Linux. Modify as needed for other platforms.
-
-BOINC_DIR = /home/frt/server_stable
-BOINC_API_DIR = $(BOINC_DIR)/api
-BOINC_LIB_DIR = $(BOINC_DIR)/lib
-
-CXXFLAGS = -g \
- -DAPP_GRAPHICS \
- -I$(BOINC_DIR) \
- -I$(BOINC_LIB_DIR) \
- -I$(BOINC_API_DIR) \
- -L$(BOINC_API_DIR) \
- -L$(BOINC_LIB_DIR) \
- -L /usr/X11R6/lib \
- -L.
-
-
-PROGS = distrrtgen \
-
-all: $(PROGS)
-
-libstdc++.a:
- ln -s `g++ -print-file-name=libstdc++.a`
-
-clean:
- /bin/rm -f $(PROGS) *.o
-
-distclean:
- /bin/rm -f $(PROGS) *.o libstdc++.a
-
-distrrtgen: distrrtgen.o libstdc++.a $(BOINC_API_DIR)/libboinc_api.a $(BOINC_LIB_DIR)/libboinc.a
- $(CXX) Public.cpp ChainWalkContext.cpp HashAlgorithm.cpp HashRoutine.cpp md5.cpp $(CXXFLAGS) -o distrrtgen distrrtgen.o libstdc++.a -pthread -lboinc_api -lboinc -lssl -O3
+++ /dev/null
-# charset configuration file for DistrRTgen v3.2 by Martin Westergaard (martinwj2005@gmail.com)
-
-byte = []
-alpha = [ABCDEFGHIJKLMNOPQRSTUVWXYZ]
-alpha-space = [ABCDEFGHIJKLMNOPQRSTUVWXYZ ]
-alpha-numeric = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]
-alpha-numeric-space = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ]
-alpha-numeric-symbol14 = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=]
-alpha-numeric-symbol14-space= [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+= ]
-all = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/]
-all-space = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/ ]
-alpha-numeric-symbol32-space = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/ ]
-lm-frt-cp437 = [ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`{|}~\80\8e\8f\90\92\99\9a\9b\9c\9d\9e\9f¥àáâãäæçèéêëî]
-lm-frt-cp850 = [ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`{|}~\80\8e\8f\90\92\99\9a\9c\9d\9f¥µ¶·½¾ÇÏÑÒÓÔÕÖ×ØÞàáâãåæèéêëíï]
-lm-frt-cp437-850 = [ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`{|}~\80\8e\8f\90\92\99\9a\9b\9c\9d\9e\9f¥µ¶·½¾ÇÏÑÒÓÔÕÖ×ØÞàáâãäåæçèéêëíîï]
-
-numeric = [0123456789]
-numeric-space = [0123456789 ]
-loweralpha = [abcdefghijklmnopqrstuvwxyz]
-loweralpha-space = [abcdefghijklmnopqrstuvwxyz ]
-loweralpha-numeric = [abcdefghijklmnopqrstuvwxyz0123456789]
-loweralpha-numeric-space = [abcdefghijklmnopqrstuvwxyz0123456789 ]
-loweralpha-numeric-symbol14 = [abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_+=]
-loweralpha-numeric-all = [abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/]
-loweralpha-numeric-symbol32-space= [abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/ ]
-
-mixalpha = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]
-mixalpha-space = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ]
-mixalpha-numeric = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]
-mixalpha-numeric-space = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ]
-mixalpha-numeric-symbol14 = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=]
-mixalpha-numeric-all = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/]
-mixalpha-numeric-symbol32-space = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/ ]
-mixalpha-numeric-all-space = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/ ]
+++ /dev/null
-// This file is part of BOINC.
-// http://boinc.berkeley.edu
-// Copyright (C) 2008 University of California
-//
-// BOINC is free software; you can redistribute it and/or modify it
-// under the terms of the GNU Lesser General Public License
-// as published by the Free Software Foundation,
-// either version 3 of the License, or (at your option) any later version.
-//
-// BOINC is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-// See the GNU Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
-
-// This program serves as both
-// - An example BOINC application, illustrating the use of the BOINC API
-// - A program for testing various features of BOINC
-//
-// NOTE: this file exists as both
-// boinc/apps/upper_case.C
-// and
-// boinc_samples/example_app/uc2.C
-// If you update one, please update the other!
-
-// The program converts a mixed-case file to upper case:
-// read "in", convert to upper case, write to "out"
-//
-// command line options
-// -run_slow: sleep 1 second after each character
-// -cpu_time N: use about N CPU seconds after copying files
-// -early_exit: exit(10) after 30 chars
-// -early_crash: crash after 30 chars
-//
-
-#ifdef _WIN32
-
-#else
-#include <cstdio>
-#include <cctype>
-#include <ctime>
-#include <cstring>
-#include <cstdlib>
-#include <csignal>
-#include <unistd.h>
-#endif
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <time.h>
-#include "Public.h"
-// Rainbowcrack code
-#include "ChainWalkContext.h"
-typedef unsigned int uint32;
-//typedef unsigned __int64 uint64;
-
-
-using std::string;
-
-/*
-bool early_exit = false;
-bool early_crash = false;
-bool early_sleep = false;
-double cpu_time = 20, comp_result;
-*/
-int main(int argc, char **argv) {
- int retval;
- double fd;
-
-
- if(argc < 10)
- {
- fprintf(stderr, "Not enough parameters");
- return -1;
- }
- string sHashRoutineName, sCharsetName, sSalt, sCheckPoints;
- uint32 nRainbowChainCount, nPlainLenMin, nPlainLenMax, nRainbowTableIndex, nRainbowChainLen;
- uint64 nChainStart;
- sHashRoutineName = argv[1];
- sCharsetName = argv[2];
- nPlainLenMin = atoi(argv[3]);
- nPlainLenMax = atoi(argv[4]);
- nRainbowTableIndex = atoi(argv[5]);
- nRainbowChainLen = atoi(argv[6]);
- nRainbowChainCount = atoi(argv[7]);
-#ifdef _WIN32
-
- nChainStart = _atoi64(argv[8]);
-
-#else
- nChainStart = atoll(argv[8]);
-#endif
- sCheckPoints = argv[9];
- vector<int> vCPPositions;
- char *cp = strtok((char *)sCheckPoints.c_str(), ",");
- while(cp != NULL)
- {
- vCPPositions.push_back(atoi(cp));
- cp = strtok(NULL, ",");
- }
- if(argc == 11)
- {
- sSalt = argv[10];
- }
- //std::cout << "Starting ChainGenerator" << std::endl;
- // Setup CChainWalkContext
- //std::cout << "ChainGenerator started." << std::endl;
-
- if (!CChainWalkContext::SetHashRoutine(sHashRoutineName))
- {
- fprintf(stderr, "hash routine %s not supported\n", sHashRoutineName.c_str());
- return 1;
- }
- //std::cout << "Hash routine validated" << std::endl;
-
- if (!CChainWalkContext::SetPlainCharset(sCharsetName, nPlainLenMin, nPlainLenMax))
- {
- std::cerr << "charset " << sCharsetName << " not supported" << std::endl;
- return 2;
- }
- //std::cout << "Plain charset validated" << std::endl;
-
- if (!CChainWalkContext::SetRainbowTableIndex(nRainbowTableIndex))
- {
- std::cerr << "invalid rainbow table index " << nRainbowTableIndex << std::endl;
- return 3;
- }
- //std::cout << "Rainbowtable index validated" << std::endl;
-
- if(sHashRoutineName == "mscache")// || sHashRoutineName == "lmchall" || sHashRoutineName == "halflmchall")
- {
- // Convert username to unicode
- const char *szSalt = sSalt.c_str();
- int salt_length = strlen(szSalt);
- unsigned char cur_salt[256];
- for (int i=0; i<salt_length; i++)
- {
- cur_salt[i*2] = szSalt[i];
- cur_salt[i*2+1] = 0x00;
- }
- CChainWalkContext::SetSalt(cur_salt, salt_length*2);
- }
- else if(sHashRoutineName == "halflmchall")
- { // The salt is hardcoded into the hash routine
- // CChainWalkContext::SetSalt((unsigned char*)&salt, 8);
- }
- else if(sHashRoutineName == "oracle")
- {
- CChainWalkContext::SetSalt((unsigned char *)sSalt.c_str(), sSalt.length());
- }
- //std::cout << "Opening chain file" << std::endl;
-
-
-
- // Check existing chains
- size_t nReturn;
- CChainWalkContext cwc;
- uint64 nIndex[2];
- time_t tStart = time(NULL);
-// std::cout << "Starting to generate chains" << std::endl;
- for(int nCurrentCalculatedChains = 0; nCurrentCalculatedChains < nRainbowChainCount; nCurrentCalculatedChains++)
- {
- int cpcheck = 0;
- unsigned short checkpoint = 0;
- fd = (double)nCurrentCalculatedChains / (double)nRainbowChainCount;
- cwc.SetIndex(nChainStart++); // use a given index now!
- nIndex[0] = cwc.GetIndex();
-
- for (int nPos = 0; nPos < nRainbowChainLen - 1; nPos++)
- {
- // std::cout << "IndexToPlain()" << std::endl;
- cwc.IndexToPlain();
- // std::cout << "PlainToHash()" << std::endl;
- cwc.PlainToHash();
- // std::cout << "HashToIndex()" << std::endl;
- cwc.HashToIndex(nPos);
- if(cpcheck < vCPPositions.size() && nPos == vCPPositions[cpcheck])
- {
-
- checkpoint |= (1 << cpcheck) & (unsigned short)cwc.GetIndex() << cpcheck;
- cpcheck++;
- }
- }
- //std::cout << "GetIndex()" << std::endl;
-
- nIndex[1] = cwc.GetIndex();
- // Write chain to disk
- }
- //std::cout << "Generation completed" << std::endl;
-
-
- // main loop - read characters, convert to UC, write
- //
-
-}
-
+++ /dev/null
-// This file is part of BOINC.
-// http://boinc.berkeley.edu
-// Copyright (C) 2008 University of California
-//
-// BOINC is free software; you can redistribute it and/or modify it
-// under the terms of the GNU Lesser General Public License
-// as published by the Free Software Foundation,
-// either version 3 of the License, or (at your option) any later version.
-//
-// BOINC is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-// See the GNU Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
-
-#include "boinc_api.h"
-
-struct UC_SHMEM {
- double update_time;
- double fraction_done;
- double cpu_time;
- BOINC_STATUS status;
- int countdown;
- // graphics app sets this to 5 repeatedly,
- // main program decrements it once/sec.
- // If it's zero, don't bother updating shmem
-};
+++ /dev/null
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "distrrtgen", "distrrtgen.vcproj", "{A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "index_calculator", "..\index_calculator\index_calculator.vcproj", "{C7A957CF-9FDC-4C72-9C3E-7C029E915D1E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rti2rto", "..\..\standalone\rti2rto\rti2rto.vcproj", "{E0FBC06A-C902-4468-A614-CBF9F591AA7C}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "convertrti2", "..\..\standalone\converti2\converti2.vcproj", "{066FD6F1-5990-47AD-B095-7AE0029CF5AE}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rsearch", "..\..\standalone\rsearch\rsearch.vcproj", "{40F12861-0A31-4E0E-8324-24F897271C8E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rtperfectp", "..\..\standalone\rtperfectp\rtperfectp.vcproj", "{9725038C-A07B-40DD-87CD-3A119021A244}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rcracki", "..\..\standalone\rcracki\rcracki.vcproj", "{966DA4B4-E13C-449D-9A93-303C6FEA25C4}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chain_checker", "..\chain_checker\chain_checker.vcproj", "{74C09EAC-2EA2-4548-9B61-0FEE56147DFE}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}.Debug|Win32.ActiveCfg = Debug|Win32
- {A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}.Debug|Win32.Build.0 = Debug|Win32
- {A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}.Release|Win32.ActiveCfg = Release|Win32
- {A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}.Release|Win32.Build.0 = Release|Win32
- {C7A957CF-9FDC-4C72-9C3E-7C029E915D1E}.Debug|Win32.ActiveCfg = Debug|Win32
- {C7A957CF-9FDC-4C72-9C3E-7C029E915D1E}.Debug|Win32.Build.0 = Debug|Win32
- {C7A957CF-9FDC-4C72-9C3E-7C029E915D1E}.Release|Win32.ActiveCfg = Release|Win32
- {C7A957CF-9FDC-4C72-9C3E-7C029E915D1E}.Release|Win32.Build.0 = Release|Win32
- {E0FBC06A-C902-4468-A614-CBF9F591AA7C}.Debug|Win32.ActiveCfg = Debug|Win32
- {E0FBC06A-C902-4468-A614-CBF9F591AA7C}.Debug|Win32.Build.0 = Debug|Win32
- {E0FBC06A-C902-4468-A614-CBF9F591AA7C}.Release|Win32.ActiveCfg = Release|Win32
- {E0FBC06A-C902-4468-A614-CBF9F591AA7C}.Release|Win32.Build.0 = Release|Win32
- {066FD6F1-5990-47AD-B095-7AE0029CF5AE}.Debug|Win32.ActiveCfg = Debug|Win32
- {066FD6F1-5990-47AD-B095-7AE0029CF5AE}.Debug|Win32.Build.0 = Debug|Win32
- {066FD6F1-5990-47AD-B095-7AE0029CF5AE}.Release|Win32.ActiveCfg = Release|Win32
- {066FD6F1-5990-47AD-B095-7AE0029CF5AE}.Release|Win32.Build.0 = Release|Win32
- {40F12861-0A31-4E0E-8324-24F897271C8E}.Debug|Win32.ActiveCfg = Debug|Win32
- {40F12861-0A31-4E0E-8324-24F897271C8E}.Debug|Win32.Build.0 = Debug|Win32
- {40F12861-0A31-4E0E-8324-24F897271C8E}.Release|Win32.ActiveCfg = Release|Win32
- {40F12861-0A31-4E0E-8324-24F897271C8E}.Release|Win32.Build.0 = Release|Win32
- {9725038C-A07B-40DD-87CD-3A119021A244}.Debug|Win32.ActiveCfg = Debug|Win32
- {9725038C-A07B-40DD-87CD-3A119021A244}.Debug|Win32.Build.0 = Debug|Win32
- {9725038C-A07B-40DD-87CD-3A119021A244}.Release|Win32.ActiveCfg = Release|Win32
- {9725038C-A07B-40DD-87CD-3A119021A244}.Release|Win32.Build.0 = Release|Win32
- {966DA4B4-E13C-449D-9A93-303C6FEA25C4}.Debug|Win32.ActiveCfg = Debug|Win32
- {966DA4B4-E13C-449D-9A93-303C6FEA25C4}.Debug|Win32.Build.0 = Debug|Win32
- {966DA4B4-E13C-449D-9A93-303C6FEA25C4}.Release|Win32.ActiveCfg = Release|Win32
- {966DA4B4-E13C-449D-9A93-303C6FEA25C4}.Release|Win32.Build.0 = Release|Win32
- {74C09EAC-2EA2-4548-9B61-0FEE56147DFE}.Debug|Win32.ActiveCfg = Debug|Win32
- {74C09EAC-2EA2-4548-9B61-0FEE56147DFE}.Debug|Win32.Build.0 = Debug|Win32
- {74C09EAC-2EA2-4548-9B61-0FEE56147DFE}.Release|Win32.ActiveCfg = Release|Win32
- {74C09EAC-2EA2-4548-9B61-0FEE56147DFE}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="distrrtgen"
- ProjectGUID="{A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}"
- RootNamespace="distrrtgen"
- Keyword="Win32Proj"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="0"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../../Common/rt api"
- PreprocessorDefinitions="WIN32;_DEBUG;_MT;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="libcmtd.lib libcpmtd.lib kernel32.lib user32.lib ole32.lib delayimp.lib "
- LinkIncremental="0"
- IgnoreAllDefaultLibraries="true"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="0"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="1"
- WholeProgramOptimization="true"
- AdditionalIncludeDirectories="/boinc/lib;/boinc/api;/boinc/zip;/boinc/client/win;/boinc/;"C:\Users\mwj\git\Common\rt api""
- PreprocessorDefinitions="WIN32;NDEBUG;_MT;_CONSOLE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="true"
- EnableEnhancedInstructionSet="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="odbc32.lib odbccp32.lib libcmt.lib libcpmt.lib ..\lib_release\libboinc_staticcrt.lib ..\lib_release\libboincapi_staticcrt.lib"
- LinkIncremental="0"
- IgnoreAllDefaultLibraries="true"
- GenerateDebugInformation="true"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\..\Common\rt api\ChainWalkContext.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\des_enc.c"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\des_setkey.c"
- >
- </File>
- <File
- RelativePath=".\distrrtgen.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\ecb_enc.c"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\HashAlgorithm.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\HashRoutine.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\md4.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\md5.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\Public.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\..\Common\rt api\ChainWalkContext.h"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\des.h"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\des_locl.h"
- >
- </File>
- <File
- RelativePath=".\distrrtgen.h"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\HashAlgorithm.h"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\HashRoutine.h"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\md4.h"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\md5.h"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\podd.h"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\Public.h"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\sk.h"
- >
- </File>
- <File
- RelativePath="..\..\..\Common\rt api\spr.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioUserFile
- ProjectType="Visual C++"
- Version="9,00"
- ShowAllFiles="false"
- >
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- >
- <DebugSettings
- Command="$(TargetPath)"
- WorkingDirectory=""
- CommandArguments=""
- Attach="false"
- DebuggerType="3"
- Remote="1"
- RemoteMachine="MWJ-PC"
- RemoteCommand=""
- HttpUrl=""
- PDBPath=""
- SQLDebugging=""
- Environment=""
- EnvironmentMerge="true"
- DebuggerFlavor=""
- MPIRunCommand=""
- MPIRunArguments=""
- MPIRunWorkingDirectory=""
- ApplicationCommand=""
- ApplicationArguments=""
- ShimCommand=""
- MPIAcceptMode=""
- MPIAcceptFilter=""
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- >
- <DebugSettings
- Command="$(TargetPath)"
- WorkingDirectory=""
- CommandArguments=""
- Attach="false"
- DebuggerType="3"
- Remote="1"
- RemoteMachine="MWJ-PC"
- RemoteCommand=""
- HttpUrl=""
- PDBPath=""
- SQLDebugging=""
- Environment=""
- EnvironmentMerge="true"
- DebuggerFlavor=""
- MPIRunCommand=""
- MPIRunArguments=""
- MPIRunWorkingDirectory=""
- ApplicationCommand=""
- ApplicationArguments=""
- ShimCommand=""
- MPIAcceptMode=""
- MPIAcceptFilter=""
- />
- </Configuration>
- </Configurations>
-</VisualStudioUserFile>
+++ /dev/null
-# charset configuration file for DistrRTgen v3.2 by Martin Westergaard (martinwj2005@gmail.com)
-
-byte = []
-alpha = [ABCDEFGHIJKLMNOPQRSTUVWXYZ]
-alpha-space = [ABCDEFGHIJKLMNOPQRSTUVWXYZ ]
-alpha-numeric = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]
-alpha-numeric-space = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ]
-alpha-numeric-symbol14 = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=]
-alpha-numeric-symbol14-space= [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+= ]
-all = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/]
-all-space = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/ ]
-alpha-numeric-symbol32-space = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/ ]
-lm-frt-cp437 = [ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`{|}~\80\8e\8f\90\92\99\9a\9b\9c\9d\9e\9f¥àáâãäæçèéêëî]
-lm-frt-cp850 = [ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`{|}~\80\8e\8f\90\92\99\9a\9c\9d\9f¥µ¶·½¾ÇÏÑÒÓÔÕÖ×ØÞàáâãåæèéêëíï]
-lm-frt-cp437-850 = [ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`{|}~\80\8e\8f\90\92\99\9a\9b\9c\9d\9e\9f¥µ¶·½¾ÇÏÑÒÓÔÕÖ×ØÞàáâãäåæçèéêëíîï]
-
-numeric = [0123456789]
-numeric-space = [0123456789 ]
-loweralpha = [abcdefghijklmnopqrstuvwxyz]
-loweralpha-space = [abcdefghijklmnopqrstuvwxyz ]
-loweralpha-numeric = [abcdefghijklmnopqrstuvwxyz0123456789]
-loweralpha-numeric-space = [abcdefghijklmnopqrstuvwxyz0123456789 ]
-loweralpha-numeric-symbol14 = [abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_+=]
-loweralpha-numeric-all = [abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/]
-loweralpha-numeric-symbol32-space= [abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/ ]
-
-mixalpha = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]
-mixalpha-space = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ]
-mixalpha-numeric = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]
-mixalpha-numeric-space = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ]
-mixalpha-numeric-symbol14 = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=]
-mixalpha-numeric-all = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/]
-mixalpha-numeric-symbol32-space = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/ ]
-mixalpha-numeric-all-space = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/ ]
+++ /dev/null
-// This file is part of BOINC.
-// http://boinc.berkeley.edu
-// Copyright (C) 2008 University of California
-//
-// BOINC is free software; you can redistribute it and/or modify it
-// under the terms of the GNU Lesser General Public License
-// as published by the Free Software Foundation,
-// either version 3 of the License, or (at your option) any later version.
-//
-// BOINC is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-// See the GNU Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
-
-
-#ifdef _WIN32
-#include "boinc_win.h"
-#else
-#include "config.h"
-#include <cstdio>
-#include <cctype>
-#include <ctime>
-#include <cstring>
-#include <cstdlib>
-#include <csignal>
-#include <unistd.h>
-#endif
-
-#include <string>
-#include <fstream>
-
-#include "str_util.h"
-#include "util.h"
-#include "filesys.h"
-#include "boinc_api.h"
-#include "Public.h"
-// Rainbowcrack code
-#include "ChainWalkSet.h"
-#include "ChainWalkContext.h"
-typedef unsigned int uint32;
-//typedef unsigned __int64 uint64;
-
-
-using std::string;
-
-int main(int argc, char **argv) {
- int i;
- int c, nchars = 0, retval, n;
- double fsize, fd;
- char output_path[512], chkpt_path[512];
- FILE* state, *infile;
- retval = boinc_init();
- if (retval) {
- fprintf(stderr, "boinc_init returned %d\n", retval);
- exit(retval);
- }
-
-
- // get size of input file (used to compute fraction done)
- //
- //file_size(input_path, fsize);
-
- // See if there's a valid checkpoint file.
- // If so seek input file and truncate output file
- //
-
-
- if(argc < 8)
- {
- std::cerr << "Not enough parameters";
- return -1;
- }
- string sHashRoutineName, sCharsetName, sHash;
- uint32 nRainbowChainCount, nPlainLenMin, nPlainLenMax, nRainbowTableIndex, nRainbowChainLen;
- uint64 nChainStart;
- sHashRoutineName = argv[1];
- sCharsetName = argv[2];
- nPlainLenMin = atoi(argv[3]);
- nPlainLenMax = atoi(argv[4]);
- nRainbowTableIndex = atoi(argv[5]);
- nRainbowChainLen = atoi(argv[6]);
- sHash = argv[7];
- //std::cout << "Starting ChainGenerator" << std::endl;
- // Setup CChainWalkContext
- //std::cout << "ChainGenerator started." << std::endl;
-
- if (!CChainWalkContext::SetHashRoutine(sHashRoutineName))
- {
- std::cerr << "hash routine " << sHashRoutineName << " not supported" << std::endl;
- return 1;
- }
- //std::cout << "Hash routine validated" << std::endl;
-
- if (!CChainWalkContext::SetPlainCharset(sCharsetName, nPlainLenMin, nPlainLenMax))
- {
- std::cerr << "charset " << sCharsetName << " not supported" << std::endl;
- return 2;
- }
- //std::cout << "Plain charset validated" << std::endl;
-
- if (!CChainWalkContext::SetRainbowTableIndex(nRainbowTableIndex))
- {
- std::cerr << "invalid rainbow table index " << nRainbowTableIndex << std::endl;
- return 3;
- }
- //std::cout << "Rainbowtable index validated" << std::endl;
-/*
- if(sHashRoutineName == "mscache")// || sHashRoutineName == "lmchall" || sHashRoutineName == "halflmchall")
- {
- // Convert username to unicode
- const char *szSalt = sSalt.c_str();
- int salt_length = strlen(szSalt);
- unsigned char cur_salt[256];
- for (int i=0; i<salt_length; i++)
- {
- cur_salt[i*2] = szSalt[i];
- cur_salt[i*2+1] = 0x00;
- }
- CChainWalkContext::SetSalt(cur_salt, salt_length*2);
- }*/
- else if(sHashRoutineName == "halflmchall")
- { // The salt is hardcoded into the hash routine
- // CChainWalkContext::SetSalt((unsigned char*)&salt, 8);
- }
- /*
- else if(sHashRoutineName == "oracle")
- {
- CChainWalkContext::SetSalt((unsigned char *)sSalt.c_str(), sSalt.length());
- }
- */
- //std::cout << "Opening chain file" << std::endl;
-
-
- // Open file
- boinc_resolve_filename("result", output_path, sizeof(output_path));
- FILE *outfile = boinc_fopen(output_path, "wb");
-
- if (outfile == NULL)
- {
- std::cerr << "failed to create " << output_path << std::endl;
- return 4;
- }
- unsigned char TargetHash[255];
- int nHashLen = 0;
- ParseHash(sHash, TargetHash, nHashLen);
- CChainWalkSet m_cws;
- CChainWalkContext cwc;
-
- bool fNewlyGenerated;
- uint64* pStartPosIndexE = m_cws.RequestWalk(TargetHash,
- nHashLen,
- sHashRoutineName,
- sCharsetName,
- nPlainLenMin,
- nPlainLenMax,
- nRainbowTableIndex,
- nRainbowChainLen,
- fNewlyGenerated);
- int nPos;
- double nTargetChains = pow((double)nRainbowChainLen - 2, 2) / 2 - (nRainbowChainLen - 2);
- if (fNewlyGenerated)
- {
- time_t tStart = time(NULL);
- for (nPos = nRainbowChainLen - 2; nPos >= 0; nPos--)
- {
- if(time(NULL) - tStart > 1)
- {
- time(&tStart);
- double nCurrentChains = pow(((double)nRainbowChainLen - 2 - (double)nPos), 2) / 2 - (nRainbowChainLen - 2);
- double fResult = ((double)((double)(nCurrentChains) / nTargetChains));
- if(fResult < 0)
- fResult = 0;
- boinc_fraction_done(fResult);
- }
-
- cwc.SetHash(TargetHash);
- cwc.HashToIndex(nPos);
- int i;
- for (i = nPos + 1; i <= nRainbowChainLen - 2; i++)
- {
- cwc.IndexToPlain();
- cwc.PlainToHash();
- cwc.HashToIndex(i);
- }
- uint64 index = cwc.GetIndex();
- if(fwrite(&index, 8, 1, outfile) != 1)
- {
- fprintf(stderr, "unable to write to outfile");
- return 9;
- }
- //nChainWalkStep += nRainbowChainLen - 2 - nPos;
- }
-// printf("ok\n");
- double nCurrentChains = pow(((double)nRainbowChainLen - 2 - (double)nPos), 2) / 2 - (nRainbowChainLen - 2);
- double fResult = ((double)((double)(nCurrentChains) / nTargetChains));
- boinc_fraction_done(fResult);
- }
-
-
- fclose(outfile);
-
- // main loop - read characters, convert to UC, write
- //
-
- boinc_fraction_done(1);
- boinc_finish(0);
-}
-
-#ifdef _WIN32
-int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR Args, int WinMode) {
- LPSTR command_line;
- char* argv[100];
- int argc;
-
- command_line = GetCommandLine();
- argc = parse_command_line( command_line, argv );
- return main(argc, argv);
-}
-#endif
-
-const char *BOINC_RCSID_33ac47a071 = "$Id: upper_case.C 12135 2007-02-21 20:04:14Z davea $";
-
+++ /dev/null
-// This file is part of BOINC.
-// http://boinc.berkeley.edu
-// Copyright (C) 2008 University of California
-//
-// BOINC is free software; you can redistribute it and/or modify it
-// under the terms of the GNU Lesser General Public License
-// as published by the Free Software Foundation,
-// either version 3 of the License, or (at your option) any later version.
-//
-// BOINC is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-// See the GNU Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
-
-#include "boinc_api.h"
-
-struct UC_SHMEM {
- double update_time;
- double fraction_done;
- double cpu_time;
- BOINC_STATUS status;
- int countdown;
- // graphics app sets this to 5 repeatedly,
- // main program decrements it once/sec.
- // If it's zero, don't bother updating shmem
-};
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="index_calculator"
- ProjectGUID="{C7A957CF-9FDC-4C72-9C3E-7C029E915D1E}"
- RootNamespace="index_calculator"
- Keyword="Win32Proj"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="/boinc/lib;/boinc/api;"/boinc/zip";"/boinc/client/win";"/boinc/";../distrrtgen;"../../rt api""
- PreprocessorDefinitions="WIN32;_DEBUG;_MT;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="libcmtd.lib libcpmtd.lib kernel32.lib user32.lib ole32.lib delayimp.lib ..\lib_debug\libboinc_staticcrt.lib ..\lib_debug\libboincapi_staticcrt.lib c:/openssl/lib/libeay32.lib"
- LinkIncremental="0"
- IgnoreAllDefaultLibraries="true"
- GenerateDebugInformation="true"
- SubSystem="2"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="2"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="1"
- WholeProgramOptimization="true"
- AdditionalIncludeDirectories="/boinc/lib;/boinc/api;"/boinc/zip";"/boinc/client/win";"/boinc/";../distrrtgen;"../../rt api""
- PreprocessorDefinitions="WIN32;NDEBUG;_MT;_CONSOLE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="true"
- EnableEnhancedInstructionSet="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="odbc32.lib odbccp32.lib libcmt.lib libcpmt.lib ..\lib_release\libboinc_staticcrt.lib ..\lib_release\libboincapi_staticcrt.lib c:/openssl/lib/libeay32.lib"
- LinkIncremental="1"
- IgnoreAllDefaultLibraries="true"
- GenerateDebugInformation="true"
- SubSystem="2"
- OptimizeReferences="0"
- EnableCOMDATFolding="0"
- LinkTimeCodeGeneration="0"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\rt api\ChainWalkContext.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\ChainWalkSet.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\des_enc.c"
- >
- </File>
- <File
- RelativePath="..\..\rt api\des_setkey.c"
- >
- </File>
- <File
- RelativePath="..\..\rt api\ecb_enc.c"
- >
- </File>
- <File
- RelativePath="..\..\rt api\HashAlgorithm.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\HashRoutine.cpp"
- >
- </File>
- <File
- RelativePath=".\index_calculator.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\md4.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\md5.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\Public.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\rt api\ChainWalkContext.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\ChainWalkSet.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\des.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\des_locl.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\HashAlgorithm.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\HashRoutine.h"
- >
- </File>
- <File
- RelativePath=".\index_calculator.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\md4.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\md5.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\podd.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\Public.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\sk.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\spr.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
--- /dev/null
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "distrrtgen", "..\distrrtgen\distrrtgen.vcxproj", "{A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}.Debug|Win32.Build.0 = Debug|Win32
+ {A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}.Debug|x64.ActiveCfg = Debug|x64
+ {A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}.Debug|x64.Build.0 = Debug|x64
+ {A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}.Release|Win32.ActiveCfg = Release|Win32
+ {A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}.Release|Win32.Build.0 = Release|Win32
+ {A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}.Release|x64.ActiveCfg = Release|x64
+ {A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
OPTIMIZATION = -O3
INCLUDES = -I../../Common/rt\ api
# XXX todo currently only 32-bit targets work
-CFLAGS = -Wall -m32 -ansi $(INCLUDES) $(OPTIMIZATION) -c
-LFLAGS = -Wall -m32 -ansi $(INCLUDES) $(OPTIMIZATION)
+CFLAGS = -Wall -m32 -ansi $(INCLUDES) $(OPTIMIZATION) -c $(DEBUG)
+LFLAGS = -Wall -m32 -ansi $(INCLUDES) $(OPTIMIZATION) $(DEBUG)
LIBS =
-OBJS = MemoryPool.o Public.o
+OBJS = MemoryPool.o Public.o RTI2Reader.o RTIReader.o RTReader.o
COMMON_API_PATH = ../../Common/rt\ api
all: converti2
clean:
rm -f *.o converti2
+debug: DEBUG += -DDEBUG -g
+debug: all
+
+#m32: DEBUG += -m32
+#m32: converti2
+
rebuild: clean all
MemoryPool.o: $(COMMON_API_PATH)/MemoryPool.h $(COMMON_API_PATH)/MemoryPool.cpp $(COMMON_API_PATH)/Public.h
Public.o: $(COMMON_API_PATH)/Public.h $(COMMON_API_PATH)/Public.cpp
$(CC) $(CFLAGS) $(COMMON_API_PATH)/Public.cpp
+
+RTI2Reader.o: $(COMMON_API_PATH)/RTI2Reader.h $(COMMON_API_PATH)/RTI2Reader.cpp
+ $(CC) $(CFLAGS) $(COMMON_API_PATH)/RTI2Reader.cpp
+
+RTIReader.o: $(COMMON_API_PATH)/RTIReader.h $(COMMON_API_PATH)/RTIReader.cpp
+ $(CC) $(CFLAGS) $(COMMON_API_PATH)/RTIReader.cpp
+
+RTReader.o: $(COMMON_API_PATH)/RTReader.h $(COMMON_API_PATH)/RTReader.cpp
+ $(CC) $(CFLAGS) $(COMMON_API_PATH)/RTReader.cpp
+++ /dev/null
-/*
- * freerainbowtables is a project for generating, distributing, and using
- * perfect rainbow tables
- *
- * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
- * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>
- * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
- * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
- *
- * This file is part of freerainbowtables.
- *
- * freerainbowtables is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * freerainbowtables is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with freerainbowtables. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifdef _WIN32
- #pragma warning(disable : 4786)
-#endif
-
-#ifdef _WIN32
-
-#else
-#include <cstdio>
-#include <cctype>
-#include <ctime>
-#include <cstring>
-#include <cstdlib>
-#include <csignal>
-#include <unistd.h>
-
-#endif
-
-#include "Public.h"
-
-#ifdef _WIN32
- #include <windows.h>
-#elif defined(__APPLE__) || \
- ((defined(__unix__) || defined(unix)) && !defined(USG))
-
- #include <sys/param.h>
-
- #if defined(BSD)
- #include <sys/sysctl.h>
- #elif defined(__linux__)
- #include <sys/sysinfo.h>
- #else
- #error Unsupported Operating system
- #endif
-#endif
-
-//////////////////////////////////////////////////////////////////////
-
-unsigned int GetFileLen(FILE* file)
-{
- unsigned int pos = ftell(file);
- fseek(file, 0, SEEK_END);
- unsigned int len = ftell(file);
- fseek(file, pos, SEEK_SET);
-
- return len;
-}
-
-string TrimString(string s)
-{
- while (s.size() > 0)
- {
- if (s[0] == ' ' || s[0] == '\t')
- s = s.substr(1);
- else
- break;
- }
-
- while (s.size() > 0)
- {
- if (s[s.size() - 1] == ' ' || s[s.size() - 1] == '\t')
- s = s.substr(0, s.size() - 1);
- else
- break;
- }
-
- return s;
-}
-bool GetHybridCharsets(string sCharset, vector<tCharset>& vCharset)
-{
- // Example: hybrid(mixalpha-numeric-all-space#1-6,numeric#1-4)
- if(sCharset.substr(0, 6) != "hybrid") // Not hybrid charset
- return false;
-
- UINT4 nEnd = (int) sCharset.rfind(')');
- UINT4 nStart = (int) sCharset.rfind('(');
- string sChar = sCharset.substr(nStart + 1, nEnd - nStart - 1);
- vector<string> vParts;
- SeperateString(sChar, ",", vParts);
- for(UINT4 i = 0; i < vParts.size(); i++)
- {
- tCharset stCharset;
- vector<string> vParts2;
- SeperateString(vParts[i], "#", vParts2);
- stCharset.sName = vParts2[0];
- vector<string> vParts3;
- SeperateString(vParts2[1], "-", vParts3);
- stCharset.nPlainLenMin = atoi(vParts3[0].c_str());
- stCharset.nPlainLenMax = atoi(vParts3[1].c_str());
- vCharset.push_back(stCharset);
- }
- return true;
-}
-bool ReadLinesFromFile(string sPathName, vector<string>& vLine)
-{
- vLine.clear();
- FILE *file = fopen(sPathName.c_str(), "rb");
- if (file != NULL)
- {
- unsigned int len = GetFileLen(file);
- char* data = new char[len + 1];
- fread(data, 1, len, file);
- data[len] = '\0';
- string content = data;
- content += "\n";
- delete [] data;
-
- unsigned int i;
- for (i = 0; i < content.size(); i++)
- {
- if (content[i] == '\r')
- content[i] = '\n';
- }
-
- int n;
- while ((n = content.find("\n", 0)) != -1)
- {
- string line = content.substr(0, n);
- line = TrimString(line);
- if (line != "")
- vLine.push_back(line);
- content = content.substr(n + 1);
- }
-
- fclose(file);
- }
- else
- return false;
-
- return true;
-}
-
-bool SeperateString(string s, string sSeperator, vector<string>& vPart)
-{
- vPart.clear();
-
- unsigned int i;
- for (i = 0; i < sSeperator.size(); i++)
- {
- int n = s.find(sSeperator[i]);
- if (n != -1)
- {
- vPart.push_back(s.substr(0, n));
- s = s.substr(n + 1);
- }
- else
- return false;
- }
- vPart.push_back(s);
-
- return true;
-}
-
-string uint64tostr(uint64 n)
-{
- char str[32];
-
-#ifdef _WIN32
- sprintf(str, "%I64u", n);
-#else
- sprintf(str, "%llu", n);
-#endif
-
- return str;
-}
-
-string uint64tohexstr(uint64 n)
-{
- char str[32];
-
-#ifdef _WIN32
- sprintf(str, "%016I64x", n);
-#else
- sprintf(str, "%016llx", n);
-#endif
-
- return str;
-}
-
-string HexToStr(const unsigned char* pData, int nLen)
-{
- string sRet;
- int i;
- for (i = 0; i < nLen; i++)
- {
- char szByte[3];
- sprintf(szByte, "%02x", pData[i]);
- sRet += szByte;
- }
-
- return sRet;
-}
-
-uint64 GetAvailPhysMemorySize()
-{
-#ifdef _WIN32
- MEMORYSTATUS ms;
- GlobalMemoryStatus(&ms);
- return ms.dwAvailPhys;
-#elif defined(BSD)
- int mib[2] = { CTL_HW, HW_PHYSMEM };
- uint64 physMem;
- //XXX warning size_t isn't portable
- size_t len;
- len = sizeof(physMem);
- sysctl(mib, 2, &physMem, &len, NULL, 0);
- return physMem;
-#elif defined(__linux__)
- struct sysinfo info;
- sysinfo(&info);
- return ( info.freeram + info.bufferram ) * (unsigned long) info.mem_unit;
-#else
- return 0;
- #error Unsupported Operating System
-#endif
-}
-
-void ParseHash(string sHash, unsigned char* pHash, int& nHashLen)
-{
- UINT4 i;
- for (i = 0; i < sHash.size() / 2; i++)
- {
- string sSub = sHash.substr(i * 2, 2);
- int nValue;
- sscanf(sSub.c_str(), "%02x", &nValue);
- pHash[i] = (unsigned char)nValue;
- }
-
- nHashLen = sHash.size() / 2;
-}
-
-void Logo()
-{
- printf("RainbowCrack (improved) 2.0 - Making a Faster Cryptanalytic Time-Memory Trade-Off\n");
- printf("by Martin Westergaard <martinwj2005@gmail.com>\n");
- printf("http://www.freerainbowtables.com/\n");
- printf("original code by Zhu Shuanglei <shuanglei@hotmail.com>\n");
- printf("http://www.antsight.com/zsl/rainbowcrack/\n\n");
-}
-
-// XXX nmap is GPL2, will check newer releases regarding license
-// Code comes from nmap, used for the linux implementation of kbhit()
-#ifndef _WIN32
-
-static int tty_fd = 0;
-struct termios saved_ti;
-
-int tty_getchar()
-{
- int c, numChars;
-
- if (tty_fd && tcgetpgrp(tty_fd) == getpid()) {
- c = 0;
- numChars = read(tty_fd, &c, 1);
- if (numChars > 0) return c;
- }
-
- return -1;
-}
-
-void tty_done()
-{
- if (!tty_fd) return;
-
- tcsetattr(tty_fd, TCSANOW, &saved_ti);
-
- close(tty_fd);
- tty_fd = 0;
-}
-
-void tty_init()
-{
- struct termios ti;
-
- if (tty_fd)
- return;
-
- if ((tty_fd = open("/dev/tty", O_RDONLY | O_NONBLOCK)) < 0) return;
-
- tcgetattr(tty_fd, &ti);
- saved_ti = ti;
- ti.c_lflag &= ~(ICANON | ECHO);
- ti.c_cc[VMIN] = 1;
- ti.c_cc[VTIME] = 0;
- tcsetattr(tty_fd, TCSANOW, &ti);
-
- atexit(tty_done);
-}
-
-void tty_flush(void)
-{
- tcflush(tty_fd, TCIFLUSH);
-}
-// end nmap code
-#endif
+++ /dev/null
-/*
- * freerainbowtables is a project for generating, distributing, and using
- * perfect rainbow tables
- *
- * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
- * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
- * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
- *
- * This file is part of freerainbowtables.
- *
- * freerainbowtables is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * freerainbowtables is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with freerainbowtables. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _PUBLIC_H
-#define _PUBLIC_H
-
-#include <stdio.h>
-
-#include <string>
-#include <vector>
-#include <list>
-
-#include "global.h"
-
-using namespace std;
-
-struct RainbowChain
-{
- uint64 nIndexS;
- uint64 nIndexE;
-};
-
-struct RainbowChainCP
-{
- uint64 nIndexS;
- uint64 nIndexE;
- unsigned short nCheckPoint;
-};
-struct IndexChain
-{
- uint64 nPrefix;
- int nFirstChain;
- unsigned int nChainCount;
-};
-struct FoundRainbowChain
-{
- uint64 nIndexS;
- int nIndexE;
- int nCheckPoint;
- int nGuessedPos;
-};
-struct ChainCheckChain
-{
- uint64 nIndexS;
- int nGuessedPos;
-};
-struct IndexRow
-{
- uint64 prefix;
- unsigned int prefixstart, numchains;
-};
-
-typedef struct
-{
- string sName;
- int nPlainLenMin;
- int nPlainLenMax;
-} tCharset;
-
-#define MAX_PLAIN_LEN 256
-#define MIN_HASH_LEN 8
-#define MAX_HASH_LEN 256
-#define MAX_SALT_LEN 256
-
-// XXX nmap is GPL2, will check newer releases regarding license
-// Code comes from nmap, used for the linux implementation of kbhit()
-#ifndef _WIN32
-#include <unistd.h>
-#include <termios.h>
-#include <fcntl.h>
-
-int tty_getchar();
-void tty_done();
-void tty_init();
-void tty_flush(void);
-// end nmap code
-
-#endif
-
-unsigned int GetFileLen(FILE* file);
-string TrimString(string s);
-bool ReadLinesFromFile(string sPathName, vector<string>& vLine);
-bool SeperateString(string s, string sSeperator, vector<string>& vPart);
-string uint64tostr(uint64 n);
-string uint64tohexstr(uint64 n);
-string HexToStr(const unsigned char* pData, int nLen);
-uint64 GetAvailPhysMemorySize();
-void ParseHash(string sHash, unsigned char* pHash, int& nHashLen);
-bool GetHybridCharsets(string sCharset, vector<tCharset>& vCharset);
-void Logo();
-
-#endif
#include <time.h>
#include <math.h>
#include <vector>
-
+#include <sstream>
#include "Public.h"
#include "MemoryPool.h"
+#include "RTIReader.h"
+#include "RTReader.h"
using namespace std;
_finddata_t fd;
long handle = _findfirst(sWildCharPathName.c_str(), &fd);
- if (handle != -1)
- {
- do
- {
+ if (handle != -1) {
+ do {
string sName = fd.name;
- if (sName != "." && sName != ".." && !(fd.attrib & _A_SUBDIR))
- {
+ if (sName != "." && sName != ".." && !(fd.attrib & _A_SUBDIR)) {
string sPathName = sPath + sName;
vPathName.push_back(sPathName);
}
int nIndex = sPathName.find_last_of('/');
#endif
string sFileName;
- if (nIndex != -1)
+ if (nIndex != -1) {
sFileName = sPathName.substr(nIndex + 1);
- else
+ }
+ else {
sFileName = sPathName;
- // Info
- printf("%s:\n", sFileName.c_str());
- FILE* file = fopen(sPathName.c_str(), "rb");
- FILE* fileR = fopen(sResultFileName.c_str(), "wb");
+ }
unsigned int distribution[64] = {0};
unsigned int numProcessedChains = 0;
-
- if (file != NULL && fileR != NULL)
- {
+ FILE* fileR;
+ BaseRTReader *reader = NULL;
+ if(sPathName.substr(sPathName.length() - 2, sPathName.length()) == "rt")
+ reader = (BaseRTReader*)new RTReader(sPathName);
+ else if(sPathName.substr(sPathName.length() - 3, sPathName.length()) == "rti")
+ reader = (BaseRTReader*)new RTIReader(sPathName);
+ if(reader == NULL) {
+ printf("%s is not a supported file (Only RT and RTI is supported)\n", sPathName.c_str());
+ return;
+ }
+ // Info
+ printf("%s:\n", sFileName.c_str());
+ if(showDistribution == 0) {
+ fileR = fopen(sResultFileName.c_str(), "wb");
+ }
+ if (fileR != NULL || showDistribution == 1) {
// File length check
- UINT4 nFileLen = GetFileLen(file);
- UINT4 nTotalChainCount = 0;
- if(hascp == 0) nTotalChainCount = nFileLen / 16;
- else nTotalChainCount = nFileLen / 18;
- if ((hascp == 0 && nFileLen % 16 != 0) || (hascp == 1 && nFileLen % 18 != 0))
- {
- printf("file length mismatch\n");
- }
- else
- {
+
+ int size = reader->GetChainsLeft() * sizeof(RainbowChain);
static CMemoryPool mp;
unsigned int nAllocatedSize;
- RainbowChainCP* pChain = (RainbowChainCP*)mp.Allocate(nFileLen, nAllocatedSize);
-
- unsigned int chainrowsize = ceil((float)(rti_startptlength + rti_endptlength + rti_cplength) / 8) * 8 ; // The size in bits (in whole bytes)
+ RainbowChain* pChain = (RainbowChain*)mp.Allocate(size, nAllocatedSize);
+ 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)
- {
- nAllocatedSize = nAllocatedSize / sizeof(RainbowChainCP) * sizeof(RainbowChainCP);
- fseek(file, 0, SEEK_SET);
+ if (pChain != NULL) {
+ nAllocatedSize = nAllocatedSize / sizeof(RainbowChain) * sizeof(RainbowChain);
+ unsigned int nChains = nAllocatedSize / sizeof(RainbowChain);
uint64 curPrefix = 0, prefixStart = 0;
vector<IndexRow> indexes;
- UINT4 nRainbowChainCountRead = 0;
- while (true) // Chunk read loop
- {
+ unsigned int chainsLeft;
+ while((chainsLeft = reader->GetChainsLeft()) > 0) {
+
/* if (ftell(file) == nFileLen)
break;*/
- UINT4 nReadThisRound;
- memset(pChain, 0x00, nAllocatedSize);
- printf("reading...\n");
+ printf("%u chains left to read\n", chainsLeft);
+ //int nReadThisRound;
clock_t t1 = clock();
- for(nReadThisRound = 0; nReadThisRound < nAllocatedSize / sizeof(RainbowChainCP) && nRainbowChainCountRead < nTotalChainCount; nReadThisRound++)
- {
- if(fread(&pChain[nReadThisRound], 16, 1, file) != 1)
- {
- printf("Error reading file\n"); exit(1);
- }
- if(hascp == 1)
- {
- if(fread(&pChain[nReadThisRound].nCheckPoint, 2, 1, file) != 1)
- {
- printf("Error reading file\n"); exit(2);
- }
- }
- nRainbowChainCountRead++;
- }
+ printf("reading...\n");
+#ifdef _MEMORYDEBUG
+ printf("Grabbing %i chains from file\n", nChains);
+#endif
+ reader->ReadChains(nChains, pChain);
+#ifdef _MEMORYDEBUG
+ printf("Recieved %i chains from file\n", nChains);
+#endif
clock_t t2 = clock();
float fTime = 1.0f * (t2 - t1) / CLOCKS_PER_SEC;
- int nDataRead = nRainbowChainCountRead * 16;
- if(hascp == 1) nDataRead += nRainbowChainCountRead * 2; // Add the index readings too
- printf("%u bytes read, disk access time: %.2f s\n", nDataRead , fTime);
+ printf("reading time: %.2f s\n", fTime);
+ printf("converting %i chains...\n", nChains);
t1 = clock();
-
- for(UINT4 i = 0; i < nReadThisRound; i++)
- {
- if(showDistribution == 1)
- {
+ for(unsigned int i = 0; i < nChains; i++) {
+ if(showDistribution == 1) {
distribution[GetMaxBits(pChain[i].nIndexS)-1]++;
}
else
{
uint64 chainrow = pChain[i].nIndexS; // Insert the complete start point
chainrow |= ((uint64)pChain[i].nIndexE & (0xffffffff >> (32 - rti_endptlength))) << rti_startptlength; //
- if(hascp == 1 && rti_cplength > 0)
- {
+/* if(hascp == 1 && rti_cplength > 0) {
chainrow |= (uint64)pChain[i].nCheckPoint << rti_startptlength + rti_endptlength;
- }
+ }*/
fwrite(&chainrow, 1, chainrowsizebytes, fileR);
uint64 prefix = pChain[i].nIndexE >> rti_endptlength;
if(i == 0) curPrefix = prefix;
- if(prefix != curPrefix && numProcessedChains - prefixStart > 0)
- {
- if(prefix < curPrefix)
- {
- printf("**** Error writeChain(): Prefix is smaller than previous prefix. %llu < %llu****\n", prefix, curPrefix);
- exit(1);
- }
- //unsigned char index[11] = {0}; // [0 - 10]
- unsigned int numchains = numProcessedChains - prefixStart;
- IndexRow index;
- index.prefix = curPrefix;
+ if(prefix != curPrefix && numProcessedChains - prefixStart > 0) {
+ if(prefix < curPrefix) {
+ printf("**** Error writeChain(): Prefix is smaller than previous prefix. %llu < %llu****\n", prefix, curPrefix);
+ exit(1);
+ }
+ //unsigned char index[11] = {0}; // [0 - 10]
+ unsigned int numchains = numProcessedChains - prefixStart;
+ IndexRow index;
+ index.prefix = curPrefix;
// index.prefixstart = prefixStart;
- index.numchains = numchains;
- indexes.push_back(index);
- prefixStart = numProcessedChains;
- curPrefix = prefix;
+ index.numchains = numchains;
+ indexes.push_back(index);
+ prefixStart = numProcessedChains;
+ curPrefix = prefix;
}
}
numProcessedChains++;
t2 = clock();
fTime = 1.0f * (t2 - t1) / CLOCKS_PER_SEC;
printf("conversion time: %.2f s\n", fTime);
- if(nRainbowChainCountRead == nTotalChainCount)
- break;
- if(showDistribution == 1)
- {
- for(int i = 0; i < 64; i++)
- {
+ if(showDistribution == 1) {
+ for(int i = 0; i < 64; i++) {
printf("%u - %u\n", (i+1), distribution[i]);
}
+ delete reader;
return;
}
// 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);
fwrite(&rti_endptlength, 1, 1, pFileIndex);
fwrite(&rti_cplength, 1, 1, pFileIndex);
// fwrite(&m_rti_index_indexlength , 1, 1, pFileIndex);
+
fwrite(&m_rti_index_numchainslength, 1, 1, pFileIndex);
- for(UINT4 i = 0; i < rti_cppos.size(); i++)
- {
+ for(UINT4 i = 0; i < rti_cppos.size(); i++) {
fwrite(&rti_cppos[i], 1, 4, pFileIndex); // The position of the checkpoints
}
// fwrite(&m_rti_index_prefixlength, 1, 1, pFileIndex);
int zero = 0;
fwrite(&indexes[0].prefix, 1, 8, pFileIndex); // Write the first prefix
unsigned int lastPrefix = 0;
- for(UINT4 i = 0; i < indexes.size(); i++)
- {
- if(i == 0)
+ for(UINT4 i = 0; i < indexes.size(); i++) {
+ if(i == 0) {
lastPrefix = indexes[0].prefix;
+ }
+ //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)
- {
+ if(i > 0 && diffSize > 1) {
//indexrow |= indexes[i].prefixstart;
//printf("Diffsize is %u\n", diffSize);
// then write the distance amount of 00's
if(diffSize > 1000) {
- printf("WARNING! The distance to the next prefix is %i. Do you want to continue writing %i bytes of 0x00? Press y to continue", diffSize, diffSize);
+ printf("WARNING! The distance to the next prefix is %i. Do you want to continue writing %i bytes of 0x00? Press y to continue", diffSize, (diffSize*m_indexrowsizebytes));
#ifdef _WIN32
if ( _getch() != 'y' ) {
#else
}
fclose(pFileIndex);
}
- else printf("memory allocation fail\n");
-
-
- // Already finished?
-
- }
- fclose(file);
+ else {
+ printf("memory allocation fail\n");
+ }
+ // Already finished?
}
- else
+ else {
printf("can't open file\n");
-
+ }
+ if(reader != NULL)
+ delete reader;
+ if(fileR != NULL) {
+ fclose(fileR);
+ }
+
}
int main(int argc, char* argv[])
int usecp = 0;// How many bits to use from the index
int hascp = 0;
vector<unsigned int> cppositions;
- if (argc == 1)
- {
+ if (argc == 1) {
Usage();
return 0;
}
- else if(argc > 2)
- {
+ else if(argc > 2) {
for (; argi < argc; argi++)
{
- if (strcmp(argv[argi], "-d") == 0 && (argsUsed & 0x8) == 0)
- {
+ if(strcmp(argv[argi], "-d") == 0 && (argsUsed & 0x8) == 0) {
// Enable verbose mode
argsUsed |= 0x8;
showDistribution = 1;
}
- else if (strncmp(argv[argi], "-sptl=", 6) == 0 && (argsUsed & 0x1) == 0)
- {
+ else if (strncmp(argv[argi], "-sptl=", 6) == 0 && (argsUsed & 0x1) == 0) {
// Maximum index for starting point
argsUsed |= 0x1;
sptl = 0;
- for (i = 6; argv[argi][i] >= '0' && argv[argi][i] <= '9'; i++)
- {
+ for (i = 6; argv[argi][i] >= '0' && argv[argi][i] <= '9'; i++) {
sptl *= 10;
sptl += ((int) argv[argi][i]) - 0x30;
}
- if (argv[argi][i] != '\0')
- {
+ if (argv[argi][i] != '\0') {
printf("Error: Invalid number.\n\n");
Usage();
return 1;
}
- if (i > 23) // i - 3 > 20
- {
+ if (i > 23) { // i - 3 > 20
printf("Error: Number is too large.\n\n");
Usage();
return 1;
}
}
- else if (strncmp(argv[argi], "-eptl=", 6) == 0 && (argsUsed & 0x2) == 0)
- {
+ else if (strncmp(argv[argi], "-eptl=", 6) == 0 && (argsUsed & 0x2) == 0) {
// Maximum index for ending points
argsUsed |= 0x2;
eptl = 0;
- for (i = 6; argv[argi][i] >= '0' && argv[argi][i] <= '9'; i++)
- {
+ for (i = 6; argv[argi][i] >= '0' && argv[argi][i] <= '9'; i++) {
eptl *= 10;
eptl += ((int) argv[argi][i]) - 0x30;
}
- if (argv[argi][i] != '\0')
- {
+ if (argv[argi][i] != '\0') {
printf("Error: Invalid number.\n\n");
Usage();
return 1;
}
- if (i > 23) // i - 3 > 20
- {
+ if (i > 23) { // i - 3 > 20
printf("Error: Number is too large.\n\n");
Usage();
return 1;
}
}
- else if(strncmp(argv[argi], "-usecp=", 7) == 0 && (argsUsed & 0x4) == 0)
- {
+ else if(strncmp(argv[argi], "-usecp=", 7) == 0 && (argsUsed & 0x4) == 0) {
argsUsed |= 0x4;
hascp = 1;
usecp = 0;
unsigned int cppos = 0;
- for(i = 7; argv[argi][i] != ' ' && argv[argi][i] != '\n' && argv[argi][i] != 0;)
- {
+ for(i = 7; argv[argi][i] != ' ' && argv[argi][i] != '\n' && argv[argi][i] != 0;) {
if(cppositions.size() > 0) i++;
for (; argv[argi][i] >= '0' && argv[argi][i] <= '9'; i++)
{
cppos = 0;
//}
}
- if (argv[argi][i] != '\0')
- {
+ if (argv[argi][i] != '\0') {
printf("Error: Invalid number.\n\n");
Usage();
return 1;
}
- if (usecp > 16) // i - 3 > 20
- {
+ if (usecp > 16) { // i - 3 > 20
printf("Error: Number is too large.\n\n");
Usage();
return 1;
}
- else printf("Using %i bits of the checkpoints\n", usecp);
+ else {
+ printf("Using %i bits of the checkpoints\n", usecp);
+ }
}
}
#else
GetTableList(argc, argv, vPathName);
#endif
- if (vPathName.size() == 0)
- {
+ if (vPathName.size() == 0) {
printf("no rainbow table found\n");
return 0;
}
- for (UINT4 i = 0; i < vPathName.size(); i++)
- {
+ for (UINT4 i = 0; i < vPathName.size(); i++) {
string sResultFile;
int n = vPathName[i].find_last_of('\\');
- if (n != -1)
- sResultFile = vPathName[i].substr(n+1, vPathName[i].length()) + "i2";
- else
- sResultFile = vPathName[i] + "i2"; // Resulting file is .rt, not .rti
- printf("Using %i of 64 bits. sptl: %i, eptl: %i, cp: %i. Chains will be %i bytes in size\n", (sptl + eptl + usecp), sptl, eptl, usecp, ((sptl + eptl + usecp) / 8));
- if(sptl + eptl + usecp > 64)
- {
+ if (n != -1) {
+ if(vPathName[i].substr(vPathName[i].length() - 3, vPathName[i].length()) == "rti") {
+ sResultFile = vPathName[i].substr(n+1, vPathName[i].length()) + "2";
+ }
+ else {
+ sResultFile = vPathName[i].substr(n+1, vPathName[i].length()) + "i2";
+ }
+ }
+ else {
+ if(vPathName[i].substr(vPathName[i].length() - 3, vPathName[i].length()) == "rti") {
+ sResultFile = vPathName[i] + "2";
+ } else {
+ sResultFile = vPathName[i] + "i2"; // Resulting file is .rt, not .rti
+ }
+ }
+ if(usecp == 0 && showDistribution == 0) {
+ printf("Using %i of 64 bits. sptl: %i, eptl: %i, cp: %i. Chains will be %i bytes in size\n", (sptl + eptl + usecp), sptl, eptl, usecp, ((sptl + eptl + usecp) / 8));
+ }
+ if(sptl + eptl + usecp > 64) {
exit(1);
}
ConvertRainbowTable(vPathName[i], sResultFile, sptl, eptl, showDistribution, hascp, usecp, cppositions);
+++ /dev/null
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "converti2", "converti2.vcproj", "{066FD6F1-5990-47AD-B095-7AE0029CF5AE}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rcracki_mt", "..\rcracki_mt\rcracki_mt.vcproj", "{D484ABA1-C117-4AB1-B361-22E5EA62FA00}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {066FD6F1-5990-47AD-B095-7AE0029CF5AE}.Debug|Win32.ActiveCfg = Debug|Win32
- {066FD6F1-5990-47AD-B095-7AE0029CF5AE}.Debug|Win32.Build.0 = Debug|Win32
- {066FD6F1-5990-47AD-B095-7AE0029CF5AE}.Release|Win32.ActiveCfg = Release|Win32
- {066FD6F1-5990-47AD-B095-7AE0029CF5AE}.Release|Win32.Build.0 = Release|Win32
- {D484ABA1-C117-4AB1-B361-22E5EA62FA00}.Debug|Win32.ActiveCfg = Debug|Win32
- {D484ABA1-C117-4AB1-B361-22E5EA62FA00}.Debug|Win32.Build.0 = Debug|Win32
- {D484ABA1-C117-4AB1-B361-22E5EA62FA00}.Release|Win32.ActiveCfg = Release|Win32
- {D484ABA1-C117-4AB1-B361-22E5EA62FA00}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="converti2"
- ProjectGUID="{066FD6F1-5990-47AD-B095-7AE0029CF5AE}"
- RootNamespace="convertrti2"
- Keyword="Win32Proj"
- TargetFrameworkVersion="131072"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../Common/rt api"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- AdditionalIncludeDirectories="../../Common/rt api"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath=".\converti2.cpp"
- >
- </File>
- <File
- RelativePath="..\..\Common\rt api\MemoryPool.cpp"
- >
- </File>
- <File
- RelativePath="..\..\Common\rt api\Public.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\Common\rt api\MemoryPool.h"
- >
- </File>
- <File
- RelativePath="..\..\Common\rt api\Public.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{066FD6F1-5990-47AD-B095-7AE0029CF5AE}</ProjectGuid>
+ <RootNamespace>convertrti2</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>NotSet</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../Common/rt api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>../../Common/rt api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\Common\rt api\BaseRTReader.cpp" />
+ <ClCompile Include="..\..\Common\rt api\RTIReader.cpp" />
+ <ClCompile Include="..\..\Common\rt api\RTReader.cpp" />
+ <ClCompile Include="converti2.cpp" />
+ <ClCompile Include="..\..\Common\rt api\MemoryPool.cpp" />
+ <ClCompile Include="..\..\Common\rt api\Public.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\Common\rt api\BaseRTReader.h" />
+ <ClInclude Include="..\..\Common\rt api\MemoryPool.h" />
+ <ClInclude Include="..\..\Common\rt api\Public.h" />
+ <ClInclude Include="..\..\Common\rt api\RTIReader.h" />
+ <ClInclude Include="..\..\Common\rt api\RTReader.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="converti2.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Common\rt api\MemoryPool.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Common\rt api\Public.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Common\rt api\BaseRTReader.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Common\rt api\RTIReader.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Common\rt api\RTReader.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\Common\rt api\MemoryPool.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\Common\rt api\Public.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\Common\rt api\RTIReader.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\Common\rt api\RTReader.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\Common\rt api\BaseRTReader.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerCommandArguments>C:\Users\mwj\Desktop\tables\*.rti -d</LocalDebuggerCommandArguments>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file
class BaseRTReader
{
public:
- virtual int ReadChains(unsigned int &numChains, RainbowChainO *pData) = 0;
- virtual unsigned int GetChainsLeft() = 0;
+ virtual int ReadChains(uint32 &numChains, RainbowChainO *pData) = 0;
+ virtual uint32 GetChainsLeft() = 0;
+ virtual ~BaseRTReader() { };
};
#endif
-/*\r
- * rcracki_mt is a multithreaded implementation and fork of the original \r
- * RainbowCrack\r
- *\r
- * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>\r
- * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>\r
- * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>\r
- * Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
- *\r
- * This file is part of rcracki_mt.\r
- *\r
- * rcracki_mt is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * rcracki_mt is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-\r
-#if defined(_WIN32) && !defined(__GNUC__)\r
- #pragma warning(disable : 4786)\r
-#endif\r
-\r
-#include "ChainWalkSet.h"\r
-\r
-CChainWalkSet::CChainWalkSet()\r
-{\r
- m_sHashRoutineName = "";\r
- m_sPlainCharsetName = "";\r
- m_nPlainLenMin = 0;\r
- m_nPlainLenMax = 0;\r
- m_nRainbowTableIndex = 0;\r
- m_nRainbowChainLen = 0;\r
- debug = false;\r
- sPrecalcPathName = "";\r
- preCalcPart = 0;\r
-}\r
-\r
-CChainWalkSet::~CChainWalkSet()\r
-{\r
- DiscardAll();\r
-}\r
-\r
-void CChainWalkSet::DiscardAll()\r
-{\r
- //printf("debug: discarding all walk...\n");\r
-\r
- list<ChainWalk>::iterator it;\r
- for (it = m_lChainWalk.begin(); it != m_lChainWalk.end(); it++)\r
- delete [] it->pIndexE;\r
- m_lChainWalk.clear();\r
-}\r
-\r
-string CChainWalkSet::CheckOrRotatePreCalcFile()\r
-{\r
- char sPreCalcFileName[255];\r
-\r
- // 255 files limit to be sure\r
- for (; preCalcPart < 255; preCalcPart++)\r
- {\r
- sprintf(sPreCalcFileName, "%s.%d", sPrecalcPathName.c_str(), preCalcPart);\r
- string sReturnPreCalcPath(sPreCalcFileName);\r
-\r
- unsigned int fileLen = 0;\r
-\r
- FILE* file = fopen(sReturnPreCalcPath.c_str(), "ab");\r
- if(file!=NULL)\r
- {\r
- fileLen = GetFileLen(file);\r
- long unsigned int nextFileLen = fileLen + (sizeof(uint64) * (m_nRainbowChainLen-1));\r
- // Rotate to next file if we are going to pass 2GB filesize\r
- if (nextFileLen < ((unsigned)2 * 1024 * 1024 * 1024))\r
- {\r
- // We might want to vPrecalcFiles.push_back(sReturnPreCalcPath) if we just created this file\r
- // We don't as only newly generated chainwalksets will be stored to this new file, so we don't have to look there\r
- if (debug) printf("Debug: Using for precalc: %s\n", sReturnPreCalcPath.c_str());\r
- fclose(file);\r
- return sReturnPreCalcPath;\r
- }\r
- fclose(file);\r
- }\r
- }\r
-\r
- return string("");\r
-}\r
-\r
-void CChainWalkSet::updateUsedPrecalcFiles()\r
-{\r
- // we might also use this function to search a wildcard path of precalc files\r
- vPrecalcFiles.clear();\r
- char sPreCalcFileName[255];\r
-\r
- int i;\r
- // 255 files max\r
- for (i = 0; i < 255; i++)\r
- {\r
- sprintf(sPreCalcFileName, "%s.%d", sPrecalcPathName.c_str(), i);\r
- string sTryPreCalcPath(sPreCalcFileName);\r
- FILE* file = fopen(sTryPreCalcPath.c_str(), "rb");\r
- if(file!=NULL) {\r
- vPrecalcFiles.push_back(sTryPreCalcPath);\r
- fclose(file);\r
- }\r
- else {\r
- break;\r
- }\r
- }\r
-}\r
-\r
-void CChainWalkSet::removePrecalcFiles()\r
-{\r
- if (debug) printf("Debug: Removing precalc files.\n");\r
- updateUsedPrecalcFiles();\r
- string sCurrentPrecalcPathName = "";\r
- string sCurrentPrecalcIndexPathName = "";\r
- \r
- int i;\r
- for (i = 0; i < (int)vPrecalcFiles.size(); i++)\r
- {\r
- sCurrentPrecalcPathName = vPrecalcFiles[i];\r
- sCurrentPrecalcIndexPathName = sCurrentPrecalcPathName + ".index";\r
-\r
- if (debug) printf("Debug: Removing precalc file: %s\n", sCurrentPrecalcPathName.c_str());\r
-\r
- if (remove(sCurrentPrecalcPathName.c_str()) != 0)\r
- if (debug) printf("Debug: Failed removing precalc file: %s\n", sCurrentPrecalcPathName.c_str());\r
-\r
- if (debug) printf("Debug: Removing precalc index file: %s\n", sCurrentPrecalcIndexPathName.c_str());\r
-\r
- if (remove(sCurrentPrecalcIndexPathName.c_str()) != 0)\r
- if (debug) printf("Debug: Failed removing precalc index file: %s\n", sCurrentPrecalcIndexPathName.c_str());\r
-\r
- }\r
-}\r
-\r
-bool CChainWalkSet::FindInFile(uint64* pIndexE, unsigned char* pHash, int nHashLen)\r
-{\r
- int gotPrecalcOnLine = -1;\r
- char precalculationLine[255];\r
- sprintf(precalculationLine, "%s_%s#%d-%d_%d_%d:%s\n", m_sHashRoutineName.c_str(), m_sPlainCharsetName.c_str(), m_nPlainLenMin, m_nPlainLenMax, m_nRainbowTableIndex, m_nRainbowChainLen, HexToStr(pHash, nHashLen).c_str() );\r
- string precalcString(precalculationLine);\r
-\r
- string sCurrentPrecalcPathName = "";\r
- string sCurrentPrecalcIndexPathName = "";\r
- long unsigned int offset;\r
-\r
- int i;\r
- for (i = 0; i < (int)vPrecalcFiles.size() && gotPrecalcOnLine == -1; i++)\r
- {\r
- sCurrentPrecalcPathName = vPrecalcFiles[i];\r
- sCurrentPrecalcIndexPathName = sCurrentPrecalcPathName + ".index";\r
-\r
- offset = 0;\r
-\r
- vector<string> precalcLines;\r
- if (ReadLinesFromFile(sCurrentPrecalcIndexPathName.c_str(), precalcLines))\r
- {\r
- int j;\r
- for (j = 0; j < (int)precalcLines.size(); j++)\r
- {\r
- if (precalcString.compare(0, precalcString.size()-1, precalcLines[j]) == 0)\r
- {\r
- gotPrecalcOnLine = j;\r
- break;\r
- }\r
-\r
- // Parse\r
- vector<string> vPart;\r
- if (SeperateString(precalcLines[j], "___:", vPart))\r
- {\r
- // add to offset\r
- offset += ((atoi(vPart[3].c_str())-1) * sizeof(uint64));\r
- }\r
- else {\r
- // corrupt file\r
- printf("Corrupted precalculation file!\n");\r
- gotPrecalcOnLine = -1;\r
- break;\r
- }\r
- }\r
- }\r
- }\r
-\r
- if (gotPrecalcOnLine > -1)\r
- {\r
- if (debug) printf("Debug: Reading pre calculations from file, line %d offset %lu\n", gotPrecalcOnLine, offset);\r
- \r
- FILE* fp = fopen(sCurrentPrecalcPathName.c_str(), "rb");\r
-\r
- if (fp!=NULL) {\r
- fseek(fp, offset, SEEK_SET);\r
-\r
- // We should do some verification here, for example by recalculating the middle chain, to catch corrupted files\r
- if(fread(pIndexE, sizeof(uint64), (unsigned long)m_nRainbowChainLen-1, fp) != (unsigned long)m_nRainbowChainLen-1)\r
- printf("File read error.");\r
- fclose(fp);\r
- }\r
- else\r
- printf("Cannot open precalculation file %s.\n", sCurrentPrecalcPathName.c_str());\r
-\r
- //printf("\npIndexE[0]: %s\n", uint64tostr(pIndexE[0]).c_str());\r
- //printf("\npIndexE[nRainbowChainLen-2]: %s\n", uint64tostr(pIndexE[m_nRainbowChainLen-2]).c_str());\r
-\r
- return true;\r
- }\r
-\r
- return false;\r
-}\r
-\r
-void CChainWalkSet::StoreToFile(uint64* pIndexE, unsigned char* pHash, int nHashLen)\r
-{\r
- if (debug) printf("\nDebug: Storing precalc\n");\r
- \r
- string sCurrentPrecalcPathName = CheckOrRotatePreCalcFile();\r
- string sCurrentPrecalcIndexPathName = sCurrentPrecalcPathName + ".index";\r
-\r
- FILE* fp = fopen(sCurrentPrecalcPathName.c_str(), "ab");\r
- if(fp!=NULL)\r
- {\r
- if(fwrite(pIndexE, sizeof(uint64), (unsigned long)m_nRainbowChainLen-1, fp) != (unsigned long)m_nRainbowChainLen-1)\r
- printf("File write error.");\r
- else\r
- {\r
- FILE* file = fopen(sCurrentPrecalcIndexPathName.c_str(), "a");\r
- if (file!=NULL)\r
- {\r
- char precalculationLine[255];\r
- sprintf(precalculationLine, "%s_%s#%d-%d_%d_%d:%s\n", m_sHashRoutineName.c_str(), m_sPlainCharsetName.c_str(), m_nPlainLenMin, m_nPlainLenMax, m_nRainbowTableIndex, m_nRainbowChainLen, HexToStr(pHash, nHashLen).c_str() );\r
- fputs (precalculationLine, file);\r
- fclose (file);\r
- }\r
- }\r
- fclose(fp);\r
- }\r
- else\r
- printf("Cannot open precalculation file %s\n", sCurrentPrecalcPathName.c_str());\r
-}\r
-\r
-uint64* CChainWalkSet::RequestWalk(unsigned char* pHash, int nHashLen,\r
- string sHashRoutineName,\r
- string sPlainCharsetName, int nPlainLenMin, int nPlainLenMax, \r
- int nRainbowTableIndex, \r
- int nRainbowChainLen,\r
- bool& fNewlyGenerated,\r
- bool setDebug,\r
- string sPrecalc)\r
-{\r
- debug = setDebug;\r
- sPrecalcPathName = sPrecalc;\r
-\r
- if ( m_sHashRoutineName != sHashRoutineName\r
- || m_sPlainCharsetName != sPlainCharsetName\r
- || m_nPlainLenMin != nPlainLenMin\r
- || m_nPlainLenMax != nPlainLenMax\r
- || m_nRainbowTableIndex != nRainbowTableIndex\r
- || m_nRainbowChainLen != nRainbowChainLen)\r
- {\r
- DiscardAll();\r
-\r
- m_sHashRoutineName = sHashRoutineName;\r
- m_sPlainCharsetName = sPlainCharsetName;\r
- m_nPlainLenMin = nPlainLenMin;\r
- m_nPlainLenMax = nPlainLenMax;\r
- m_nRainbowTableIndex = nRainbowTableIndex;\r
- m_nRainbowChainLen = nRainbowChainLen;\r
-\r
- ChainWalk cw;\r
- memcpy(cw.Hash, pHash, nHashLen);\r
- cw.pIndexE = new uint64[nRainbowChainLen - 1];\r
- m_lChainWalk.push_back(cw);\r
-\r
- // Only update this list when we search through another rainbow table\r
- updateUsedPrecalcFiles();\r
-\r
- if (!FindInFile(cw.pIndexE, pHash, nHashLen))\r
- fNewlyGenerated = true;\r
- else\r
- fNewlyGenerated = false;\r
- return cw.pIndexE;\r
- }\r
-\r
- list<ChainWalk>::iterator it;\r
- for (it = m_lChainWalk.begin(); it != m_lChainWalk.end(); it++)\r
- {\r
- if (memcmp(it->Hash, pHash, nHashLen) == 0)\r
- {\r
- fNewlyGenerated = false;\r
- return it->pIndexE;\r
- }\r
- }\r
-\r
- ChainWalk cw;\r
- memcpy(cw.Hash, pHash, nHashLen);\r
- cw.pIndexE = new uint64[nRainbowChainLen - 1];\r
- m_lChainWalk.push_back(cw);\r
-\r
- if (!FindInFile(cw.pIndexE, pHash, nHashLen))\r
- fNewlyGenerated = true;\r
- else\r
- fNewlyGenerated = false;\r
- return cw.pIndexE;\r
-}\r
-\r
-void CChainWalkSet::DiscardWalk(uint64* pIndexE)\r
-{\r
- list<ChainWalk>::iterator it;\r
- for (it = m_lChainWalk.begin(); it != m_lChainWalk.end(); it++)\r
- {\r
- if (it->pIndexE == pIndexE)\r
- {\r
- delete it->pIndexE;\r
- m_lChainWalk.erase(it);\r
- return;\r
- }\r
- }\r
-\r
- printf("debug: pIndexE not found\n");\r
-}\r
+/*
+ * rcracki_mt is a multithreaded implementation and fork of the original
+ * RainbowCrack
+ *
+ * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
+ * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>
+ * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
+ * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
+ *
+ * This file is part of rcracki_mt.
+ *
+ * rcracki_mt is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * rcracki_mt is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#if defined(_WIN32) && !defined(__GNUC__)
+ #pragma warning(disable : 4786)
+#endif
+
+#include "ChainWalkSet.h"
+
+CChainWalkSet::CChainWalkSet()
+{
+ m_sHashRoutineName = "";
+ m_sPlainCharsetName = "";
+ m_nPlainLenMin = 0;
+ m_nPlainLenMax = 0;
+ m_nRainbowTableIndex = 0;
+ m_nRainbowChainLen = 0;
+ debug = false;
+ sPrecalcPathName = "";
+ preCalcPart = 0;
+}
+
+CChainWalkSet::~CChainWalkSet()
+{
+ DiscardAll();
+}
+
+void CChainWalkSet::DiscardAll()
+{
+ //printf("debug: discarding all walk...\n");
+
+ list<ChainWalk>::iterator it;
+ for (it = m_lChainWalk.begin(); it != m_lChainWalk.end(); it++)
+ delete [] it->pIndexE;
+ m_lChainWalk.clear();
+}
+
+string CChainWalkSet::CheckOrRotatePreCalcFile()
+{
+ char sPreCalcFileName[255];
+
+ // 255 files limit to be sure
+ for (; preCalcPart < 255; preCalcPart++)
+ {
+ sprintf(sPreCalcFileName, "%s.%d", sPrecalcPathName.c_str(), preCalcPart);
+ string sReturnPreCalcPath(sPreCalcFileName);
+
+ long fileLen = 0;
+
+ FILE* file = fopen(sReturnPreCalcPath.c_str(), "ab");
+ if(file!=NULL)
+ {
+ fileLen = GetFileLen(file);
+ long unsigned int nextFileLen = fileLen + (sizeof(uint64) * (m_nRainbowChainLen-1));
+ // Rotate to next file if we are going to pass 2GB filesize
+ if (nextFileLen < ((unsigned)2 * 1024 * 1024 * 1024))
+ {
+ // We might want to vPrecalcFiles.push_back(sReturnPreCalcPath) if we just created this file
+ // We don't as only newly generated chainwalksets will be stored to this new file, so we don't have to look there
+ if (debug) printf("Debug: Using for precalc: %s\n", sReturnPreCalcPath.c_str());
+ fclose(file);
+ return sReturnPreCalcPath;
+ }
+ fclose(file);
+ }
+ }
+
+ return string("");
+}
+
+void CChainWalkSet::updateUsedPrecalcFiles()
+{
+ // we might also use this function to search a wildcard path of precalc files
+ vPrecalcFiles.clear();
+ char sPreCalcFileName[255];
+
+ int i;
+ // 255 files max
+ for (i = 0; i < 255; i++)
+ {
+ sprintf(sPreCalcFileName, "%s.%d", sPrecalcPathName.c_str(), i);
+ string sTryPreCalcPath(sPreCalcFileName);
+ FILE* file = fopen(sTryPreCalcPath.c_str(), "rb");
+ if(file!=NULL) {
+ vPrecalcFiles.push_back(sTryPreCalcPath);
+ fclose(file);
+ }
+ else {
+ break;
+ }
+ }
+}
+
+void CChainWalkSet::removePrecalcFiles()
+{
+ if (debug) printf("Debug: Removing precalc files.\n");
+ updateUsedPrecalcFiles();
+ string sCurrentPrecalcPathName = "";
+ string sCurrentPrecalcIndexPathName = "";
+
+ int i;
+ for (i = 0; i < (int)vPrecalcFiles.size(); i++)
+ {
+ sCurrentPrecalcPathName = vPrecalcFiles[i];
+ sCurrentPrecalcIndexPathName = sCurrentPrecalcPathName + ".index";
+
+ if (debug) printf("Debug: Removing precalc file: %s\n", sCurrentPrecalcPathName.c_str());
+
+ if (remove(sCurrentPrecalcPathName.c_str()) != 0)
+ if (debug) printf("Debug: Failed removing precalc file: %s\n", sCurrentPrecalcPathName.c_str());
+
+ if (debug) printf("Debug: Removing precalc index file: %s\n", sCurrentPrecalcIndexPathName.c_str());
+
+ if (remove(sCurrentPrecalcIndexPathName.c_str()) != 0)
+ if (debug) printf("Debug: Failed removing precalc index file: %s\n", sCurrentPrecalcIndexPathName.c_str());
+
+ }
+}
+
+bool CChainWalkSet::FindInFile(uint64* pIndexE, unsigned char* pHash, int nHashLen)
+{
+ int gotPrecalcOnLine = -1;
+ char precalculationLine[255];
+ sprintf(precalculationLine, "%s_%s#%d-%d_%d_%d:%s\n", m_sHashRoutineName.c_str(), m_sPlainCharsetName.c_str(), m_nPlainLenMin, m_nPlainLenMax, m_nRainbowTableIndex, m_nRainbowChainLen, HexToStr(pHash, nHashLen).c_str() );
+ string precalcString(precalculationLine);
+
+ string sCurrentPrecalcPathName = "";
+ string sCurrentPrecalcIndexPathName = "";
+ long unsigned int offset;
+
+ int i;
+ for (i = 0; i < (int)vPrecalcFiles.size() && gotPrecalcOnLine == -1; i++)
+ {
+ sCurrentPrecalcPathName = vPrecalcFiles[i];
+ sCurrentPrecalcIndexPathName = sCurrentPrecalcPathName + ".index";
+
+ offset = 0;
+
+ vector<string> precalcLines;
+ if (ReadLinesFromFile(sCurrentPrecalcIndexPathName.c_str(), precalcLines))
+ {
+ int j;
+ for (j = 0; j < (int)precalcLines.size(); j++)
+ {
+ if (precalcString.compare(0, precalcString.size()-1, precalcLines[j]) == 0)
+ {
+ gotPrecalcOnLine = j;
+ break;
+ }
+
+ // Parse
+ vector<string> vPart;
+ if (SeperateString(precalcLines[j], "___:", vPart))
+ {
+ // add to offset
+ offset += ((atoi(vPart[3].c_str())-1) * sizeof(uint64));
+ }
+ else {
+ // corrupt file
+ printf("Corrupted precalculation file!\n");
+ gotPrecalcOnLine = -1;
+ break;
+ }
+ }
+ }
+ }
+
+ if (gotPrecalcOnLine > -1)
+ {
+ if (debug) printf("Debug: Reading pre calculations from file, line %d offset %lu\n", gotPrecalcOnLine, offset);
+
+ FILE* fp = fopen(sCurrentPrecalcPathName.c_str(), "rb");
+
+ if (fp!=NULL) {
+ fseek(fp, offset, SEEK_SET);
+
+ // We should do some verification here, for example by recalculating the middle chain, to catch corrupted files
+ if(fread(pIndexE, sizeof(uint64), (unsigned long)m_nRainbowChainLen-1, fp) != (unsigned long)m_nRainbowChainLen-1)
+ printf("File read error.");
+ fclose(fp);
+ }
+ else
+ printf("Cannot open precalculation file %s.\n", sCurrentPrecalcPathName.c_str());
+
+ //printf("\npIndexE[0]: %s\n", uint64tostr(pIndexE[0]).c_str());
+ //printf("\npIndexE[nRainbowChainLen-2]: %s\n", uint64tostr(pIndexE[m_nRainbowChainLen-2]).c_str());
+
+ return true;
+ }
+
+ return false;
+}
+
+void CChainWalkSet::StoreToFile(uint64* pIndexE, unsigned char* pHash, int nHashLen)
+{
+ if (debug) printf("\nDebug: Storing precalc\n");
+
+ string sCurrentPrecalcPathName = CheckOrRotatePreCalcFile();
+ string sCurrentPrecalcIndexPathName = sCurrentPrecalcPathName + ".index";
+
+ FILE* fp = fopen(sCurrentPrecalcPathName.c_str(), "ab");
+ if(fp!=NULL)
+ {
+ if(fwrite(pIndexE, sizeof(uint64), (unsigned long)m_nRainbowChainLen-1, fp) != (unsigned long)m_nRainbowChainLen-1)
+ printf("File write error.");
+ else
+ {
+ FILE* file = fopen(sCurrentPrecalcIndexPathName.c_str(), "a");
+ if (file!=NULL)
+ {
+ char precalculationLine[255];
+ sprintf(precalculationLine, "%s_%s#%d-%d_%d_%d:%s\n", m_sHashRoutineName.c_str(), m_sPlainCharsetName.c_str(), m_nPlainLenMin, m_nPlainLenMax, m_nRainbowTableIndex, m_nRainbowChainLen, HexToStr(pHash, nHashLen).c_str() );
+ fputs (precalculationLine, file);
+ fclose (file);
+ }
+ }
+ fclose(fp);
+ }
+ else
+ printf("Cannot open precalculation file %s\n", sCurrentPrecalcPathName.c_str());
+}
+
+uint64* CChainWalkSet::RequestWalk(unsigned char* pHash, int nHashLen,
+ string sHashRoutineName,
+ string sPlainCharsetName, int nPlainLenMin, int nPlainLenMax,
+ int nRainbowTableIndex,
+ int nRainbowChainLen,
+ bool& fNewlyGenerated,
+ bool setDebug,
+ string sPrecalc)
+{
+ debug = setDebug;
+ sPrecalcPathName = sPrecalc;
+
+ if ( m_sHashRoutineName != sHashRoutineName
+ || m_sPlainCharsetName != sPlainCharsetName
+ || m_nPlainLenMin != nPlainLenMin
+ || m_nPlainLenMax != nPlainLenMax
+ || m_nRainbowTableIndex != nRainbowTableIndex
+ || m_nRainbowChainLen != nRainbowChainLen)
+ {
+ DiscardAll();
+
+ m_sHashRoutineName = sHashRoutineName;
+ m_sPlainCharsetName = sPlainCharsetName;
+ m_nPlainLenMin = nPlainLenMin;
+ m_nPlainLenMax = nPlainLenMax;
+ m_nRainbowTableIndex = nRainbowTableIndex;
+ m_nRainbowChainLen = nRainbowChainLen;
+
+ ChainWalk cw;
+ memcpy(cw.Hash, pHash, nHashLen);
+ cw.pIndexE = new uint64[nRainbowChainLen - 1];
+ m_lChainWalk.push_back(cw);
+
+ // Only update this list when we search through another rainbow table
+ updateUsedPrecalcFiles();
+
+ if (!FindInFile(cw.pIndexE, pHash, nHashLen))
+ fNewlyGenerated = true;
+ else
+ fNewlyGenerated = false;
+ return cw.pIndexE;
+ }
+
+ list<ChainWalk>::iterator it;
+ for (it = m_lChainWalk.begin(); it != m_lChainWalk.end(); it++)
+ {
+ if (memcmp(it->Hash, pHash, nHashLen) == 0)
+ {
+ fNewlyGenerated = false;
+ return it->pIndexE;
+ }
+ }
+
+ ChainWalk cw;
+ memcpy(cw.Hash, pHash, nHashLen);
+ cw.pIndexE = new uint64[nRainbowChainLen - 1];
+ m_lChainWalk.push_back(cw);
+
+ if (!FindInFile(cw.pIndexE, pHash, nHashLen))
+ fNewlyGenerated = true;
+ else
+ fNewlyGenerated = false;
+ return cw.pIndexE;
+}
+
+void CChainWalkSet::DiscardWalk(uint64* pIndexE)
+{
+ list<ChainWalk>::iterator it;
+ for (it = m_lChainWalk.begin(); it != m_lChainWalk.end(); it++)
+ {
+ if (it->pIndexE == pIndexE)
+ {
+ delete it->pIndexE;
+ m_lChainWalk.erase(it);
+ return;
+ }
+ }
+
+ printf("debug: pIndexE not found\n");
+}
-/*\r
- * rcracki_mt is a multithreaded implementation and fork of the original \r
- * RainbowCrack\r
- *\r
- * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>\r
- * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>\r
- * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>\r
- * Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
- *\r
- * This file is part of rcracki_mt.\r
- *\r
- * rcracki_mt is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * rcracki_mt is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-\r
-#ifndef _CHAINWALKSET_H\r
-#define _CHAINWALKSET_H\r
-\r
-#include "Public.h"\r
-\r
-struct ChainWalk\r
-{\r
- unsigned char Hash[MAX_HASH_LEN];\r
- //int nHashLen; // Implied\r
- uint64* pIndexE; // mapStartPosIndexE, Len = nRainbowChainLen - 1\r
-};\r
-\r
-class CChainWalkSet\r
-{\r
-public:\r
- CChainWalkSet();\r
- virtual ~CChainWalkSet();\r
-\r
-private:\r
- string m_sHashRoutineName; // Discard all if not match\r
- string m_sPlainCharsetName; // Discard all if not match\r
- int m_nPlainLenMin; // Discard all if not match\r
- int m_nPlainLenMax; // Discard all if not match\r
- int m_nRainbowTableIndex; // Discard all if not match\r
- int m_nRainbowChainLen; // Discard all if not match\r
- list<ChainWalk> m_lChainWalk;\r
- bool debug;\r
- string sPrecalcPathName;\r
- int preCalcPart;\r
- vector<string> vPrecalcFiles;\r
-\r
-private:\r
- void DiscardAll();\r
- bool FindInFile(uint64* pIndexE, unsigned char* pHash, int nHashLen);\r
- string CheckOrRotatePreCalcFile();\r
- void updateUsedPrecalcFiles();\r
-\r
-public:\r
- uint64* RequestWalk(unsigned char* pHash, int nHashLen,\r
- string sHashRoutineName,\r
- string sPlainCharsetName, int nPlainLenMin, int nPlainLenMax, \r
- int nRainbowTableIndex, \r
- int nRainbowChainLen,\r
- bool& fNewlyGenerated,\r
- bool setDebug,\r
- string sPrecalc);\r
- void DiscardWalk(uint64* pIndexE);\r
- void StoreToFile(uint64* pIndexE, unsigned char* pHash, int nHashLen);\r
- void removePrecalcFiles();\r
-};\r
-\r
-#endif\r
+/*
+ * rcracki_mt is a multithreaded implementation and fork of the original
+ * RainbowCrack
+ *
+ * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
+ * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>
+ * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
+ * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
+ *
+ * This file is part of rcracki_mt.
+ *
+ * rcracki_mt is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * rcracki_mt is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _CHAINWALKSET_H
+#define _CHAINWALKSET_H
+
+#include "Public.h"
+
+struct ChainWalk
+{
+ unsigned char Hash[MAX_HASH_LEN];
+ //int nHashLen; // Implied
+ uint64* pIndexE; // mapStartPosIndexE, Len = nRainbowChainLen - 1
+};
+
+class CChainWalkSet
+{
+public:
+ CChainWalkSet();
+ virtual ~CChainWalkSet();
+
+private:
+ string m_sHashRoutineName; // Discard all if not match
+ string m_sPlainCharsetName; // Discard all if not match
+ int m_nPlainLenMin; // Discard all if not match
+ int m_nPlainLenMax; // Discard all if not match
+ int m_nRainbowTableIndex; // Discard all if not match
+ int m_nRainbowChainLen; // Discard all if not match
+ list<ChainWalk> m_lChainWalk;
+ bool debug;
+ string sPrecalcPathName;
+ int preCalcPart;
+ vector<string> vPrecalcFiles;
+
+private:
+ void DiscardAll();
+ bool FindInFile(uint64* pIndexE, unsigned char* pHash, int nHashLen);
+ string CheckOrRotatePreCalcFile();
+ void updateUsedPrecalcFiles();
+
+public:
+ uint64* RequestWalk(unsigned char* pHash, int nHashLen,
+ string sHashRoutineName,
+ string sPlainCharsetName, int nPlainLenMin, int nPlainLenMax,
+ int nRainbowTableIndex,
+ int nRainbowChainLen,
+ bool& fNewlyGenerated,
+ bool setDebug,
+ string sPrecalc);
+ void DiscardWalk(uint64* pIndexE);
+ void StoreToFile(uint64* pIndexE, unsigned char* pHash, int nHashLen);
+ void removePrecalcFiles();
+};
+
+#endif
-[rcracki_mt ChangeLog]\r
-\r
-0.6.5.1 (25 Oct 2010, 15:50:10):\r
-* rti2 fixes courtesy of PowerBlade\r
-\r
-0.6.5 (24 Oct 2010, 18:21:25):\r
-* code changes to allow building via mingw and avoid VC++\r
-* linux thread priority set to nice value of 2\r
-* rti2 support\r
-* replaced clock_t usage with gettimeofday\r
-* add pre-calculation timing per feature request #3025688 from sourceforge\r
-* fix bug #3050821 from sourceforge - missing break for non x86/x86_64 arch\r
-* improve hash performance by moving off openssl to the local faster methods\r
-* sha1 local implementation was *slower* than openssl for x86/x86_64\r
-\r
-0.6.4 (05 Jul 2010, 03:12):\r
-* add -m to allow users to limit memory usage - courtesy of uroskn\r
-* fix memory code that made incorrect assumptions about the MemoryPool\r
-* fix linux memory code - using only info.freeram is incorrect\r
-* cleanup of the nested if/elif/else stuctures\r
-* annotate x86 specific sections of code\r
-* licensing review and GPLv2 compliance\r
-* cleanup of unused items\r
-* restructure Makefile\r
-* cleanup memory leaks\r
-\r
-0.6.3 (21 Oct 2009, 21:05):\r
-* Fixed x86_64 linux compilation\r
-* Fixed x86_64 linux segmentation fault\r
-* Fixed 64bit support in md4 code\r
-* Added support for: FreeBSD, NetBSD, OpenBSD, and MacOSX\r
-\r
-0.6.2 (2 Jul 2009, 13:37):\r
-* Fixed linux support (tty stuff and now actually compiles)\r
-* Fixed precalculation code\r
-\r
-0.6.1 (14 May 2009, 22:12):\r
-* bug fixed where the list of rainbow tables is doubled when you resume a session and you have default RT locations in your ini\r
-\r
-0.6 (14 May 2009, 20:47):\r
-* Finding .rti files recursively\r
-* Fixed memory allocation bugs (also trying to save appropriate amount of memory for chainwalksets... these can become really large with the new tables)\r
-* Real pause/resume function, you can resume a session with -r\r
-* Session support, use -s session_name. Combine this with -r to resume a session other then the default\r
-* Ini file support, store some default values such as rainbow table directories.\r
-* Tab separated results (stdout)\r
-* Support pause during cracking and 'skip' during unicode correction for Linux\r
-* A readme / 'manual' !\r
-\r
-0.5 (16 Apr 2009, 22:47):\r
-* Support for the old non-indexed .rt format, it should work with both type of tables in one run... I didn't test this feature thoroughly\r
-* Using some other pieces of code for algorithms\r
-* Support for .lst files from Cain as input (patch from James Dickson) - use for example -c LMNT.lst\r
-* Fixed some bugs\r
-* Dunno anymore, left this version lying around for too long...\r
-\r
-0.4 (oops, a second 0.4) (13 Dec 2008, 18:20):\r
-* Improved file reading performance\r
-\r
-0.4 (27 Nov 2008, 00:09):\r
-* Source included\r
-* Memory usage down to about 50% (tnx sc00bz for pointing out the inefficiency, tnx jci for helping with the code)\r
-* Works under Linux! (using pthreads now instead of Windows threads)\r
-* Speed up: implemented MD4 reference implementation, not using OpenSSL for NTLM anymore (tnx Bitweasil for supplying 98% of the code)\r
-* Speed up: using OpenSSL a lot faster (tnx jci for pointing that out)\r
-* Probably some more small things i forgot\r
-\r
-0.3 (16 Nov 2008, 01:01):\r
-* Improved command line argument parsing (order no longer matters)\r
-* Option to write (temporary) output to a file, use -o pick_a_nice_filename.txt\r
-* Option to pause, press 'P' to pause/unpause (Windows only)\r
-* For pwdump searches: unicode correction is done when case correction fails\r
-\r
-0.2 (28 Oct 2008, 01:42):\r
-* False alarm checking now also multi threaded\r
-* Search one level of subdirectories for rainbow table files\r
-\r
-0.1 (27 Oct 2008, 00:14):\r
-* Initial multithreaded version, using Windows threads.\r
-* Using multiple threads for the pre-calculation part.\r
-* Added a simple 'progress' message, so you can see how many hashes are being pre-calculated\r
-\r
+[rcracki_mt ChangeLog]
+
+0.6.5.1 (25 Oct 2010, 15:50:10):
+* rti2 fixes courtesy of PowerBlade
+
+0.6.5 (24 Oct 2010, 18:21:25):
+* code changes to allow building via mingw and avoid VC++
+* linux thread priority set to nice value of 2
+* rti2 support
+* replaced clock_t usage with gettimeofday
+* add pre-calculation timing per feature request #3025688 from sourceforge
+* fix bug #3050821 from sourceforge - missing break for non x86/x86_64 arch
+* improve hash performance by moving off openssl to the local faster methods
+* sha1 local implementation was *slower* than openssl for x86/x86_64
+
+0.6.4 (05 Jul 2010, 03:12):
+* add -m to allow users to limit memory usage - courtesy of uroskn
+* fix memory code that made incorrect assumptions about the MemoryPool
+* fix linux memory code - using only info.freeram is incorrect
+* cleanup of the nested if/elif/else stuctures
+* annotate x86 specific sections of code
+* licensing review and GPLv2 compliance
+* cleanup of unused items
+* restructure Makefile
+* cleanup memory leaks
+
+0.6.3 (21 Oct 2009, 21:05):
+* Fixed x86_64 linux compilation
+* Fixed x86_64 linux segmentation fault
+* Fixed 64bit support in md4 code
+* Added support for: FreeBSD, NetBSD, OpenBSD, and MacOSX
+
+0.6.2 (2 Jul 2009, 13:37):
+* Fixed linux support (tty stuff and now actually compiles)
+* Fixed precalculation code
+
+0.6.1 (14 May 2009, 22:12):
+* bug fixed where the list of rainbow tables is doubled when you resume a session and you have default RT locations in your ini
+
+0.6 (14 May 2009, 20:47):
+* Finding .rti files recursively
+* Fixed memory allocation bugs (also trying to save appropriate amount of memory for chainwalksets... these can become really large with the new tables)
+* Real pause/resume function, you can resume a session with -r
+* Session support, use -s session_name. Combine this with -r to resume a session other then the default
+* Ini file support, store some default values such as rainbow table directories.
+* Tab separated results (stdout)
+* Support pause during cracking and 'skip' during unicode correction for Linux
+* A readme / 'manual' !
+
+0.5 (16 Apr 2009, 22:47):
+* Support for the old non-indexed .rt format, it should work with both type of tables in one run... I didn't test this feature thoroughly
+* Using some other pieces of code for algorithms
+* Support for .lst files from Cain as input (patch from James Dickson) - use for example -c LMNT.lst
+* Fixed some bugs
+* Dunno anymore, left this version lying around for too long...
+
+0.4 (oops, a second 0.4) (13 Dec 2008, 18:20):
+* Improved file reading performance
+
+0.4 (27 Nov 2008, 00:09):
+* Source included
+* Memory usage down to about 50% (tnx sc00bz for pointing out the inefficiency, tnx jci for helping with the code)
+* Works under Linux! (using pthreads now instead of Windows threads)
+* Speed up: implemented MD4 reference implementation, not using OpenSSL for NTLM anymore (tnx Bitweasil for supplying 98% of the code)
+* Speed up: using OpenSSL a lot faster (tnx jci for pointing that out)
+* Probably some more small things i forgot
+
+0.3 (16 Nov 2008, 01:01):
+* Improved command line argument parsing (order no longer matters)
+* Option to write (temporary) output to a file, use -o pick_a_nice_filename.txt
+* Option to pause, press 'P' to pause/unpause (Windows only)
+* For pwdump searches: unicode correction is done when case correction fails
+
+0.2 (28 Oct 2008, 01:42):
+* False alarm checking now also multi threaded
+* Search one level of subdirectories for rainbow table files
+
+0.1 (27 Oct 2008, 00:14):
+* Initial multithreaded version, using Windows threads.
+* Using multiple threads for the pre-calculation part.
+* Added a simple 'progress' message, so you can see how many hashes are being pre-calculated
+
* RainbowCrack\r
*\r
* Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>\r
- * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>\r
+ * Copyright 2009, 2010 Martin Westergaard Jørgensen <martinwj2005@gmail.com>\r
* Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>\r
* Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
* Copyright 2010 uroskn\r
}\r
\r
static CMemoryPool mp(bytesForChainWalkSet, debug, maxMem);\r
- RainbowChainO* pChain = (RainbowChainO*)mp.Allocate(nFileLen, nAllocatedSize);\r
- #ifdef _WIN32\r
- if (debug) printf("Allocated %I64u bytes, filelen %lu\n", nAllocatedSize, (unsigned long)nFileLen);\r
+ RainbowChainO* pChain = NULL;\r
+ if(doRti2Format) {\r
+ pChain = (RainbowChainO*)mp.Allocate(pReader->GetChainsLeft() * 16, nAllocatedSize);\r
+ } else {\r
+ pChain = (RainbowChainO*)mp.Allocate(nFileLen, nAllocatedSize);\r
+ }\r
+ #if defined(_WIN32) && !defined(__GNUC__)\r
+ if (debug) printf("Allocated %I64 bytes, filelen %ld\n", nAllocatedSize, nFileLen);\r
#else\r
- if (debug) printf("Allocated %llu bytes, filelen %lu\n", nAllocatedSize, (unsigned long)nFileLen);\r
+ if (debug) printf("Allocated %llu bytes, filelen %ld\n", nAllocatedSize, nFileLen);\r
#endif\r
\r
if (pChain != NULL)\r
\r
// Load table chunk\r
if (debug) printf("reading...\n");\r
- unsigned int nDataRead = 0, nDataToRead = 0;\r
+ unsigned int nDataRead = 0;\r
gettimeofday( &tv, NULL );\r
if ( doRti2Format )\r
{\r
- nDataToRead = nAllocatedSize / 16;\r
- nDataRead = nDataToRead;\r
+ nDataRead = nAllocatedSize / 16;\r
+ if(pReader->GetChainsLeft() <= 0) // No more data\r
+ break; \r
pReader->ReadChains(nDataRead, pChain);\r
+\r
nDataRead *= 8; // Convert from chains read to bytes\r
}\r
else\r
\r
int nRainbowChainCountRead = nDataRead / 16;\r
\r
+ if(doRti2Format) {\r
+ nRainbowChainCountRead = nDataRead / 8;\r
+ }\r
+\r
// Verify table chunk\r
if (!fVerified)\r
{\r
if (!hs.AnyHashLeftWithLen(CChainWalkContext::GetHashLen()))\r
break;\r
\r
+/*\r
+ // XXX eliminated by PB - check correctness\r
// finished the current table\r
if( doRti2Format && nDataToRead > (nDataRead / 8) )\r
{\r
delete pReader;\r
break;\r
}\r
+*/\r
}\r
}\r
else\r
if(fIndex != NULL)\r
{\r
// File length check\r
- unsigned int nFileLenIndex = GetFileLen(fIndex);\r
+ long nFileLenIndex = GetFileLen(fIndex);\r
//unsigned int nRows = nFileLenIndex / 11;\r
//unsigned int nSize = nRows * sizeof(IndexChain);\r
//printf("Debug: 8\n");\r
if (nFileLenIndex % 11 != 0)\r
- printf("index file length mismatch (%u bytes)\n", nFileLenIndex);\r
+ printf("index file length mismatch (%ld bytes)\n", nFileLenIndex);\r
else\r
{\r
//printf("index nSize: %d\n", nSize);\r
//pIndex = (IndexChain*)new unsigned char[nSize];\r
IndexChain *pIndex = (IndexChain*)mpIndex.Allocate(nFileLenIndex, nAllocatedSizeIndex);\r
#ifdef _WIN32\r
- if (debug) printf("Debug: Allocated %I64u bytes for index with filelen %u\n", nAllocatedSizeIndex, nFileLenIndex);\r
+ if (debug) printf("Debug: Allocated %I64u bytes for index with filelen %ld\n", nAllocatedSizeIndex, nFileLenIndex);\r
#else\r
- if (debug) printf("Debug: Allocated %llu bytes for index with filelen %u\n", nAllocatedSizeIndex, nFileLenIndex);\r
+ if (debug) printf("Debug: Allocated %llu bytes for index with filelen %ld\n", nAllocatedSizeIndex, nFileLenIndex);\r
#endif\r
\r
static CMemoryPool mp(bytesForChainWalkSet + nAllocatedSizeIndex, debug, maxMem);\r
\r
fseek(fIndex, 0, SEEK_SET);\r
\r
- while ( (unsigned long)ftell(fIndex) != nFileLenIndex ) // Index chunk read loop\r
+ while ( ftell(fIndex) != nFileLenIndex ) // Index chunk read loop\r
{\r
// Load index chunk\r
#ifdef _WIN32\r
//fseek(file, 0, SEEK_SET);\r
//bool fVerified = false;\r
uint32 nProcessedChains = 0;\r
- while (ftell(file) != nFileLen \r
+ while ( ftell(file) != nFileLen \r
&& nProcessedChains < nCoveredRainbowTableChains ) // Chunk read loop\r
{\r
// Load table chunk\r
-/*\r
- * rcracki_mt is a multithreaded implementation and fork of the original \r
- * RainbowCrack\r
- *\r
- * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>\r
- * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>\r
- * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>\r
- * Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
- * Copyright 2010 uroskn\r
- *\r
- * This file is part of rcracki_mt.\r
- *\r
- * rcracki_mt is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * rcracki_mt is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-\r
-#ifndef _CRACKENGINE_H\r
-#define _CRACKENGINE_H\r
-\r
-#include "Public.h"\r
-#include "HashSet.h"\r
-#include "ChainWalkContext.h"\r
-#include "MemoryPool.h"\r
-#include "ChainWalkSet.h"\r
-#include "rcrackiThread.h"\r
-#ifdef _WIN32\r
-#include <conio.h>\r
-#include <windows.h>\r
-#endif\r
-#include <pthread.h>\r
-\r
-class CCrackEngine\r
-{\r
-public:\r
- CCrackEngine();\r
- virtual ~CCrackEngine();\r
-\r
-private:\r
- CChainWalkSet m_cws;\r
- int maxThreads;\r
- uint64 maxMem;\r
- bool writeOutput;\r
- bool resumeSession;\r
- string outputFile;\r
- string sSessionPathName;\r
- string sProgressPathName;\r
- string sPrecalcPathName;\r
- //string sPrecalcIndexPathName;\r
- bool debug;\r
- bool keepPrecalcFiles;\r
-\r
- // Statistics\r
- float m_fTotalDiskAccessTime;\r
- float m_fTotalCryptanalysisTime;\r
- float m_fTotalPrecalculationTime;\r
- int m_nTotalChainWalkStep;\r
- int m_nTotalFalseAlarm;\r
- int m_nTotalChainWalkStepDueToFalseAlarm;\r
- FILE *m_fChains;\r
-\r
-private:\r
- void ResetStatistics();\r
- RainbowChain *BinarySearch(RainbowChain *pChain, int nChainCountRead, uint64 nIndex, IndexChain *pIndex, int nIndexSize, int nIndexStart);\r
- int BinarySearchOld(RainbowChainO* pChain, int nRainbowChainCount, uint64 nIndex);\r
- void GetChainIndexRangeWithSameEndpoint(RainbowChainO* pChain,\r
- int nRainbowChainCount,\r
- int nChainIndex,\r
- int& nChainIndexFrom,\r
- int& nChainIndexTo);\r
- void SearchTableChunk(RainbowChain* pChain, int nRainbowChainLen, int nRainbowChainCount, CHashSet& hs, IndexChain *pIndex, int nIndexSize, int nChainStart);\r
- void SearchTableChunkOld(RainbowChainO* pChain, int nRainbowChainLen, int nRainbowChainCount, CHashSet& hs);\r
- //bool CheckAlarm(RainbowChain* pChain, int nGuessedPos, unsigned char* pHash, CHashSet& hs);\r
- //bool CheckAlarmOld(RainbowChainO* pChain, int nGuessedPos, unsigned char* pHash, CHashSet& hs);\r
-\r
-public:\r
- void SearchRainbowTable(string sPathName, CHashSet& hs);\r
- void Run(vector<string> vPathName, CHashSet& hs, int i_maxThreads, uint64 i_maxMem, bool resume, bool bDebug);\r
- float GetStatTotalDiskAccessTime();\r
- float GetStatTotalCryptanalysisTime();\r
- float GetStatTotalPrecalculationTime();\r
- int GetStatTotalChainWalkStep();\r
- int GetStatTotalFalseAlarm();\r
- int GetStatTotalChainWalkStepDueToFalseAlarm();\r
- void setOutputFile(string sPathName);\r
- void setSession(string sSessionPathName, string sProgressPathName, string sPrecalcPathName, bool keepPrecalc);\r
-};\r
-\r
-#endif\r
+/*
+ * rcracki_mt is a multithreaded implementation and fork of the original
+ * RainbowCrack
+ *
+ * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
+ * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>
+ * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
+ * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
+ * Copyright 2010 uroskn
+ *
+ * This file is part of rcracki_mt.
+ *
+ * rcracki_mt is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * rcracki_mt is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _CRACKENGINE_H
+#define _CRACKENGINE_H
+
+#include "Public.h"
+#include "HashSet.h"
+#include "ChainWalkContext.h"
+#include "MemoryPool.h"
+#include "ChainWalkSet.h"
+#include "rcrackiThread.h"
+#ifdef _WIN32
+#include <conio.h>
+#include <windows.h>
+#endif
+#include <pthread.h>
+
+class CCrackEngine
+{
+public:
+ CCrackEngine();
+ virtual ~CCrackEngine();
+
+private:
+ CChainWalkSet m_cws;
+ int maxThreads;
+ uint64 maxMem;
+ bool writeOutput;
+ bool resumeSession;
+ string outputFile;
+ string sSessionPathName;
+ string sProgressPathName;
+ string sPrecalcPathName;
+ //string sPrecalcIndexPathName;
+ bool debug;
+ bool keepPrecalcFiles;
+
+ // Statistics
+ float m_fTotalDiskAccessTime;
+ float m_fTotalCryptanalysisTime;
+ float m_fTotalPrecalculationTime;
+ int m_nTotalChainWalkStep;
+ int m_nTotalFalseAlarm;
+ int m_nTotalChainWalkStepDueToFalseAlarm;
+ FILE *m_fChains;
+
+private:
+ void ResetStatistics();
+ RainbowChain *BinarySearch(RainbowChain *pChain, int nChainCountRead, uint64 nIndex, IndexChain *pIndex, int nIndexSize, int nIndexStart);
+ int BinarySearchOld(RainbowChainO* pChain, int nRainbowChainCount, uint64 nIndex);
+ void GetChainIndexRangeWithSameEndpoint(RainbowChainO* pChain,
+ int nRainbowChainCount,
+ int nChainIndex,
+ int& nChainIndexFrom,
+ int& nChainIndexTo);
+ void SearchTableChunk(RainbowChain* pChain, int nRainbowChainLen, int nRainbowChainCount, CHashSet& hs, IndexChain *pIndex, int nIndexSize, int nChainStart);
+ void SearchTableChunkOld(RainbowChainO* pChain, int nRainbowChainLen, int nRainbowChainCount, CHashSet& hs);
+ //bool CheckAlarm(RainbowChain* pChain, int nGuessedPos, unsigned char* pHash, CHashSet& hs);
+ //bool CheckAlarmOld(RainbowChainO* pChain, int nGuessedPos, unsigned char* pHash, CHashSet& hs);
+
+public:
+ void SearchRainbowTable(string sPathName, CHashSet& hs);
+ void Run(vector<string> vPathName, CHashSet& hs, int i_maxThreads, uint64 i_maxMem, bool resume, bool bDebug);
+ float GetStatTotalDiskAccessTime();
+ float GetStatTotalCryptanalysisTime();
+ float GetStatTotalPrecalculationTime();
+ int GetStatTotalChainWalkStep();
+ int GetStatTotalFalseAlarm();
+ int GetStatTotalChainWalkStepDueToFalseAlarm();
+ void setOutputFile(string sPathName);
+ void setSession(string sSessionPathName, string sProgressPathName, string sPrecalcPathName, bool keepPrecalc);
+};
+
+#endif
* RainbowCrack\r
*\r
* Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>\r
- * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>\r
+ * Copyright 2009, 2010 Martin Westergaard Jørgensen <martinwj2005@gmail.com>\r
* Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>\r
* Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
*\r
-/*\r
- * rcracki_mt is a multithreaded implementation and fork of the original \r
- * RainbowCrack\r
- *\r
- * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>\r
- * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>\r
- * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>\r
- * Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
- *\r
- * This file is part of rcracki_mt.\r
- *\r
- * rcracki_mt is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * rcracki_mt is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-\r
-#ifndef _HASHALGORITHM_H\r
-#define _HASHALGORITHM_H\r
-\r
-void HashLM(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);\r
-void HashNTLM(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);\r
-//void HashMD2(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);\r
-void HashMD4(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);\r
-void HashMD5(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);\r
-void HashDoubleMD5(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);\r
-void HashSHA1(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);\r
-//void HashRIPEMD160(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);\r
-void HashMSCACHE(unsigned char *pPlain, int nPlainLen, unsigned char* pHash);\r
-\r
-//****************************************************************************\r
-// MySQL Password Hashing\r
-//****************************************************************************\r
-\r
-void HashMySQL323(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);\r
-void HashMySQLSHA1(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);\r
-\r
-//****************************************************************************\r
-// Cisco PIX Password Hashing\r
-//****************************************************************************\r
-\r
-void HashPIX(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);\r
-\r
-//****************************************************************************\r
-// (HALF) LM CHALL hashing\r
-void HashLMCHALL(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);\r
-void HashHALFLMCHALL(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);\r
-\r
-// From mao\r
-void HashNTLMCHALL(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);\r
-void HashORACLE(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);\r
-\r
-#if !defined(_WIN32) || defined(__GNUC__)\r
-char *strupr(char *s1);\r
-#endif\r
-#endif\r
+/*
+ * rcracki_mt is a multithreaded implementation and fork of the original
+ * RainbowCrack
+ *
+ * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
+ * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>
+ * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
+ * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
+ *
+ * This file is part of rcracki_mt.
+ *
+ * rcracki_mt is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * rcracki_mt is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _HASHALGORITHM_H
+#define _HASHALGORITHM_H
+
+void HashLM(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+void HashNTLM(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+//void HashMD2(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+void HashMD4(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+void HashMD5(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+void HashDoubleMD5(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+void HashSHA1(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+//void HashRIPEMD160(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+void HashMSCACHE(unsigned char *pPlain, int nPlainLen, unsigned char* pHash);
+
+//****************************************************************************
+// MySQL Password Hashing
+//****************************************************************************
+
+void HashMySQL323(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+void HashMySQLSHA1(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+
+//****************************************************************************
+// Cisco PIX Password Hashing
+//****************************************************************************
+
+void HashPIX(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+
+//****************************************************************************
+// (HALF) LM CHALL hashing
+void HashLMCHALL(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+void HashHALFLMCHALL(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+
+// From mao
+void HashNTLMCHALL(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+void HashORACLE(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+
+#if !defined(_WIN32) || defined(__GNUC__)
+char *strupr(char *s1);
+#endif
+#endif
-/*\r
- * rcracki_mt is a multithreaded implementation and fork of the original \r
- * RainbowCrack\r
- *\r
- * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>\r
- * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>\r
- * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>\r
- * Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
- *\r
- * This file is part of rcracki_mt.\r
- *\r
- * rcracki_mt is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * rcracki_mt is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-\r
-#ifndef _HASHROUTINE_H\r
-#define _HASHROUTINE_H\r
-\r
-#include <string>\r
-#include <vector>\r
-\r
-#include "global.h"\r
-\r
-using namespace std;\r
-\r
-typedef void (*HASHROUTINE)(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);\r
-\r
-class CHashRoutine \r
-{\r
-public:\r
- CHashRoutine();\r
- virtual ~CHashRoutine();\r
-\r
-private:\r
- vector<string> vHashRoutineName;\r
- vector<HASHROUTINE> vHashRoutine;\r
- vector<int> vHashLen;\r
- void AddHashRoutine(string sHashRoutineName, HASHROUTINE pHashRoutine, int nHashLen);\r
-\r
-public:\r
- string GetAllHashRoutineName();\r
- void GetHashRoutine(string sHashRoutineName, HASHROUTINE& pHashRoutine, int& nHashLen);\r
-};\r
-\r
-#endif\r
+/*
+ * rcracki_mt is a multithreaded implementation and fork of the original
+ * RainbowCrack
+ *
+ * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
+ * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>
+ * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
+ * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
+ *
+ * This file is part of rcracki_mt.
+ *
+ * rcracki_mt is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * rcracki_mt is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _HASHROUTINE_H
+#define _HASHROUTINE_H
+
+#include <string>
+#include <vector>
+
+#include "global.h"
+
+using namespace std;
+
+typedef void (*HASHROUTINE)(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+
+class CHashRoutine
+{
+public:
+ CHashRoutine();
+ virtual ~CHashRoutine();
+
+private:
+ vector<string> vHashRoutineName;
+ vector<HASHROUTINE> vHashRoutine;
+ vector<int> vHashLen;
+ void AddHashRoutine(string sHashRoutineName, HASHROUTINE pHashRoutine, int nHashLen);
+
+public:
+ string GetAllHashRoutineName();
+ void GetHashRoutine(string sHashRoutineName, HASHROUTINE& pHashRoutine, int& nHashLen);
+};
+
+#endif
-/*\r
- * rcracki_mt is a multithreaded implementation and fork of the original \r
- * RainbowCrack\r
- *\r
- * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>\r
- * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>\r
- * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>\r
- * Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
- *\r
- * This file is part of rcracki_mt.\r
- *\r
- * rcracki_mt is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * rcracki_mt is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-\r
-#ifndef _HASHSET_H\r
-#define _HASHSET_H\r
-\r
-#include "Public.h"\r
-\r
-class CHashSet\r
-{\r
-public:\r
- CHashSet();\r
- virtual ~CHashSet();\r
-\r
-private:\r
- vector<string> m_vHash;\r
- vector<bool> m_vFound;\r
- vector<string> m_vPlain;\r
- vector<string> m_vBinary;\r
-\r
-public:\r
- void AddHash(string sHash); // lowercase, len % 2 == 0, MIN_HASH_LEN * 2 <= len <= MAX_HASH_LEN * 2\r
- bool AnyhashLeft();\r
- bool AnyHashLeftWithLen(int nLen);\r
- void GetLeftHashWithLen(vector<string>& vHash, int nLen);\r
- \r
- void SetPlain(string sHash, string sPlain, string sBinary);\r
- bool GetPlain(string sHash, string& sPlain, string& sBinary);\r
-\r
- int GetStatHashFound();\r
- int GetStatHashTotal();\r
-\r
- string GetHashInfo(int i);\r
- void AddHashInfo(string sHash, bool found, string sPlain, string sBinary);\r
-};\r
-\r
-#endif\r
+/*
+ * rcracki_mt is a multithreaded implementation and fork of the original
+ * RainbowCrack
+ *
+ * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
+ * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>
+ * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
+ * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
+ *
+ * This file is part of rcracki_mt.
+ *
+ * rcracki_mt is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * rcracki_mt is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _HASHSET_H
+#define _HASHSET_H
+
+#include "Public.h"
+
+class CHashSet
+{
+public:
+ CHashSet();
+ virtual ~CHashSet();
+
+private:
+ vector<string> m_vHash;
+ vector<bool> m_vFound;
+ vector<string> m_vPlain;
+ vector<string> m_vBinary;
+
+public:
+ void AddHash(string sHash); // lowercase, len % 2 == 0, MIN_HASH_LEN * 2 <= len <= MAX_HASH_LEN * 2
+ bool AnyhashLeft();
+ bool AnyHashLeftWithLen(int nLen);
+ void GetLeftHashWithLen(vector<string>& vHash, int nLen);
+
+ void SetPlain(string sHash, string sPlain, string sBinary);
+ bool GetPlain(string sHash, string& sPlain, string& sBinary);
+
+ int GetStatHashFound();
+ int GetStatHashTotal();
+
+ string GetHashInfo(int i);
+ void AddHashInfo(string sHash, bool found, string sPlain, string sBinary);
+};
+
+#endif
m_nMemSize = 0;\r
debug = bDebug;\r
\r
- uint64 nAvailPhys = GetAvailPhysMemorySize();\r
+ unsigned long nAvailPhys = GetAvailPhysMemorySize();\r
\r
if ( debug )\r
{\r
- #ifdef _WIN32\r
+ #if defined(_WIN32) && !defined(__GNUC__)\r
printf( "Debug: nAvailPhys: %I64u\n", nAvailPhys );\r
#else\r
- printf( "Debug: nAvailPhys: %llu\n", nAvailPhys );\r
+ printf( "Debug: nAvailPhys: %lu\n", nAvailPhys );\r
#endif\r
printf( "Debug: bytesSaved: %d\n", bytesSaved );\r
}\r
\r
if (file != NULL)\r
{\r
- unsigned int len = GetFileLen(file);\r
+ long len = GetFileLen(file);\r
char* data = new char[len + 1];\r
fread(data, 1, len, file);\r
data[len] = '\0';\r
FILE* file = fopen(sPathName.c_str(), "rb");\r
if (file != NULL)\r
{\r
- unsigned int len = GetFileLen(file);\r
+ long len = GetFileLen(file);\r
char* data = new char[len + 1];\r
fread(data, 1, len, file);\r
data[len] = '\0';\r
\r
unsigned long GetAvailPhysMemorySize()\r
{\r
-#if defined(_WIN32)\r
+#ifdef _WIN32\r
MEMORYSTATUS ms;\r
GlobalMemoryStatus(&ms);\r
return ms.dwAvailPhys;\r
-[rcracki_mt README]\r
-\r
-USAGE\r
-================\r
-example: rcracki_mt -h 5d41402abc4b2a76b9719d911017c592 -t 4 -o save.txt C:\md5\r
-\r
-Start rcracki_mt without any arguments to view usage information in short. This README describes the various \r
-options in more detail. Many options can be set to a default value by editing rcracki_mt.ini. Command line \r
-arguments get priority over settings in the ini file.\r
-\r
-INPUT\r
-----------------\r
-rcracki_mt takes one hash on the command line (using -h) or an input file containing the hashes. rcracki_mt supports \r
-three formats for the input file. Use one of the following options to specify the format followed by the filename:\r
-\r
--l: specify a list of hashes (one hash per line)\r
--f: specify a pwdump file\r
--c: specify a .lst file (format in which Cain stores hashes and results)\r
-\r
-SELECTING RAINBOW TABLES\r
-----------------\r
-Any command line argument that is not an option will be interpreted as a directory to search for rainbow tables, \r
-multiple directories can be specified. rcracki_mt recursively scans all specified directories for *.rti (indexed) \r
-and *.rt (old/original) files. You can use .rt & .rti files at once, but this hasn't been tested thoroughly.\r
-\r
-You can set default locations to search for rainbow tables in rcracki_mt.ini. You need to use these in combination \r
-with the command line argument -a [algorithm]. See the comments in the ini file for examples.\r
-\r
-SESSIONS & RESUMING\r
-----------------\r
-Rcracki_mt has session support, which means that it stores its progress. This allows you to interrupt the session \r
-and resume later on. This also allows sessions that stopped because of a crash (application or even system) to \r
-resume. To use this feature, start rcracki_mt with all the options you'd like, then specify a session name with:\r
-\r
--s session_name: specify a session name\r
-\r
-Now during cracking, all your valuable precalculations are stored to disk, as well as progress (which files have \r
-been checked) and cracked hashes. If you decide to interrupt the session (using CTRL+C), you can resume it using \r
-the -r option. For example:\r
-\r
-rcracki_mt -r -s my_personal_hashes\r
-\r
-While resuming rcracki_mt you can/have to specify the less important options again, like number of threads and \r
-showing debug information. Usually you will have these settings set to a default value in the .ini file anyway. \r
-Session are deleted after the run is completed. You can choose to keep the precalculation work on disk, for example \r
-if you want to reuse your session later on. Use the '-k' option to enable this feature.\r
-\r
-Rcracki_mt has a default session which gets overwritten every time you start a new job without specifying a session \r
-name. It might be interesting to always keep precalculation work by enabling this feature in rcracki_mt.ini. But \r
-pay attention, these precalculations can become quite large on disk. Currently there is a maximum of around 500 GB \r
-of storage for these precalculations. You can always decide to manually remove the .precalc and .precalc.index \r
-files from disk. Always remove both at the same time, you will screw up your results if you don't. A possible \r
-'todo' for development is to do some verification before using stored precalculations.\r
-\r
-OPTIONAL\r
-----------------\r
--t: Number of threads to use (for precalculation and false alarm checking)\r
-Note: In Windows the crack threads run with lower priority.\r
-\r
--o: specify an output file to store found hashes in a colon (:) separated format.\r
- Hashes are saved immediately when found. Especially useful if you have a large list of hashes.\r
-\r
--v: Show more information during cracking, for debugging purposes. Please use this flag if you want to show \r
-output and report a bug.\r
-\r
-\r
-EXTRA FEATURES\r
-----------------\r
-You can pause a running rcracki_mt by using 'P'. It might not pause right away, it actually pauses after doing \r
-precalculation or false alarm checking for one hash. Resume by pressing 'P' again. This pause option is different \r
-from the session/resume feature, as this just pauses a running job, you don't stop rcracki_mt this way.\r
-\r
-If you are trying to crack a pwdump or Cain (.lst) file, containing both LM and NTLM hashes, rcracki_mt will try \r
-and crack the LM hashes. The result will be an uppercase password, which rcracki_mt will then try to correct with \r
-the right casing, using the NTLM hashes. If this fails it will try and perform Unicode correction, using a built-in \r
-mapping. If you happen to have an LM hash coupled with the wrong NTLM hash, this attempt to perform Unicode \r
-correction might take 'forever'. You can press 'S' to skip this step for the current hash.\r
-\r
-\r
-HISTORY AND AUTHORS\r
-================\r
-rcracki_mt originally started as a modification of a modification (rcracki) of the original RainbowCrack (rcrack). \r
-These programs are all used to perform a rainbow table attack on password hashes, implementing Philippe Oechslin's \r
-faster time-memory trade-off technique.\r
-\r
-Original rcrack code was written by Zhu Shuanglei <shuanglei@hotmail.com>.\r
-\r
-Martin Westergaard Jørgensen <martinwj2005@gmail.com> wrote rcracki (improved) to support the rainbow tables \r
-generated by the distributed project www.freerainbowtables.com. These tables are perfected and indexed, making them \r
-faster and smaller. Rcracki also supported hybrid tables.\r
-\r
-Daniël Niggebrugge <neinbrucke> further enhanced this version and made it multi threaded, creating rcracki_mt. More \r
-features were added over time, making it less of an unofficial version with every release.\r
-\r
-James Nobis - <quel> improved *nix compatibility and 64-bit compatability and\r
-continues work on the project.\r
-\r
-\r
-SUPPORTED HASH ALGORITHMS\r
-================\r
-Hash types supported by rcracki_mt are: LM, NTLM, MD2, MD4, MD5, DoubleMD5, SHA1, RIPEMD160, MSCACHE, MySQL323, \r
-MySQLSHA1, PIX, LMCHALL, HALFLMCHALL, NTLMCHALL, ORACLE\r
-\r
-Actual indexed&perfected tables that were generated by the Free Rainbow Tables project: LM, MD5, NTL, FASTLM, \r
-HALFLMCHALL, SHA1\r
-\r
-\r
-SUPPORTED PLATFORMS\r
-================\r
-Rcracki_mt is released both as win32 binary and as source package. Rcracki_mt should work on any Microsoft Windows system, but is only tested on a 32 bit Windows XP. \r
-\r
-The source should work on Linux distributions. It has been tested on:\r
-32-bit Ubuntu\r
-32-bit Debian GNU/Linux\r
-64-bit Debian GNU/Linux\r
-\r
-The source should also work on other platforms and has been tested on:\r
-32-bit MacOSX\r
-\r
-32-bit FreeBSD\r
-64-bit FreeBSD\r
-32-bit NetBSD\r
-32-bit OpenBSD - you must install and use eg++ from ports\r
-64-bit OpenBSD\r
-\r
-Only compilation has been tested on:\r
-64-bit MacOSX\r
-\r
-Please note that to compile under the BSDs you must use gmake.\r
-\r
-OpenBSD threading is a work in progress.\r
-\r
-'OPTIONAL' TODO\r
-================\r
-- verification of an endpoint when restoring a chainwalkset from disk.\r
-- read multiple chainwalksets from disk at once to try and speed up this process.\r
-- read next table (part) from disk while doing cryptanalysis\r
-\r
-\r
-LINKS\r
-================\r
-rcracki_mt @ SourceForge: https://sourceforge.net/projects/rcracki/\r
-Original rcrack: http://www.antsight.com/zsl/rainbowcrack/\r
-Free Rainbow Tables: http://www.freerainbowtables.com/\r
-My personal blog: http://blog.distracted.nl/\r
-Download free rainbow tables: http://tbhost.eu/\r
-Download free rainbow tables (mirror): http://freerainbowtables.mirror.garr.it/mirrors/freerainbowtables/\r
-\r
-\r
-THANKS\r
-================\r
-the_drag0n Writing part of this README\r
-<james.dickson@comhem.se> Patch to support Cain .lst files\r
-Joao Inacio <jcinacio at gmail.com> Supplying some faster algorithm implementations\r
-\r
-\r
-FAQ\r
-================\r
-Q: Why do I get this message all the time? "this table contains hashes with length 8 only"\r
-A: You are probably trying to crack LM hashes. You have to split up the hash in 2 parts of 16 hex characters each.\r
-\r
-Q: rcracki_mt is so slow when I'm cracking 5000 hashes, why is that?\r
-A: Rainbow table attacks are only useful for a certain amount of hashes, mainly because of the precalculations that \r
-are needed for every hash you are cracking. At a certain point it is faster to brute force the same key space then \r
-to try and use rainbow tables. Especially if you use a GPU enabled brute forcer, this limit might be reached very \r
-soon. Play around with these to find you limits.\r
-\r
-Q: How can I speed up rcracki_mt?\r
-A: This depends on quite some factors. If your jobs usually comprise of disk access time, you can try and speed up \r
-your storage. For example by using RAID and/or by using solid state disks. If you are trying to crack many hashes \r
-at the same time, you might be better off with buying a faster CPU.\r
+[rcracki_mt README]
+
+USAGE
+================
+example: rcracki_mt -h 5d41402abc4b2a76b9719d911017c592 -t 4 -o save.txt C:\md5
+
+Start rcracki_mt without any arguments to view usage information in short. This README describes the various
+options in more detail. Many options can be set to a default value by editing rcracki_mt.ini. Command line
+arguments get priority over settings in the ini file.
+
+INPUT
+----------------
+rcracki_mt takes one hash on the command line (using -h) or an input file containing the hashes. rcracki_mt supports
+three formats for the input file. Use one of the following options to specify the format followed by the filename:
+
+-l: specify a list of hashes (one hash per line)
+-f: specify a pwdump file
+-c: specify a .lst file (format in which Cain stores hashes and results)
+
+SELECTING RAINBOW TABLES
+----------------
+Any command line argument that is not an option will be interpreted as a directory to search for rainbow tables,
+multiple directories can be specified. rcracki_mt recursively scans all specified directories for *.rti (indexed)
+and *.rt (old/original) files. You can use .rt & .rti files at once, but this hasn't been tested thoroughly.
+
+You can set default locations to search for rainbow tables in rcracki_mt.ini. You need to use these in combination
+with the command line argument -a [algorithm]. See the comments in the ini file for examples.
+
+SESSIONS & RESUMING
+----------------
+Rcracki_mt has session support, which means that it stores its progress. This allows you to interrupt the session
+and resume later on. This also allows sessions that stopped because of a crash (application or even system) to
+resume. To use this feature, start rcracki_mt with all the options you'd like, then specify a session name with:
+
+-s session_name: specify a session name
+
+Now during cracking, all your valuable precalculations are stored to disk, as well as progress (which files have
+been checked) and cracked hashes. If you decide to interrupt the session (using CTRL+C), you can resume it using
+the -r option. For example:
+
+rcracki_mt -r -s my_personal_hashes
+
+While resuming rcracki_mt you can/have to specify the less important options again, like number of threads and
+showing debug information. Usually you will have these settings set to a default value in the .ini file anyway.
+Session are deleted after the run is completed. You can choose to keep the precalculation work on disk, for example
+if you want to reuse your session later on. Use the '-k' option to enable this feature.
+
+Rcracki_mt has a default session which gets overwritten every time you start a new job without specifying a session
+name. It might be interesting to always keep precalculation work by enabling this feature in rcracki_mt.ini. But
+pay attention, these precalculations can become quite large on disk. Currently there is a maximum of around 500 GB
+of storage for these precalculations. You can always decide to manually remove the .precalc and .precalc.index
+files from disk. Always remove both at the same time, you will screw up your results if you don't. A possible
+'todo' for development is to do some verification before using stored precalculations.
+
+OPTIONAL
+----------------
+-t: Number of threads to use (for precalculation and false alarm checking)
+Note: In Windows the crack threads run with lower priority.
+
+-o: specify an output file to store found hashes in a colon (:) separated format.
+ Hashes are saved immediately when found. Especially useful if you have a large list of hashes.
+
+-v: Show more information during cracking, for debugging purposes. Please use this flag if you want to show
+output and report a bug.
+
+
+EXTRA FEATURES
+----------------
+You can pause a running rcracki_mt by using 'P'. It might not pause right away, it actually pauses after doing
+precalculation or false alarm checking for one hash. Resume by pressing 'P' again. This pause option is different
+from the session/resume feature, as this just pauses a running job, you don't stop rcracki_mt this way.
+
+If you are trying to crack a pwdump or Cain (.lst) file, containing both LM and NTLM hashes, rcracki_mt will try
+and crack the LM hashes. The result will be an uppercase password, which rcracki_mt will then try to correct with
+the right casing, using the NTLM hashes. If this fails it will try and perform Unicode correction, using a built-in
+mapping. If you happen to have an LM hash coupled with the wrong NTLM hash, this attempt to perform Unicode
+correction might take 'forever'. You can press 'S' to skip this step for the current hash.
+
+
+HISTORY AND AUTHORS
+================
+rcracki_mt originally started as a modification of a modification (rcracki) of the original RainbowCrack (rcrack).
+These programs are all used to perform a rainbow table attack on password hashes, implementing Philippe Oechslin's
+faster time-memory trade-off technique.
+
+Original rcrack code was written by Zhu Shuanglei <shuanglei@hotmail.com>.
+
+Martin Westergaard Jørgensen <martinwj2005@gmail.com> wrote rcracki (improved) to support the rainbow tables
+generated by the distributed project www.freerainbowtables.com. These tables are perfected and indexed, making them
+faster and smaller. Rcracki also supported hybrid tables.
+
+Daniël Niggebrugge <neinbrucke> further enhanced this version and made it multi threaded, creating rcracki_mt. More
+features were added over time, making it less of an unofficial version with every release.
+
+James Nobis - <quel> improved *nix compatibility and 64-bit compatability and
+continues work on the project.
+
+
+SUPPORTED HASH ALGORITHMS
+================
+Hash types supported by rcracki_mt are: LM, NTLM, MD2, MD4, MD5, DoubleMD5, SHA1, RIPEMD160, MSCACHE, MySQL323,
+MySQLSHA1, PIX, LMCHALL, HALFLMCHALL, NTLMCHALL, ORACLE
+
+Actual indexed&perfected tables that were generated by the Free Rainbow Tables project: LM, MD5, NTL, FASTLM,
+HALFLMCHALL, SHA1
+
+
+SUPPORTED PLATFORMS
+================
+Rcracki_mt is released both as win32 binary and as source package. Rcracki_mt should work on any Microsoft Windows system, but is only tested on a 32 bit Windows XP.
+
+The source should work on Linux distributions. It has been tested on:
+32-bit Ubuntu
+32-bit Debian GNU/Linux
+64-bit Debian GNU/Linux
+
+The source should also work on other platforms and has been tested on:
+32-bit MacOSX
+
+32-bit FreeBSD
+64-bit FreeBSD
+32-bit NetBSD
+32-bit OpenBSD - you must install and use eg++ from ports
+64-bit OpenBSD
+
+Only compilation has been tested on:
+64-bit MacOSX
+
+Please note that to compile under the BSDs you must use gmake.
+
+OpenBSD threading is a work in progress.
+
+'OPTIONAL' TODO
+================
+- verification of an endpoint when restoring a chainwalkset from disk.
+- read multiple chainwalksets from disk at once to try and speed up this process.
+- read next table (part) from disk while doing cryptanalysis
+
+
+LINKS
+================
+rcracki_mt @ SourceForge: https://sourceforge.net/projects/rcracki/
+Original rcrack: http://www.antsight.com/zsl/rainbowcrack/
+Free Rainbow Tables: http://www.freerainbowtables.com/
+My personal blog: http://blog.distracted.nl/
+Download free rainbow tables: http://tbhost.eu/
+Download free rainbow tables (mirror): http://freerainbowtables.mirror.garr.it/mirrors/freerainbowtables/
+
+
+THANKS
+================
+the_drag0n Writing part of this README
+<james.dickson@comhem.se> Patch to support Cain .lst files
+Joao Inacio <jcinacio at gmail.com> Supplying some faster algorithm implementations
+
+
+FAQ
+================
+Q: Why do I get this message all the time? "this table contains hashes with length 8 only"
+A: You are probably trying to crack LM hashes. You have to split up the hash in 2 parts of 16 hex characters each.
+
+Q: rcracki_mt is so slow when I'm cracking 5000 hashes, why is that?
+A: Rainbow table attacks are only useful for a certain amount of hashes, mainly because of the precalculations that
+are needed for every hash you are cracking. At a certain point it is faster to brute force the same key space then
+to try and use rainbow tables. Especially if you use a GPU enabled brute forcer, this limit might be reached very
+soon. Play around with these to find you limits.
+
+Q: How can I speed up rcracki_mt?
+A: This depends on quite some factors. If your jobs usually comprise of disk access time, you can try and speed up
+your storage. For example by using RAID and/or by using solid state disks. If you are trying to crack many hashes
+at the same time, you might be better off with buying a faster CPU.
long len = GetFileLen(pFileIndex);
fseek(pFileIndex, 0, SEEK_SET);
- m_pIndex = new unsigned char[len];
+ m_pIndex = new (nothrow) unsigned char[len];
+ if(m_pIndex == NULL) {
+ printf("Error allocating %ld MB memory for index in RTI2Reader::RTI2Reader()", len / (1024 * 1024));
+ exit(-2);
+ }
if(fread(m_pIndex, 1, len, pFileIndex) != (unsigned long)len)
{
printf("Error while reading index file");
public:
RTI2Reader(string Filename);
~RTI2Reader(void);
- int ReadChains(unsigned int &numChains, RainbowChainO *pData);
+ int ReadChains(uint32 &numChains, RainbowChainO *pData);
unsigned int GetChainsLeft();
static RTI2Header *GetHeader() { return m_pHeader; }
};
-/*\r
- * rcracki_mt is a multithreaded implementation and fork of the original \r
- * RainbowCrack\r
- *\r
- * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>\r
- * Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
- *\r
- * This file is part of rcracki_mt.\r
- *\r
- * rcracki_mt is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * rcracki_mt is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-\r
-#include <stdio.h>\r
-#include <string>\r
-#include <map>\r
-#ifdef _WIN32\r
- #include <conio.h>\r
-#endif\r
-//#include "openssl/md4.h"\r
-#include <time.h>\r
-#include "signal.h"\r
-#include "Public.h"\r
-#include "md4.h"\r
-\r
-using namespace std;\r
-\r
-class LM2NTLMcorrector\r
-{\r
-public:\r
- LM2NTLMcorrector();\r
-\r
-private:\r
- map<unsigned char, map<int, unsigned char> > m_mapChar;\r
- uint64 progressCurrentCombination;\r
- uint64 totalCurrentCombination;\r
- uint64 counterOverall;\r
- unsigned char NTLMHash[16];\r
- clock_t startClock;\r
- int countCombinations;\r
- int countTotalCombinations;\r
- int counter;\r
- clock_t previousClock;\r
- unsigned char currentCharmap[16][128];\r
- bool aborting;\r
- string sBinary;\r
-\r
-private:\r
- bool checkNTLMPassword(unsigned char* pLMPassword, int nLMPasswordLen, string& sNTLMPassword);\r
- bool startCorrecting(string sLMPassword, string& sNTLMPassword, unsigned char* pLMPassword);\r
- void printString(unsigned char* muteThis, int length);\r
- void setupCombinationAtPositions(int length, unsigned char* pMuteMe, unsigned char* pTempMute, int* jAtPos, bool* fullAtPos, int* sizeAtPos);\r
- bool checkPermutations(int length, unsigned char* pTempMute, int* jAtPos, int* sizeAtPos, unsigned char* pLMPassword, string& sNTLMPassword);\r
-\r
- int calculateTotalCombinations(int length, int setSize);\r
- int factorial (int num);\r
-\r
- bool parseHexPassword(string hexPassword, string& sPlain);\r
- bool NormalizeHexString(string& sHash);\r
- void ParseHash(string sHash, unsigned char* pHash, int& nHashLen);\r
- string ByteToStr(const unsigned char* pData, int nLen);\r
- void addToMapW(unsigned char key, unsigned char value1, unsigned char value2);\r
- void fillMapW();\r
- void checkAbort();\r
- void writeEndStats();\r
-public:\r
- bool LMPasswordCorrectUnicode(string hexPassword, unsigned char* NTLMHash, string& sNTLMPassword);\r
- string getBinary();\r
-};\r
-\r
+/*
+ * rcracki_mt is a multithreaded implementation and fork of the original
+ * RainbowCrack
+ *
+ * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
+ * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
+ *
+ * This file is part of rcracki_mt.
+ *
+ * rcracki_mt is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * rcracki_mt is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdio.h>
+#include <string>
+#include <map>
+#ifdef _WIN32
+ #include <conio.h>
+#endif
+//#include "openssl/md4.h"
+#include <time.h>
+#include "signal.h"
+#include "Public.h"
+#include "md4.h"
+
+using namespace std;
+
+class LM2NTLMcorrector
+{
+public:
+ LM2NTLMcorrector();
+
+private:
+ map<unsigned char, map<int, unsigned char> > m_mapChar;
+ uint64 progressCurrentCombination;
+ uint64 totalCurrentCombination;
+ uint64 counterOverall;
+ unsigned char NTLMHash[16];
+ clock_t startClock;
+ int countCombinations;
+ int countTotalCombinations;
+ int counter;
+ clock_t previousClock;
+ unsigned char currentCharmap[16][128];
+ bool aborting;
+ string sBinary;
+
+private:
+ bool checkNTLMPassword(unsigned char* pLMPassword, int nLMPasswordLen, string& sNTLMPassword);
+ bool startCorrecting(string sLMPassword, string& sNTLMPassword, unsigned char* pLMPassword);
+ void printString(unsigned char* muteThis, int length);
+ void setupCombinationAtPositions(int length, unsigned char* pMuteMe, unsigned char* pTempMute, int* jAtPos, bool* fullAtPos, int* sizeAtPos);
+ bool checkPermutations(int length, unsigned char* pTempMute, int* jAtPos, int* sizeAtPos, unsigned char* pLMPassword, string& sNTLMPassword);
+
+ int calculateTotalCombinations(int length, int setSize);
+ int factorial (int num);
+
+ bool parseHexPassword(string hexPassword, string& sPlain);
+ bool NormalizeHexString(string& sHash);
+ void ParseHash(string sHash, unsigned char* pHash, int& nHashLen);
+ string ByteToStr(const unsigned char* pData, int nLen);
+ void addToMapW(unsigned char key, unsigned char value1, unsigned char value2);
+ void fillMapW();
+ void checkAbort();
+ void writeEndStats();
+public:
+ bool LMPasswordCorrectUnicode(string hexPassword, unsigned char* NTLMHash, string& sNTLMPassword);
+ string getBinary();
+};
+
-/*\r
- * rcracki_mt is a multithreaded implementation and fork of the original \r
- * RainbowCrack\r
- *\r
- * Copyright Bitweasil\r
- * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>\r
- * Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
- *\r
- * This file is part of rcracki_mt.\r
- *\r
- * rcracki_mt is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * rcracki_mt is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-\r
-#ifndef MD4_H\r
-#define MD4_H\r
-\r
-#include "global.h"\r
-\r
-#define MD4_DIGEST_LENGTH 16\r
-\r
-//Main function\r
-void MD4_NEW( unsigned char * buf, int len, unsigned char * pDigest);\r
-\r
-#endif /* !MD4_H */\r
+/*
+ * rcracki_mt is a multithreaded implementation and fork of the original
+ * RainbowCrack
+ *
+ * Copyright Bitweasil
+ * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
+ * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
+ *
+ * This file is part of rcracki_mt.
+ *
+ * rcracki_mt is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * rcracki_mt is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MD4_H
+#define MD4_H
+
+#include "global.h"
+
+#define MD4_DIGEST_LENGTH 16
+
+//Main function
+void MD4_NEW( unsigned char * buf, int len, unsigned char * pDigest);
+
+#endif /* !MD4_H */
-/*\r
- * rcracki_mt is a multithreaded implementation and fork of the original \r
- * RainbowCrack\r
- *\r
- * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>\r
- * Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
- *\r
- * This file is part of rcracki_mt.\r
- *\r
- * rcracki_mt is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * rcracki_mt is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-\r
-#ifdef _WIN32\r
- #pragma once\r
-#endif\r
-\r
-#include "ChainWalkContext.h"\r
-#include "Public.h"\r
-#include "HashSet.h"\r
-//#include <process.h>\r
-#include <pthread.h>\r
-\r
-class rcrackiThread\r
-{\r
-private:\r
- unsigned char* t_TargetHash;\r
- int t_nPos;\r
- int t_nRainbowChainLen;\r
- CChainWalkContext t_cwc;\r
- vector<uint64> t_vStartPosIndexE;\r
- int t_ID;\r
- int t_count;\r
- uint64* t_pStartPosIndexE;\r
- int t_nChainWalkStep;\r
- bool falseAlarmChecker;\r
- bool falseAlarmCheckerO;\r
- vector<RainbowChain *> t_pChainsFound;\r
- vector<RainbowChainO *> t_pChainsFoundO;\r
- vector<int> t_nGuessedPoss;\r
- unsigned char* t_pHash;\r
- bool foundHash;\r
- int t_nChainWalkStepDueToFalseAlarm;\r
- int t_nFalseAlarm;\r
- string t_Hash;\r
- string t_Plain;\r
- string t_Binary;\r
-\r
-public:\r
- rcrackiThread(unsigned char* TargetHash, int thread_id, int nRainbowChainLen, int thread_count, uint64* pStartPosIndexE);\r
- rcrackiThread(unsigned char* pHash, bool oldFormat = false);\r
- rcrackiThread(void);\r
- ~rcrackiThread(void);\r
-\r
- //void SetWork(unsigned char* TargetHash, int nPos, int nRainbowChainLen);\r
- //static unsigned __stdcall rcrackiThread::rcrackiThreadStaticEntryPoint(void * pThis);\r
- static void * rcrackiThreadStaticEntryPointPthread(void * pThis);\r
- int GetIndexCount();\r
- int GetChainWalkStep();\r
- uint64 GetIndex(int nPos);\r
- bool FoundHash();\r
- void AddAlarmCheck(RainbowChain* pChain, int nGuessedPos);\r
- void AddAlarmCheckO(RainbowChainO* pChain, int nGuessedPos);\r
- int GetChainWalkStepDueToFalseAlarm();\r
- int GetnFalseAlarm();\r
- string GetHash();\r
- string GetPlain();\r
- string GetBinary();\r
-\r
-private:\r
- void rcrackiThreadEntryPoint();\r
- void PreCalculate();\r
- void CheckAlarm();\r
- void CheckAlarmO();\r
-};\r
+/*
+ * rcracki_mt is a multithreaded implementation and fork of the original
+ * RainbowCrack
+ *
+ * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
+ * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
+ *
+ * This file is part of rcracki_mt.
+ *
+ * rcracki_mt is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * rcracki_mt is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifdef _WIN32
+ #pragma once
+#endif
+
+#include "ChainWalkContext.h"
+#include "Public.h"
+#include "HashSet.h"
+//#include <process.h>
+#include <pthread.h>
+
+class rcrackiThread
+{
+private:
+ unsigned char* t_TargetHash;
+ int t_nPos;
+ int t_nRainbowChainLen;
+ CChainWalkContext t_cwc;
+ vector<uint64> t_vStartPosIndexE;
+ int t_ID;
+ int t_count;
+ uint64* t_pStartPosIndexE;
+ int t_nChainWalkStep;
+ bool falseAlarmChecker;
+ bool falseAlarmCheckerO;
+ vector<RainbowChain *> t_pChainsFound;
+ vector<RainbowChainO *> t_pChainsFoundO;
+ vector<int> t_nGuessedPoss;
+ unsigned char* t_pHash;
+ bool foundHash;
+ int t_nChainWalkStepDueToFalseAlarm;
+ int t_nFalseAlarm;
+ string t_Hash;
+ string t_Plain;
+ string t_Binary;
+
+public:
+ rcrackiThread(unsigned char* TargetHash, int thread_id, int nRainbowChainLen, int thread_count, uint64* pStartPosIndexE);
+ rcrackiThread(unsigned char* pHash, bool oldFormat = false);
+ rcrackiThread(void);
+ ~rcrackiThread(void);
+
+ //void SetWork(unsigned char* TargetHash, int nPos, int nRainbowChainLen);
+ //static unsigned __stdcall rcrackiThread::rcrackiThreadStaticEntryPoint(void * pThis);
+ static void * rcrackiThreadStaticEntryPointPthread(void * pThis);
+ int GetIndexCount();
+ int GetChainWalkStep();
+ uint64 GetIndex(int nPos);
+ bool FoundHash();
+ void AddAlarmCheck(RainbowChain* pChain, int nGuessedPos);
+ void AddAlarmCheckO(RainbowChainO* pChain, int nGuessedPos);
+ int GetChainWalkStepDueToFalseAlarm();
+ int GetnFalseAlarm();
+ string GetHash();
+ string GetPlain();
+ string GetBinary();
+
+private:
+ void rcrackiThreadEntryPoint();
+ void PreCalculate();
+ void CheckAlarm();
+ void CheckAlarmO();
+};
-# Default settings for rcracki_mt\r
-# Command line arguments override these defaults\r
-\r
-# Specify default amount of threads\r
-Threads=1\r
-\r
-# Set a default file to store temporary results.\r
-# Set AlwaysStoreResultsToFile=1 or use -o to actually store results.\r
-DefaultResultsFile=e:\default_rcracki_results.txt\r
-\r
-# This option requires DefaultResultsFile to be set to a file\r
-#AlwaysStoreResultsToFile=1\r
-\r
-# Set some default file locations to search for rainbow tables.\r
-# You need to use these in combination with the command line argument -a [algorithm]\r
-# Or you can set a default algorithm here with 'DefaultAlgorithm'.\r
-# Algorithm is the name you use as specifier after 'DefaultRainbowTablesPath.'\r
-# You can specify multiple lines per algorithm, one path/directory per line.\r
-# Any locations you specify on the command line will be added to the list as well.\r
-# For Windows users: locations in this file with a different case\r
-# as on the command line are treated as separate locations (run through twice)\r
-#DefaultRainbowTablePath.MD5=X:\RTI\MD5\r
-#DefaultRainbowTablePath.NTLM=X:\RTI\NTLM\ntlm_loweralpha-space#1-9_*\r
-\r
-# This option requires at least one 'DefaultRainbowTablePath.[algorithm]' to be set\r
-#DefaultAlgorithm=MD5\r
-\r
-# Always show debugging infomation (command line option -v)\r
-# AlwaysDebug=1\r
-\r
-# Always keep precalculation files after cracking, don't remove them.\r
-# These files are saved by session name. So you can store precalculations over multiple jobs.\r
+# Default settings for rcracki_mt
+# Command line arguments override these defaults
+
+# Specify default amount of threads
+Threads=1
+
+# Set a default file to store temporary results.
+# Set AlwaysStoreResultsToFile=1 or use -o to actually store results.
+DefaultResultsFile=e:\default_rcracki_results.txt
+
+# This option requires DefaultResultsFile to be set to a file
+#AlwaysStoreResultsToFile=1
+
+# Set some default file locations to search for rainbow tables.
+# You need to use these in combination with the command line argument -a [algorithm]
+# Or you can set a default algorithm here with 'DefaultAlgorithm'.
+# Algorithm is the name you use as specifier after 'DefaultRainbowTablesPath.'
+# You can specify multiple lines per algorithm, one path/directory per line.
+# Any locations you specify on the command line will be added to the list as well.
+# For Windows users: locations in this file with a different case
+# as on the command line are treated as separate locations (run through twice)
+#DefaultRainbowTablePath.MD5=X:\RTI\MD5
+#DefaultRainbowTablePath.NTLM=X:\RTI\NTLM\ntlm_loweralpha-space#1-9_*
+
+# This option requires at least one 'DefaultRainbowTablePath.[algorithm]' to be set
+#DefaultAlgorithm=MD5
+
+# Always show debugging infomation (command line option -v)
+# AlwaysDebug=1
+
+# Always keep precalculation files after cracking, don't remove them.
+# These files are saved by session name. So you can store precalculations over multiple jobs.
#AlwaysKeepPrecalcFiles=1
\ No newline at end of file
+++ /dev/null
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rcracki_mt", "rcracki_mt.vcproj", "{966DA4B4-E13C-449D-9A93-303C6FEA25C4}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {966DA4B4-E13C-449D-9A93-303C6FEA25C4}.Debug|Win32.ActiveCfg = Debug|Win32
- {966DA4B4-E13C-449D-9A93-303C6FEA25C4}.Debug|Win32.Build.0 = Debug|Win32
- {966DA4B4-E13C-449D-9A93-303C6FEA25C4}.Release|Win32.ActiveCfg = Release|Win32
- {966DA4B4-E13C-449D-9A93-303C6FEA25C4}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="rcracki_mt"
- ProjectGUID="{966DA4B4-E13C-449D-9A93-303C6FEA25C4}"
- RootNamespace="rcracki_mt"
- Keyword="Win32Proj"
- TargetFrameworkVersion="131072"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\rt api"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- AdditionalIncludeDirectories="..\..\rt api"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\rt api\BaseRTReader.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\ChainWalkContext.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\ChainWalkSet.cpp"
- >
- </File>
- <File
- RelativePath=".\CrackEngine.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\des_enc.c"
- >
- </File>
- <File
- RelativePath="..\..\rt api\des_setkey.c"
- >
- </File>
- <File
- RelativePath="..\..\rt api\ecb_enc.c"
- >
- </File>
- <File
- RelativePath="..\..\rt api\HashAlgorithm.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\HashRoutine.cpp"
- >
- </File>
- <File
- RelativePath=".\HashSet.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\md4.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\md5.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\MemoryPool.cpp"
- >
- </File>
- <File
- RelativePath="..\converti2\Public.cpp"
- >
- </File>
- <File
- RelativePath=".\RainbowCrack.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\RTI2Reader.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\RTIReader.cpp"
- >
- </File>
- <File
- RelativePath="..\..\rt api\RTReader.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\rt api\BaseRTReader.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\ChainWalkContext.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\ChainWalkSet.h"
- >
- </File>
- <File
- RelativePath=".\CrackEngine.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\des.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\des_locl.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\HashAlgorithm.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\HashRoutine.h"
- >
- </File>
- <File
- RelativePath=".\HashSet.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\md4.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\md5.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\MemoryPool.h"
- >
- </File>
- <File
- RelativePath="..\converti2\Public.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\RTI2Reader.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\RTIReader.h"
- >
- </File>
- <File
- RelativePath="..\..\rt api\RTReader.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
-/*\r
- * rcracki_mt is a multithreaded implementation and fork of the original \r
- * RainbowCrack\r
- *\r
- * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>\r
- * Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
- *\r
- * This file is part of rcracki_mt.\r
- *\r
- * rcracki_mt is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * rcracki_mt is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-\r
-#ifndef SHA1_H\r
-#define SHA1_H\r
-\r
-#include "global.h"\r
-\r
-#define SHA1_DIGEST_LENGTH 20\r
-\r
-void SHA1_NEW( unsigned char * pData, int length, unsigned char * pDigest);\r
-\r
-#endif /* !SHA1_H */\r
+/*
+ * rcracki_mt is a multithreaded implementation and fork of the original
+ * RainbowCrack
+ *
+ * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
+ * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
+ *
+ * This file is part of rcracki_mt.
+ *
+ * rcracki_mt is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * rcracki_mt is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef SHA1_H
+#define SHA1_H
+
+#include "global.h"
+
+#define SHA1_DIGEST_LENGTH 20
+
+void SHA1_NEW( unsigned char * pData, int length, unsigned char * pDigest);
+
+#endif /* !SHA1_H */
SHELL = /bin/sh
CC = g++
OPTIMIZATION = -O3
-INCLUDES = -I../../Common/rt\ api -I../../Server\ Applications/rsearchi
+INCLUDES = -I../../Common/rt\ api
CFLAGS = -Wall -ansi $(INCLUDES) $(OPTIMIZATION) -c $(DEBUG)
LFLAGS = -Wall -ansi $(INCLUDES) $(OPTIMIZATION) $(DEBUG)
LIBS =
sFileName = sPathName.substr(nIndex + 1);
else
sFileName = sPathName;
+
// Info
printf("%s:\n", sFileName.c_str());
FILE *fResult = fopen(sResultFileName.c_str(), "wb");
static CMemoryPool mp;
unsigned int nAllocatedSize;
BaseRTReader *reader = NULL;
-
if(sType == "RTI2")
reader = (BaseRTReader*)new RTI2Reader(sFileName);
else if(sType == "RTI")
printf("Invalid table type '%s'", sType.c_str());
return ;
}
-
- RainbowChainCP* pChain = (RainbowChainCP*)mp.Allocate(reader->GetChainsLeft() * sizeof(RainbowChainCP), nAllocatedSize);
+ int 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);
+#ifdef _MEMORYDEBUG
+ printf("Recieved %i chains from file\n", nChains);
+#endif
for(uint32 i = 0; i < nChains; i++)
{
fwrite(&pChain[i], 1, 16, fResult);
+++ /dev/null
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rti2rto", "rti2rto.vcproj", "{E0FBC06A-C902-4468-A614-CBF9F591AA7C}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {E0FBC06A-C902-4468-A614-CBF9F591AA7C}.Debug|Win32.ActiveCfg = Debug|Win32
- {E0FBC06A-C902-4468-A614-CBF9F591AA7C}.Debug|Win32.Build.0 = Debug|Win32
- {E0FBC06A-C902-4468-A614-CBF9F591AA7C}.Release|Win32.ActiveCfg = Release|Win32
- {E0FBC06A-C902-4468-A614-CBF9F591AA7C}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="rti2rto"
- ProjectGUID="{E0FBC06A-C902-4468-A614-CBF9F591AA7C}"
- RootNamespace="rti2rto"
- Keyword="Win32Proj"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../common/rt api"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- AdditionalIncludeDirectories="../../common/rt api"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\Common\rt api\BaseRTReader.cpp"
- >
- </File>
- <File
- RelativePath="..\..\Common\rt api\MemoryPool.cpp"
- >
- </File>
- <File
- RelativePath="..\..\Common\rt api\Public.cpp"
- >
- </File>
- <File
- RelativePath="..\..\Common\rt api\RTI2Reader.cpp"
- >
- </File>
- <File
- RelativePath=".\rti2rto.cpp"
- >
- </File>
- <File
- RelativePath="..\..\Common\rt api\RTIReader.cpp"
- >
- </File>
- <File
- RelativePath="..\..\Common\rt api\RTReader.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\..\Common\rt api\BaseRTReader.h"
- >
- </File>
- <File
- RelativePath="..\..\Common\rt api\MemoryPool.h"
- >
- </File>
- <File
- RelativePath="..\..\Common\rt api\Public.h"
- >
- </File>
- <File
- RelativePath="..\..\Common\rt api\RTI2Reader.h"
- >
- </File>
- <File
- RelativePath="..\..\Common\rt api\RTIReader.h"
- >
- </File>
- <File
- RelativePath="..\..\Common\rt api\RTReader.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
--- /dev/null
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "converti2", "..\converti2\converti2.vcxproj", "{066FD6F1-5990-47AD-B095-7AE0029CF5AE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rcracki_mt", "..\rcracki_mt\rcracki_mt.vcxproj", "{966DA4B4-E13C-449D-9A93-303C6FEA25C4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rti2rto", "..\rti2rto\rti2rto.vcxproj", "{E0FBC06A-C902-4468-A614-CBF9F591AA7C}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {066FD6F1-5990-47AD-B095-7AE0029CF5AE}.Debug|Win32.ActiveCfg = Debug|Win32
+ {066FD6F1-5990-47AD-B095-7AE0029CF5AE}.Debug|Win32.Build.0 = Debug|Win32
+ {066FD6F1-5990-47AD-B095-7AE0029CF5AE}.Release|Win32.ActiveCfg = Release|Win32
+ {066FD6F1-5990-47AD-B095-7AE0029CF5AE}.Release|Win32.Build.0 = Release|Win32
+ {966DA4B4-E13C-449D-9A93-303C6FEA25C4}.Debug|Win32.ActiveCfg = Debug|Win32
+ {966DA4B4-E13C-449D-9A93-303C6FEA25C4}.Debug|Win32.Build.0 = Debug|Win32
+ {966DA4B4-E13C-449D-9A93-303C6FEA25C4}.Release|Win32.ActiveCfg = Release|Win32
+ {966DA4B4-E13C-449D-9A93-303C6FEA25C4}.Release|Win32.Build.0 = Release|Win32
+ {E0FBC06A-C902-4468-A614-CBF9F591AA7C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E0FBC06A-C902-4468-A614-CBF9F591AA7C}.Debug|Win32.Build.0 = Debug|Win32
+ {E0FBC06A-C902-4468-A614-CBF9F591AA7C}.Release|Win32.ActiveCfg = Release|Win32
+ {E0FBC06A-C902-4468-A614-CBF9F591AA7C}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
class BaseRTReader
{
public:
- virtual int ReadChains(unsigned int &numChains, RainbowChainCP *pData) = 0;
- virtual unsigned int GetChainsLeft() = 0;
+ virtual int ReadChains(UINT4 &numChains, RainbowChain *pData) = 0;
+ virtual UINT4 GetChainsLeft() = 0;
+ virtual ~BaseRTReader() { };
};
#endif
CMemoryPool::~CMemoryPool()
{
- if (m_pMem != NULL)
- {
+ if (m_pMem != NULL) {
+#ifdef _MEMORYDEBUG
+ printf("Freeing %i bytes of memory\n", m_nMemSize);
+#endif
delete [] m_pMem;
m_pMem = NULL;
m_nMemSize = 0;
unsigned char* CMemoryPool::Allocate(unsigned int nFileLen, unsigned int& nAllocatedSize)
{
- if (nFileLen <= m_nMemSize)
- {
+ if (nFileLen <= m_nMemSize) {
nAllocatedSize = nFileLen;
return m_pMem;
}
unsigned int nTargetSize;
- if (nFileLen < m_nMemMax)
+ if (nFileLen < m_nMemMax) {
nTargetSize = nFileLen;
- else
+ }
+ else {
nTargetSize = m_nMemMax;
-
+ }
// Free existing memory
- if (m_pMem != NULL)
- {
+ if (m_pMem != NULL) {
+#ifdef _MEMORYDEBUG
+ printf("Freeing %i bytes of memory\n", m_nMemSize);
+#endif
delete [] m_pMem;
m_pMem = NULL;
m_nMemSize = 0;
// Allocate new memory
//printf("allocating %u bytes memory\n", nTargetSize);
+ // m_pMem = new unsigned char[nTargetSize];
+#ifdef _MEMORYDEBUG
+ printf("Allocating %i bytes of memory - ", nTargetSize);
+#endif
+
m_pMem = new (nothrow) unsigned char[nTargetSize];
- while (m_pMem == NULL && nTargetSize >= 512 * 1024 * 1024 )
- {
- nTargetSize -= 16 * 1024 * 1024;
- m_pMem = new (nothrow) unsigned char[nTargetSize];
+ while (m_pMem == NULL && nTargetSize >= 512 * 1024 * 1024 ) {
+#ifdef _MEMORYDEBUG
+ printf("failed!\n");
+ printf("Allocating %i bytes of memory (backup) - ", nTargetSize);
+#endif
+ nTargetSize -= 16 * 1024 * 1024;
+ m_pMem = new (nothrow) unsigned char[nTargetSize];
}
-
- if (m_pMem != NULL)
- {
+ if (m_pMem != NULL) {
+#ifdef _MEMORYDEBUG
+ printf("success!\n");
+#endif
m_nMemSize = nTargetSize;
nAllocatedSize = nTargetSize;
return m_pMem;
}
- else
- {
- m_nMemSize = 0;
+ else {
nAllocatedSize = 0;
return NULL;
}
bool boinc_ReadLinesFromFile(string sPathName, vector<string>& vLine)
{
vLine.clear();
+#ifdef 0
+ vLine.push_back("byte = []");
+ vLine.push_back("alpha = [ABCDEFGHIJKLMNOPQRSTUVWXYZ]");
+ vLine.push_back("alpha-space = [ABCDEFGHIJKLMNOPQRSTUVWXYZ ]");
+ vLine.push_back("alpha-numeric = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]");
+ vLine.push_back("alpha-numeric-space = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ]");
+ vLine.push_back("alpha-numeric-symbol14 = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\x21\x40\x23\x24\x25\x5E\x26\x2A\x28\x29\x2D\x5F\x2B\x3D]");
+ vLine.push_back("alpha-numeric-symbol14-space= [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\x21\x40\x23\x24\x25\x5E\x26\x2A\x28\x29\x2D\x5F\x2B\x3D\x20]");
+ vLine.push_back("all = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\x21\x40\x23\x24\x25\x5E\x26\x2A\x28\x29\x2D\x5F\x2B\x3D\x7E\x60\x5B\x5D\x7B\x7D\x7C\x5C\x3A\x3B\x22\x27\x3C\x3E\x2C\x2E\x3F\x2F]");
+ vLine.push_back("all-space = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\x21\x40\x23\x24\x25\x5E\x26\x2A\x28\x29\x2D\x5F\x2B\x3D\x7E\x60\x5B\x5D\x7B\x7D\x7C\x5C\x3A\x3B\x22\x27\x3C\x3E\x2C\x2E\x3F\x2F\x20]");
+ vLine.push_back("alpha-numeric-symbol32-space = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\x21\x40\x23\x24\x25\x5E\x26\x2A\x28\x29\x2D\x5F\x2B\x3D\x7E\x60\x5B\x5D\x7B\x7D\x7C\x5C\x3A\x3B\x22\x27\x3C\x3E\x2C\x2E\x3F\x2F\x20]");
+ vLine.push_back("lm-frt-cp437 = [\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x7B\x7C\x7D\x7E\x80\x8E\x8F\x90\x92\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA5\xE0\xE1\xE2\xE3\xE4\xE6\xE7\xE8\xE9\xEA\xEB\xEE]");
+ vLine.push_back("lm-frt-cp850 = [\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x7B\x7C\x7D\x7E\x80\x8E\x8F\x90\x92\x99\x9A\x9C\x9D\x9F\xA5\xB5\xB6\xB7\xBD\xBE\xC7\xCF\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xDE\xE0\xE1\xE2\xE3\xE5\xE6\xE8\xE9\xEA\xEB\xED\xEF]");
+ vLine.push_back("lm-frt-cp437-850 = [\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x7B\x7C\x7D\x7E\x80\x8E\x8F\x90\x92\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA5\xB5\xB6\xB7\xBD\xBE\xC7\xCF\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xDE\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xED\xEE\xEF]");
+ vLine.push_back("numeric = [0123456789]");
+ vLine.push_back("numeric-space = [0123456789 ]");
+ vLine.push_back("loweralpha = [abcdefghijklmnopqrstuvwxyz]");
+ vLine.push_back("loweralpha-space = [abcdefghijklmnopqrstuvwxyz ]");
+ vLine.push_back("loweralpha-numeric = [abcdefghijklmnopqrstuvwxyz0123456789]");
+ vLine.push_back("loweralpha-numeric-space = [abcdefghijklmnopqrstuvwxyz0123456789 ]");
+ vLine.push_back("loweralpha-numeric-symbol14 = [abcdefghijklmnopqrstuvwxyz0123456789\x21\x40\x23\x24\x25\x5E\x26\x2A\x28\x29\x2D\x5F\x2B\x3D]");
+ vLine.push_back("loweralpha-numeric-all = [abcdefghijklmnopqrstuvwxyz0123456789\x21\x40\x23\x24\x25\x5E\x26\x2A\x28\x29\x2D\x5F\x2B\x3D\x7E\x60\x5B\x5D\x7B\x7D\x7C\x5C\x3A\x3B\x22\x27\x3C\x3E\x2C\x2E\x3F\x2F]");
+ vLine.push_back("loweralpha-numeric-symbol32-space= [abcdefghijklmnopqrstuvwxyz0123456789\x21\x40\x23\x24\x25\x5E\x26\x2A\x28\x29\x2D\x5F\x2B\x3D\x7E\x60\x5B\x5D\x7B\x7D\x7C\x5C\x3A\x3B\x22\x27\x3C\x3E\x2C\x2E\x3F\x2F\x20]");
+ vLine.push_back("mixalpha = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]");
+ vLine.push_back("mixalpha-space = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ]");
+ vLine.push_back("mixalpha-numeric = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]");
+ vLine.push_back("mixalpha-numeric-space = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ]");
+ vLine.push_back("mixalpha-numeric-symbol14 = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\x21\x40\x23\x24\x25\x5E\x26\x2A\x28\x29\x2D\x5F\x2B\x3D]");
+ vLine.push_back("mixalpha-numeric-all = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\x21\x40\x23\x24\x25\x5E\x26\x2A\x28\x29\x2D\x5F\x2B\x3D\x7E\x60\x5B\x5D\x7B\x7D\x7C\x5C\x3A\x3B\x22\x27\x3C\x3E\x2C\x2E\x3F\x2F]");
+ vLine.push_back("mixalpha-numeric-symbol32-space = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\x21\x40\x23\x24\x25\x5E\x26\x2A\x28\x29\x2D\x5F\x2B\x3D\x7E\x60\x5B\x5D\x7B\x7D\x7C\x5C\x3A\x3B\x22\x27\x3C\x3E\x2C\x2E\x3F\x2F\x20]");
+ vLine.push_back("mixalpha-numeric-all-space = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\x21\x40\x23\x24\x25\x5E\x26\x2A\x28\x29\x2D\x5F\x2B\x3D\x7E\x60\x5B\x5D\x7B\x7D\x7C\x5C\x3A\x3B\x22\x27\x3C\x3E\x2C\x2E\x3F\x2F\x20]");
+#endif
+
char input_path[512];
boinc_resolve_filename(sPathName.c_str(), input_path, sizeof(input_path));
FILE *file = boinc_fopen(input_path, "rb");
long len = GetFileLen(pFileIndex);
fseek(pFileIndex, 0, SEEK_SET);
- m_pIndex = new unsigned char[len];
+ m_pIndex = new (nothrow) unsigned char[len];
+ if(m_pIndex == NULL) {
+ printf("Error allocating %ld MB memory for index in RTI2Reader::RTI2Reader()", len / (1024 * 1024));
+ exit(-2);
+ }
if(fread(m_pIndex, 1, len, pFileIndex) != (unsigned long)len)
{
printf("Error while reading index file");
fseek(m_pFile, 0, SEEK_SET);
if(len % m_chainsizebytes > 0)
{
- printf("Invalid filesize %ld\n", len);
+ printf("Invalid filesize %lu\n", len);
return;
}
return len / m_chainsizebytes - m_chainPosition;
}
-int RTI2Reader::ReadChains(unsigned int &numChains, RainbowChainCP *pData)
+int RTI2Reader::ReadChains(unsigned int &numChains, RainbowChain *pData)
{
if(strncmp(m_pHeader->header, "RTI2", 4) != 0)
{
public:
RTI2Reader(string Filename);
~RTI2Reader(void);
- int ReadChains(unsigned int &numChains, RainbowChainCP *pData);
+ int ReadChains(uint32 &numChains, RainbowChain *pData);
unsigned int GetChainsLeft();
static RTI2Header *GetHeader() { return m_pHeader; }
};
long nFileLen = GetFileLen(m_pFile);
unsigned int nTotalChainCount = nFileLen / 8;
if (nFileLen % 8 != 0)
- printf("file length mismatch (%ld bytes)\n", nFileLen);
+ printf("file length mismatch (%lu bytes)\n", nFileLen);
else
{
// File length check
if (nIndexFileLen % 11 != 0)
- printf("index file length mismatch (%ld bytes)\n", nIndexFileLen);
+ printf("index file length mismatch (%lu bytes)\n", nIndexFileLen);
else
{
- m_pIndex = new IndexChain[nIndexFileLen / 11];
+ if(m_pIndex != NULL) {
+ delete m_pIndex;
+ m_pIndex = NULL;
+ }
+#ifdef _MEMORYDEBUG
+ printf("Allocating %u MB memory for RTIReader::m_pIndex", nIndexFileLen / 11 / (1024 * 1024));
+#endif
+ m_pIndex = new (nothrow) IndexChain[nIndexFileLen / 11];
+ if(m_pIndex == NULL) {
+ printf("\nFailed allocating %ld MB memory.\n", nIndexFileLen / 11 / (1024 * 1024));
+ exit(-2);
+ }
+#ifdef _MEMORYDEBUG
+ printf(" - success!\n");
+#endif
memset(m_pIndex, 0x00, sizeof(IndexChain) * (nIndexFileLen / 11));
fseek(pFileIndex, 0, SEEK_SET);
- int nRows;
- for(nRows = 0; (nRows * 11) < nIndexFileLen; nRows++)
+ //int nRead = 0;
+ uint32 nRows;
+ for(nRows = 0; (nRows * 11) < (uint32)nIndexFileLen; nRows++)
{
if(fread(&m_pIndex[nRows].nPrefix, 5, 1, pFileIndex) != 1) break;
if(fread(&m_pIndex[nRows].nFirstChain, 4, 1, pFileIndex) != 1) break;
}
if(m_pIndex[m_nIndexSize - 1].nFirstChain + m_pIndex[m_nIndexSize - 1].nChainCount > nTotalChainCount) // +1 is not needed here
{
- printf("Corrupted index detected: The index is covering more than the file\n");
+ printf("Corrupted index detected: The index is covering more than the file (%i chains of %i chains)\n", m_pIndex[m_nIndexSize - 1].nFirstChain + m_pIndex[m_nIndexSize - 1].nChainCount, nTotalChainCount);
exit(-1);
}
}
-int RTIReader::ReadChains(unsigned int &numChains, RainbowChainCP *pData)
+int RTIReader::ReadChains(unsigned int &numChains, RainbowChain *pData)
{
// We HAVE to reset the data to 0x00's or we will get in trouble
- memset(pData, 0x00, sizeof(RainbowChainCP) * numChains);
+ memset(pData, 0x00, sizeof(RainbowChain) * numChains);
unsigned int readChains = 0;
unsigned int chainsleft = GetChainsLeft();
- for(unsigned int i = 0; i < m_nIndexSize; i++)
+ for(UINT4 i = 0; i < m_nIndexSize; i++)
{
if(m_chainPosition + readChains > m_pIndex[i].nFirstChain + m_pIndex[i].nChainCount) // We found the matching index
continue;
}
if(readChains == numChains) break;
}
- if(readChains != numChains) numChains = readChains; // Update how many chains we read
+ if(readChains != numChains) {
+ numChains = readChains; // Update how many chains we read
+ }
m_chainPosition += readChains;
+ printf("Chain position is now %u\n", m_chainPosition);
return 0;
}
-unsigned int RTIReader::GetChainsLeft()
-{
- int len = GetFileLen(m_pFile) / 8 - m_chainPosition;
- return len;
+UINT4 RTIReader::GetChainsLeft()
+{
+ return (GetFileLen(m_pFile) / 8) - m_chainPosition;
}
RTIReader::~RTIReader(void)
RTIReader(string Filename);
~RTIReader(void);
- int ReadChains(unsigned int &numChains, RainbowChainCP *pData);
+ int ReadChains(unsigned int &numChains, RainbowChain *pData);
unsigned int GetChainsLeft();
};
{
}
-int RTReader::ReadChains(unsigned int &numChains, RainbowChainCP *pData)
+int RTReader::ReadChains(unsigned int &numChains, RainbowChain *pData)
{
unsigned int numRead = fread(pData, 1, 16 * numChains, m_pFile);
numChains = numRead / 16;
+ m_chainPosition += numChains;
return 0;
}
-unsigned int RTReader::GetChainsLeft()
+UINT4 RTReader::GetChainsLeft()
{
- unsigned int len = GetFileLen(m_pFile);
- return len / 16 - m_chainPosition;
+ return (GetFileLen(m_pFile) / 16) - m_chainPosition;
}
public:
RTReader(string Filename);
~RTReader(void);
- int ReadChains(unsigned int &numChains, RainbowChainCP *pData);
+ int ReadChains(unsigned int &numChains, RainbowChain *pData);
unsigned int GetChainsLeft();
};
*/
#include "des_locl.h"
-#include "spr.h"
+//#include "spr.h"
extern const DES_LONG des_SPtrans[8][64];
+
+
void des_encrypt1(DES_LONG *data, des_key_schedule ks, int enc)
{
register DES_LONG l,r,t,u;
#include <stdio.h>
#include "des_locl.h"
-#include "spr.h"
+//#include "spr.h"
/* char *libdes_version="libdes v 3.24 - 20-Apr-1996 - eay"; */ /* wrong */
/* char *DES_version="DES part of SSLeay 0.6.4 30-Aug-1996"; */
+extern const DES_LONG des_SPtrans[8][64];
+
char *des_options(void)
{
static int init=1;
#include "global.h"
+
+#define MD4_DIGEST_LENGTH 16
+
//Main function
void MD4_NEW( unsigned char * buf, int len, unsigned char * pDigest);
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
-
static const DES_LONG des_skb[8][64]={
{
/* for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 */
* [including the GNU Public Licence.]
*/
+#ifndef __SPR_H__
+#define __SPR_H__
+
const DES_LONG des_SPtrans[8][64]={
{
/* nibble 0 */
0x00000080L, 0x20820000L, 0x00820080L, 0x00000000L,
0x20000000L, 0x20800080L, 0x00020000L, 0x00820080L,
}};
+
+#endif
\ No newline at end of file