From: Martin Westergaard Date: Mon, 1 Nov 2010 18:38:05 +0000 (+0100) Subject: merged paths X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=3d42602c1f746b5768f0e6c9d22884a9806eadc0;hp=26b544e35351c8b5038ae4ba89f9fc04c4863ffe;p=freerainbowtables merged paths --- diff --git a/BOINC software/BOINC client apps/distrrtgen/ChainWalkContext.cpp b/BOINC software/BOINC client apps/distrrtgen/ChainWalkContext.cpp deleted file mode 120000 index 064fbf9..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/ChainWalkContext.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/ChainWalkContext.cpp \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/ChainWalkContext.h b/BOINC software/BOINC client apps/distrrtgen/ChainWalkContext.h deleted file mode 120000 index 0354b19..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/ChainWalkContext.h +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/ChainWalkContext.h \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/HashAlgorithm.cpp b/BOINC software/BOINC client apps/distrrtgen/HashAlgorithm.cpp deleted file mode 120000 index f4c0fb5..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/HashAlgorithm.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/HashAlgorithm.cpp \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/HashAlgorithm.h b/BOINC software/BOINC client apps/distrrtgen/HashAlgorithm.h deleted file mode 120000 index e92bbda..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/HashAlgorithm.h +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/HashAlgorithm.h \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/HashRoutine.cpp b/BOINC software/BOINC client apps/distrrtgen/HashRoutine.cpp deleted file mode 120000 index 27615c9..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/HashRoutine.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/HashRoutine.cpp \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/HashRoutine.h b/BOINC software/BOINC client apps/distrrtgen/HashRoutine.h deleted file mode 120000 index 559c352..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/HashRoutine.h +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/HashRoutine.h \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/Makefile b/BOINC software/BOINC client apps/distrrtgen/Makefile index 153f289..d33961f 100644 --- a/BOINC software/BOINC client apps/distrrtgen/Makefile +++ b/BOINC software/BOINC client apps/distrrtgen/Makefile @@ -28,20 +28,20 @@ BOINC_DIR = /usr/share/boinc-dev BOINC_API_DIR = $(BOINC_DIR)/api BOINC_LIB_DIR = $(BOINC_DIR)/lib COMMON_LIB_DIR = /usr/lib +INCLUDES = -I../../../Common/rt\ api -I$(BOINC_DIR) -I$(BOINC_LIB_DIR) -I$(BOINC_API_DIR) +COMMON_API_PATH = ../../../Common/rt\ api OPTIMIZATION = -O3 CXXFLAGS = -g \ -static -static-libgcc \ - -I$(BOINC_DIR) \ - -I$(BOINC_LIB_DIR) \ - -I$(BOINC_API_DIR) \ -Wall \ -c \ -DBOINC \ + $(INCLUDES) \ $(OPTIMIZATION) -LFLAGS = -static -static-libgcc -Wall $(OPTIMIZATION) -L$(BOINC_API_DIR) \ +LFLAGS = -static -static-libgcc -Wall $(INCLUDES) $(OPTIMIZATION) -L$(BOINC_API_DIR) \ -L$(BOINC_LIB_DIR) -L /usr/X11R6/lib -L. LIBS = -lboinc_api -lboinc -lpthread -lssl libstdc++.a $(COMMON_LIB_DIR)/libssl.a $(COMMON_LIB_DIR)/libpthread.a @@ -65,32 +65,32 @@ distclean: rebuild: clean all -ChainWalkContext.o: ChainWalkContext.h ChainWalkContext.cpp HashRoutine.h Public.h - $(CXX) $(CXXFLAGS) ChainWalkContext.cpp +ChainWalkContext.o: $(COMMON_API_PATH)/ChainWalkContext.h $(COMMON_API_PATH)/ChainWalkContext.cpp $(COMMON_API_PATH)/HashRoutine.h $(COMMON_API_PATH)/Public.h + $(CXX) $(CXXFLAGS) $(COMMON_API_PATH)/ChainWalkContext.cpp -des_enc.o: des_enc.c des_locl.h spr.h - $(CXX) $(CXXFLAGS) des_enc.c +des_enc.o: $(COMMON_API_PATH)/des_enc.c $(COMMON_API_PATH)/des_locl.h $(COMMON_API_PATH)/spr.h + $(CXX) $(CXXFLAGS) $(COMMON_API_PATH)/des_enc.c -des_setkey.o: des_setkey.c des_locl.h podd.h sk.h - $(CXX) $(CXXFLAGS) des_setkey.c +des_setkey.o: $(COMMON_API_PATH)/des_setkey.c $(COMMON_API_PATH)/des_locl.h $(COMMON_API_PATH)/podd.h $(COMMON_API_PATH)/sk.h + $(CXX) $(CXXFLAGS) $(COMMON_API_PATH)/des_setkey.c -distrrtgen.o: distrrtgen.cpp distrrtgen.h ChainWalkContext.h Public.h +distrrtgen.o: distrrtgen.cpp distrrtgen.h $(COMMON_API_PATH)/ChainWalkContext.h $(COMMON_API_PATH)/Public.h $(CXX) $(CXXFLAGS) distrrtgen.cpp -ecb_enc.o: ecb_enc.c des_locl.h spr.h - $(CXX) $(CXXFLAGS) ecb_enc.c +ecb_enc.o: $(COMMON_API_PATH)/ecb_enc.c $(COMMON_API_PATH)/des_locl.h $(COMMON_API_PATH)/spr.h + $(CXX) $(CXXFLAGS) $(COMMON_API_PATH)/ecb_enc.c -HashAlgorithm.o: HashAlgorithm.h HashAlgorithm.cpp Public.h md4.h md5.h - $(CXX) $(CXXFLAGS) HashAlgorithm.cpp +HashAlgorithm.o: $(COMMON_API_PATH)/HashAlgorithm.h $(COMMON_API_PATH)/HashAlgorithm.cpp $(COMMON_API_PATH)/Public.h $(COMMON_API_PATH)/md4.h $(COMMON_API_PATH)/md5.h + $(CXX) $(CXXFLAGS) $(COMMON_API_PATH)/HashAlgorithm.cpp -HashRoutine.o: HashRoutine.h HashRoutine.cpp global.h HashAlgorithm.h - $(CXX) $(CXXFLAGS) HashRoutine.cpp +HashRoutine.o: $(COMMON_API_PATH)/HashRoutine.h $(COMMON_API_PATH)/HashRoutine.cpp $(COMMON_API_PATH)/global.h $(COMMON_API_PATH)/HashAlgorithm.h + $(CXX) $(CXXFLAGS) $(COMMON_API_PATH)/HashRoutine.cpp -md4.o: md4.h md4.cpp global.h - $(CXX) $(CXXFLAGS) md4.cpp +md4.o: $(COMMON_API_PATH)/md4.h $(COMMON_API_PATH)/md4.cpp $(COMMON_API_PATH)/global.h + $(CXX) $(CXXFLAGS) $(COMMON_API_PATH)/md4.cpp -md5.o: md5.h md5.cpp global.h - $(CXX) $(CXXFLAGS) md5.cpp +md5.o: $(COMMON_API_PATH)/md5.h $(COMMON_API_PATH)/md5.cpp $(COMMON_API_PATH)/global.h + $(CXX) $(CXXFLAGS) $(COMMON_API_PATH)/md5.cpp -Public.o: Public.h Public.cpp global.h - $(CXX) $(CXXFLAGS) Public.cpp +Public.o: $(COMMON_API_PATH)/Public.h $(COMMON_API_PATH)/Public.cpp $(COMMON_API_PATH)/global.h + $(CXX) $(CXXFLAGS) $(COMMON_API_PATH)/Public.cpp diff --git a/BOINC software/BOINC client apps/distrrtgen/Public.cpp b/BOINC software/BOINC client apps/distrrtgen/Public.cpp deleted file mode 120000 index c5461fe..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/Public.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/Public.cpp \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/Public.h b/BOINC software/BOINC client apps/distrrtgen/Public.h deleted file mode 120000 index 20d6e3d..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/Public.h +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/Public.h \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/des.h b/BOINC software/BOINC client apps/distrrtgen/des.h deleted file mode 120000 index a4f1427..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/des.h +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/des.h \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/des_enc.c b/BOINC software/BOINC client apps/distrrtgen/des_enc.c deleted file mode 120000 index fea90ea..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/des_enc.c +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/des_enc.c \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/des_locl.h b/BOINC software/BOINC client apps/distrrtgen/des_locl.h deleted file mode 120000 index 6cd2649..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/des_locl.h +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/des_locl.h \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/des_setkey.c b/BOINC software/BOINC client apps/distrrtgen/des_setkey.c deleted file mode 120000 index c4ad7a9..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/des_setkey.c +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/des_setkey.c \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/distrrtgen.sln b/BOINC software/BOINC client apps/distrrtgen/distrrtgen.sln index 24b2d5b..6969853 100644 --- a/BOINC software/BOINC client apps/distrrtgen/distrrtgen.sln +++ b/BOINC software/BOINC client apps/distrrtgen/distrrtgen.sln @@ -1,9 +1,9 @@  -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 @@ -15,7 +15,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rtperfectp", "..\..\standal 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 diff --git a/BOINC software/BOINC client apps/distrrtgen/distrrtgen.suo b/BOINC software/BOINC client apps/distrrtgen/distrrtgen.suo index efe937a..5691790 100644 Binary files a/BOINC software/BOINC client apps/distrrtgen/distrrtgen.suo and b/BOINC software/BOINC client apps/distrrtgen/distrrtgen.suo differ diff --git a/BOINC software/BOINC client apps/distrrtgen/distrrtgen.vcxproj b/BOINC software/BOINC client apps/distrrtgen/distrrtgen.vcxproj new file mode 100644 index 0000000..0fb305c --- /dev/null +++ b/BOINC software/BOINC client apps/distrrtgen/distrrtgen.vcxproj @@ -0,0 +1,230 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {A3BDF5F8-4D0A-4B27-B1D9-7E77CBDA86C7} + distrrtgen + Win32Proj + + + + Application + NotSet + true + + + Application + NotSet + + + Application + NotSet + true + + + Application + NotSet + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + C:\lib\boinc\Win32\Release;$(LibraryPath) + + + + Disabled + ../../../common/rt api;%(AdditionalIncludeDirectories) + BOINC;WIN32;_DEBUG;_MT;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + libcmtd.lib;libcpmtd.lib;kernel32.lib;user32.lib;ole32.lib;delayimp.lib;C:\lib\boinc\Win32\Debug\libboinc_staticcrt.lib;C:\lib\boinc\Win32\Debug\libboincapi_staticcrt.lib;%(AdditionalDependencies) + true + true + Console + MachineX86 + + + + + MaxSpeed + AnySuitable + true + Speed + true + ..\..\..\Common\rt api;%(AdditionalIncludeDirectories) + BOINC;WIN32;NDEBUG;_MT;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + true + StreamingSIMDExtensions + + + Level3 + ProgramDatabase + false + + + 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) + true + false + Windows + true + true + false + + + MachineX86 + + + + + X64 + + + Disabled + /boinc/lib;/boinc/api;/boinc/zip;/boinc/client/win;/boinc/;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_MT;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + libcmtd.lib;libcpmtd.lib;kernel32.lib;user32.lib;ole32.lib;delayimp.lib;C:\lib\boinc\x64\Debug\libboinc_staticcrt.lib;C:\lib\boinc\x64\Debug\libboincapi_staticcrt.lib;%(AdditionalDependencies) + true + true + Console + MachineX64 + + + + + X64 + + + MaxSpeed + AnySuitable + true + Speed + true + /boinc/lib;/boinc/api;/boinc/zip;/boinc/client/win;/boinc/;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_MT;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + false + false + StreamingSIMDExtensions2 + Fast + + + Level3 + ProgramDatabase + + + odbc32.lib;odbccp32.lib;libcmt.lib;libcpmt.lib;C:\lib\boinc\x64\Release\libboinc_staticcrt.lib;C:\lib\boinc\x64\Release\libboincapi_staticcrt.lib;%(AdditionalDependencies) + true + true + Windows + true + true + false + + + MachineX64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/distrrtgen.vcxproj.filters b/BOINC software/BOINC client apps/distrrtgen/distrrtgen.vcxproj.filters new file mode 100644 index 0000000..8dc6044 --- /dev/null +++ b/BOINC software/BOINC client apps/distrrtgen/distrrtgen.vcxproj.filters @@ -0,0 +1,90 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/distrrtgen.vcxproj.user b/BOINC software/BOINC client apps/distrrtgen/distrrtgen.vcxproj.user new file mode 100644 index 0000000..ace9a86 --- /dev/null +++ b/BOINC software/BOINC client apps/distrrtgen/distrrtgen.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/ecb_enc.c b/BOINC software/BOINC client apps/distrrtgen/ecb_enc.c deleted file mode 120000 index b710750..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/ecb_enc.c +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/ecb_enc.c \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/global.h b/BOINC software/BOINC client apps/distrrtgen/global.h deleted file mode 120000 index a5e31dc..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/global.h +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/global.h \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/md4.cpp b/BOINC software/BOINC client apps/distrrtgen/md4.cpp deleted file mode 120000 index 3fec1a7..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/md4.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/md4.cpp \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/md4.h b/BOINC software/BOINC client apps/distrrtgen/md4.h deleted file mode 120000 index 176b68b..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/md4.h +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/md4.h \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/md5.cpp b/BOINC software/BOINC client apps/distrrtgen/md5.cpp deleted file mode 120000 index 6d0108c..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/md5.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/md5.cpp \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/md5.h b/BOINC software/BOINC client apps/distrrtgen/md5.h deleted file mode 120000 index fc508f3..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/md5.h +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/md5.h \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/podd.h b/BOINC software/BOINC client apps/distrrtgen/podd.h deleted file mode 120000 index ba3ebfe..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/podd.h +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/podd.h \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/sk.h b/BOINC software/BOINC client apps/distrrtgen/sk.h deleted file mode 120000 index 159cee2..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/sk.h +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/sk.h \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen/spr.h b/BOINC software/BOINC client apps/distrrtgen/spr.h deleted file mode 120000 index 30dd973..0000000 --- a/BOINC software/BOINC client apps/distrrtgen/spr.h +++ /dev/null @@ -1 +0,0 @@ -../../../Common/rt api/spr.h \ No newline at end of file diff --git a/BOINC software/BOINC client apps/distrrtgen_cuda/distrrtgen.cpp b/BOINC software/BOINC client apps/distrrtgen_cuda/distrrtgen.cpp new file mode 100644 index 0000000..001e54a --- /dev/null +++ b/BOINC software/BOINC client apps/distrrtgen_cuda/distrrtgen.cpp @@ -0,0 +1,373 @@ +// 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 . + +// 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 +#include "boinc_win.h" +#else +#include "config.h" +#include +#include +#include +#include +#include +#include +#include +#endif + +#include +#include +#include +#include "str_util.h" +#include "util.h" +#include "filesys.h" +#include "boinc_api.h" +#include "Public.h" +// Rainbowcrack code +#include "ChainWalkContext.h" +//typedef unsigned int uint32; +//typedef unsigned __int64 uint64; +#include "rcuda.h" +#include "rcuda_ext.h" + + +using std::string; + +/* +bool early_exit = false; +bool early_crash = false; +bool early_sleep = false; +double cpu_time = 20, comp_result; +*/ +int QuickSortPartition(RainbowChainCP* pChain, int nLow, int nHigh) +{ + int nRandomIndex = nLow + ((unsigned int)rand() * (RAND_MAX + 1) + (unsigned int)rand()) % (nHigh - nLow + 1); + RainbowChainCP TempChain; + TempChain = pChain[nLow]; + pChain[nLow] = pChain[nRandomIndex]; + pChain[nRandomIndex] = TempChain; + + TempChain = pChain[nLow]; + uint64 nPivotKey = pChain[nLow].nIndexE; + while (nLow < nHigh) + { + while (nLow < nHigh && pChain[nHigh].nIndexE >= nPivotKey) + nHigh--; + pChain[nLow] = pChain[nHigh]; + while (nLow < nHigh && pChain[nLow].nIndexE <= nPivotKey) + nLow++; + pChain[nHigh] = pChain[nLow]; + } + pChain[nLow] = TempChain; + return nLow; +} + +void QuickSort(RainbowChainCP* pChain, int nLow, int nHigh) +{ + if (nLow < nHigh) + { + int nPivotLoc = QuickSortPartition(pChain, nLow, nHigh); + QuickSort(pChain, nLow, nPivotLoc - 1); + QuickSort(pChain, nPivotLoc + 1, nHigh); + } +} + +int main(int argc, char **argv) { + int retval; + double fd; + char output_path[512], chkpt_path[512]; + FILE* state; + 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 < 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 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 stPlain; + ex.Init(); +time_t tStart, tStartFinal, tEndFinal; +time_t tEnd; + tStartFinal = time(NULL); + for(int nCurrentCalculatedChains = nDataLen / 18, calcSize; nCurrentCalculatedChains < nRainbowChainCount; ) + { + fd = (double)nCurrentCalculatedChains / (double)nRainbowChainCount; + boinc_fraction_done(fd); + + cuTask.hash = ex.GetHash(); + cuTask.startIdx = nChainStart + nCurrentCalculatedChains; + cuTask.idxCount = std::min(nRainbowChainCount - nCurrentCalculatedChains, maxCalcBuffSize); + cuTask.stPlainSize = ex.IndexToStartPlain(0, stPlain); + cuTask.stPlain = &stPlain[0]; + cuTask.dimVec = ex.GetPlainDimVec(); + cuTask.dimVecSize = ex.GetPlainDimVecSize()/3; + cuTask.charSet = ex.GetCharSet(); + cuTask.charSetSize = ex.GetCharSetSize(); + cuTask.cpPositions = &vCPPositions[0]; + cuTask.cpPosSize = vCPPositions.size(); + cuTask.reduceOffset = ex.GetReduceOffset(); + cuTask.plainSpaceTotal = ex.GetPlainSpaceTotal(); + cuTask.rainbowChainLen = nRainbowChainLen; + for(int ii = 0; ii < cuTask.idxCount; ii++) { + calcBuff[2*ii] = cuTask.startIdx + ii; + calcBuff[2*ii+1] = 0; + } + + tStart = time(NULL); + + calcSize = rcuda::CalcChainsOnCUDA(&cuTask, calcBuff); + tEnd = time(NULL); + std::cerr << "CUDA time taken: " << tEnd - tStart << std::endl; + tStart = time(NULL); + if(calcSize > 0) { + nCurrentCalculatedChains += calcSize; + for(ii = 0; ii < cuTask.idxCount; ii++) { + nIndex[0] = cuTask.startIdx + ii; + nReturn = fwrite(nIndex, 1, 8, outfile); + nReturn += fwrite(calcBuff+(2*ii), 1, 8, outfile); + nReturn += fwrite(calcBuff+(2*ii+1), 1, 2, outfile); + if(nReturn != 18) { + std::cerr << "disk write fail" << std::endl; + fclose(outfile); + return 9; + } + } + } else { + std::cerr << "Calculations on CUDA failed!" << std::endl; + fclose(outfile); + return 0; + } + } + tEndFinal = time(NULL); + std::cerr << "Time taken: " << tEndFinal - tStartFinal << " secs" << std::endl; + delete [] calcBuff; +#ifdef _DEBUG + std::cout << "Generation completed" << std::endl; +#endif + fseek(outfile, 0, SEEK_SET); + nFileLen = GetFileLen(outfile); + nRainbowChainCount = nFileLen / 18; + + RainbowChainCP* pChain = (RainbowChainCP*)new unsigned char[sizeof(RainbowChainCP) * nRainbowChainCount]; + + if (pChain != NULL) + { + // Load file +#ifdef _DEBUG + std::cout << "Sorting file" << std::endl; +#endif + fseek(outfile, 0, SEEK_SET); + for(int i = 0; i < nRainbowChainCount; i++) + { + if(fread(&pChain[i], 1, 16, outfile) != 16) + { + printf("disk read fail\n"); + return 9; + } + if(fread(&pChain[i].nCheckPoint, 1, sizeof(pChain[i].nCheckPoint), outfile) != 2) + { + printf("disk read fail\n"); + return 9; + } + } + + // Sort file + QuickSort(pChain, 0, nRainbowChainCount - 1); + + // Write file + fseek(outfile, 0, SEEK_SET); + for(int i = 0; i < nRainbowChainCount; i++) + { + fwrite(&pChain[i], 1, 16, outfile); + fwrite(&pChain[i].nCheckPoint, 2, 1, outfile); + } + delete[] pChain; + } + + 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 $"; + diff --git a/BOINC software/BOINC client apps/distrrtgen_cuda/distrrtgen.sln b/BOINC software/BOINC client apps/distrrtgen_cuda/distrrtgen.sln new file mode 100644 index 0000000..1fc1879 --- /dev/null +++ b/BOINC software/BOINC client apps/distrrtgen_cuda/distrrtgen.sln @@ -0,0 +1,20 @@ + +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 +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 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/BOINC software/BOINC client apps/distrrtgen_cuda/distrrtgen.vcproj b/BOINC software/BOINC client apps/distrrtgen_cuda/distrrtgen.vcproj new file mode 100644 index 0000000..2975f17 --- /dev/null +++ b/BOINC software/BOINC client apps/distrrtgen_cuda/distrrtgen.vcproj @@ -0,0 +1,327 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BOINC software/BOINC client apps/distrrtgen_cuda/rcuda.cu b/BOINC software/BOINC client apps/distrrtgen_cuda/rcuda.cu new file mode 100644 index 0000000..e626bd4 --- /dev/null +++ b/BOINC software/BOINC client apps/distrrtgen_cuda/rcuda.cu @@ -0,0 +1,326 @@ +#include +#include +#include "rcuda.h" + +#define GRID_X_L2 6 +#define GRID_Y_L2 6 +#define BLOCK_X_L2 7 +#define GRID_X_SIZE (1<>(32-r[i])); + ret += b; + return ret; +} + +__device__ unsigned int GG(unsigned int a, unsigned int b, unsigned int c, unsigned int d, int i, const unsigned int* data) { + unsigned int ret; + ret = a + ((b&d)|(c&(~d))) + ac[i] + data[SHIDX(g[i])]; + ret = (ret<>(32-r[i])); + ret += b; + return ret; +} + +__device__ unsigned int HH(unsigned int a, unsigned int b, unsigned int c, unsigned int d, int i, const unsigned int* data) { + unsigned int ret; + ret = a + (b^c^d) + ac[i] + data[SHIDX(g[i])]; + ret = (ret<>(32-r[i])); + ret += b; + return ret; +} + +__device__ unsigned int II(unsigned int a, unsigned int b, unsigned int c, unsigned int d, int i, const unsigned int* data) { + unsigned int ret; + ret = a + (c^(b|(~d))) + ac[i] + data[SHIDX(g[i])]; + ret = (ret<>(32-r[i])); + ret += b; + return ret; +} + +__device__ void MD5(unsigned int* dataHash) { + unsigned int a = h[0], b = h[1], c = h[2], d = h[3], x; + int ii; + + // Round 1 + for(ii = 0; ii < 16; ii++) { + x = b; + b = FF(a, b, c, d, ii, dataHash); + a = d; d = c; c = x; + } + + // Round 2 + for(; ii < 32; ii++) { + x = b; + b = GG(a, b, c, d, ii, dataHash); + a = d; d = c; c = x; + } + + // Round 3 + for(; ii < 48; ii++) { + x = b; + b = HH(a, b, c, d, ii, dataHash); + a = d; d = c; c = x; + } + + // Round 4 + for(; ii < 64; ii++) { + x = b; + b = II(a, b, c, d, ii, dataHash); + a = d; d = c; c = x; + } + + dataHash[SHIDX(0)] = a + h[0]; + dataHash[SHIDX(1)] = b + h[1]; + dataHash[SHIDX(2)] = c + h[2]; + dataHash[SHIDX(3)] = d + h[3]; +} + + +#define PLAIN_MAX_SIZE 20 + +__device__ unsigned __int64 *dataHeap; +__device__ unsigned char *plStart; +__device__ uint3 *plDimVec; +__device__ unsigned char *plChrSet; +__device__ int *plCpPos; +__device__ int plCpPosSize; +__device__ unsigned __int64 reduceOffset; +__device__ unsigned __int64 plainSpaceTotal; +__device__ unsigned __int64 rPlainSpaceTotal; + + +__global__ void RTGenMD5Kernel(unsigned int chainStart, unsigned int chainStop) { + unsigned int *hData; + uint3 dimItem; + unsigned int uiVal, uiMul, uiDiv, idx; + unsigned __int64 uiVal64, uiMul64, uiDiv64, idx64; + unsigned int nPos, size, ii, jj, kk; + unsigned int cpcheck, checkpoint; + unsigned int plain; + + __shared__ unsigned int shData[SHIDX(BLOCK_X_SIZE)]; + + if(threadIdx.x == 0) { + nPos = ((((blockIdx.y<>4)<<8)+(ii&15); + hData[SHIDX(0)] = dataHeap[nPos]; + hData[SHIDX(1)] = dataHeap[nPos]>>32; + hData[SHIDX(2)] = dataHeap[nPos+1]; + } + } + __syncthreads(); + + hData = shData + ((threadIdx.x>>4)<<8)+(threadIdx.x&15); + + idx64 = hData[SHIDX(1)]; + idx64 = (idx64<<32) | hData[SHIDX(0)]; + cpcheck = hData[SHIDX(2)]; + checkpoint = cpcheck&0x0000ffff; + cpcheck = cpcheck>>16; + + for(nPos = chainStart; nPos < chainStop; nPos++) { + // transform to the plain text + plain = 0x80; + jj = (PLAIN_MAX_SIZE>>2)+1; + for(ii = 0; idx64 > 0xfffffff0ull && ii < PLAIN_MAX_SIZE; ii++) { + uiVal64 = idx64 + plStart[ii]; + uiVal64--; + dimItem = plDimVec[ii]; + uiMul64 = (unsigned __int64)dimItem.y<<32; + idx64 = __umul64hi(uiVal64, uiMul64); + uiDiv64 = uiVal64 - idx64*(unsigned __int64)dimItem.x; + uiVal = __umulhi((unsigned int)uiDiv64, dimItem.y); + uiDiv = (unsigned int)uiDiv64 - uiVal * dimItem.x; + idx64 += uiVal; + if(uiDiv >= dimItem.x) { + uiDiv -= dimItem.x; + idx64++; + } + plain = (plain<<8) | plChrSet[dimItem.z + uiDiv]; + if((ii&3) == 2) { + hData[SHIDX(jj--)] = plain; + plain = 0; + } + } + for(idx = (unsigned int)idx64; idx != 0 && ii < PLAIN_MAX_SIZE; ii++) { + uiVal = idx + plStart[ii]; + uiVal--; + dimItem = plDimVec[ii]; + idx = __umulhi(uiVal, dimItem.y); + uiDiv = uiVal - idx*dimItem.x; + if(uiDiv >= dimItem.x) { + uiDiv -= dimItem.x; + idx++; + } + plain = (plain<<8) | plChrSet[dimItem.z + uiDiv]; + if((ii&3) == 2) { + hData[SHIDX(jj--)] = plain; + plain = 0; + } + } + + // prepare for MD5 + size = ii; + ii = ((((3-(ii&3))<<3)-1)&0x1f)+1; + plain = plain<>2)+1; plain = hData[SHIDX(jj++)], kk++) + hData[SHIDX(kk)] = (plain>>ii)|(hData[SHIDX(jj)]<<(32-ii)); + hData[SHIDX(kk)] = plain>>ii; + for(kk++; kk < 14; kk++) + hData[SHIDX(kk)] = 0; + hData[SHIDX(kk++)] = size<<3; + hData[SHIDX(kk)] = 0; + + // hash + MD5(hData); + + idx64 = hData[SHIDX(1)]; + idx64 = (idx64<<32) | hData[SHIDX(0)]; + idx64 += reduceOffset + nPos; + uiDiv64 = __umul64hi(idx64, rPlainSpaceTotal); + idx64 -= uiDiv64*plainSpaceTotal; + if(idx64 >= plainSpaceTotal) + idx64 -= plainSpaceTotal; + + if(cpcheck < plCpPosSize && nPos == plCpPos[cpcheck]) { + checkpoint |= ((unsigned int)idx64&1) << cpcheck; + cpcheck++; + } + } + + hData[SHIDX(0)] = idx64; + hData[SHIDX(1)] = idx64>>32; + hData[SHIDX(2)] = (cpcheck<<16)|(checkpoint&0x0000ffff); + __syncthreads(); + + if(threadIdx.x == 0) { + nPos = ((((blockIdx.y<>4)<<8)+(ii&15); + dataHeap[nPos] = ((unsigned __int64)hData[SHIDX(1)]<<32)|(unsigned __int64)hData[SHIDX(0)]; + dataHeap[nPos+1] = hData[SHIDX(2)]; + } + } + __syncthreads(); +} + + +extern "C" int CalcChainsOnCUDA(const rcuda::RCudaTask* task, unsigned __int64 *resultBuff) { + cudaError_t cuErr; + char buff[PLAIN_MAX_SIZE]; + unsigned __int64 *data; + unsigned char *stPlain; + uint3 *dimVec; + unsigned char *charSet; + int *cpPos; + unsigned __int64 uiVal64; + time_t tStart, tEnd; + if(task->hash != rcuda::RHASH_MD5) + return 0; + + memset(buff, 0, PLAIN_MAX_SIZE); + cudaMalloc((void**)&data, task->idxCount*2*sizeof(unsigned __int64)); + cudaMalloc((void**)&stPlain, PLAIN_MAX_SIZE); + cudaMalloc((void**)&dimVec, task->dimVecSize*sizeof(uint3)); + cudaMalloc((void**)&charSet, task->charSetSize); + cudaMalloc((void**)&cpPos, task->cpPosSize*sizeof(int)); + + cudaMemcpy(data, resultBuff, task->idxCount*2*sizeof(unsigned __int64), cudaMemcpyHostToDevice); + cudaMemcpy(stPlain, buff, PLAIN_MAX_SIZE, cudaMemcpyHostToDevice); + cudaMemcpy(stPlain, task->stPlain, min(task->stPlainSize, PLAIN_MAX_SIZE), cudaMemcpyHostToDevice); + cudaMemcpy(dimVec, task->dimVec, task->dimVecSize*sizeof(uint3), cudaMemcpyHostToDevice); + cudaMemcpy(charSet, task->charSet, task->charSetSize, cudaMemcpyHostToDevice); + cudaMemcpy(cpPos, task->cpPositions, task->cpPosSize*sizeof(int), cudaMemcpyHostToDevice); + + cudaMemcpyToSymbol(dataHeap, &data, sizeof(data)); + cudaMemcpyToSymbol(plStart, &stPlain, sizeof(stPlain)); + cudaMemcpyToSymbol(plDimVec, &dimVec, sizeof(dimVec)); + cudaMemcpyToSymbol(plChrSet, &charSet, sizeof(charSet)); + cudaMemcpyToSymbol(plCpPos, &cpPos, sizeof(cpPos)); + cudaMemcpyToSymbol(plCpPosSize, &task->cpPosSize, sizeof(task->cpPosSize)); + cudaMemcpyToSymbol(reduceOffset, &task->reduceOffset, sizeof(task->reduceOffset)); + cudaMemcpyToSymbol(plainSpaceTotal, &task->plainSpaceTotal, sizeof(task->plainSpaceTotal)); + uiVal64 = (unsigned __int64)-1/task->plainSpaceTotal; + cudaMemcpyToSymbol(rPlainSpaceTotal, &uiVal64, sizeof(uiVal64)); + + int grSizeX = (task->idxCount-1)/BLOCK_X_SIZE + 1; + int grSizeY = (grSizeX-1)/GRID_X_SIZE + 1; + grSizeX = GRID_X_SIZE; + dim3 numBlocks(grSizeX, grSizeY); + cuErr = cudaSuccess; + tStart = time(NULL); + for(int idx = 0; idx < task->rainbowChainLen-1 && cuErr == cudaSuccess; idx+=KERN_CHAIN_SIZE) { + RTGenMD5Kernel<<>>(idx, min(idx+KERN_CHAIN_SIZE, task->rainbowChainLen-1)); + cuErr = cudaGetLastError(); + if(cuErr == cudaSuccess) + cuErr = cudaThreadSynchronize(); + + } + tEnd = time(NULL); + fprintf(stderr, "Kernel run time: %i\n", (tEnd - tStart)); + + if(cuErr == cudaSuccess) + cudaMemcpy(resultBuff, data, task->idxCount*2*sizeof(unsigned __int64), cudaMemcpyDeviceToHost); + else + fprintf(stderr, "Error happened: %d (%s)\n", cuErr, cudaGetErrorString(cuErr)); + + cudaFree(cpPos); + cudaFree(charSet); + cudaFree(dimVec); + cudaFree(stPlain); + cudaFree(data); + return cuErr==cudaSuccess? task->idxCount : -1; +} + +extern "C" int GetChainsBufferSize(int minSize) { + int grSizeX = (minSize-1)/BLOCK_X_SIZE + 1; + int grSizeY = (grSizeX-1)/GRID_X_SIZE + 1; + grSizeX = GRID_X_SIZE; + return grSizeX*grSizeY*BLOCK_X_SIZE; +} diff --git a/BOINC software/BOINC client apps/distrrtgen_cuda/rcuda.h b/BOINC software/BOINC client apps/distrrtgen_cuda/rcuda.h new file mode 100644 index 0000000..eeeac69 --- /dev/null +++ b/BOINC software/BOINC client apps/distrrtgen_cuda/rcuda.h @@ -0,0 +1,30 @@ +#ifndef RCUDA_H +#define RCUDA_H + +namespace rcuda { + +enum RHash { RHASH_UNDEF = -1, RHASH_LM, RHASH_MD4, RHASH_MD5, RHASH_SHA1, RHASH_NTLM }; + +struct RCudaTask { + RHash hash; + unsigned __int64 startIdx; + int idxCount; + unsigned char* stPlain; + int stPlainSize; + unsigned int* dimVec; + int dimVecSize; + unsigned char* charSet; + int charSetSize; + int *cpPositions; + int cpPosSize; + unsigned __int64 reduceOffset; + unsigned __int64 plainSpaceTotal; + unsigned int rainbowChainLen; +}; + +extern "C" int CalcChainsOnCUDA(const RCudaTask* task, unsigned __int64 *resultBuff); +extern "C" int GetChainsBufferSize(int minSize); + +} + +#endif //RCUDA_H diff --git a/BOINC software/BOINC client apps/distrrtgen_cuda/rcuda_ext.cpp b/BOINC software/BOINC client apps/distrrtgen_cuda/rcuda_ext.cpp new file mode 100644 index 0000000..86f31ec --- /dev/null +++ b/BOINC software/BOINC client apps/distrrtgen_cuda/rcuda_ext.cpp @@ -0,0 +1,85 @@ +//============================================================================ +// Name : rcuda_ext.cpp +// Author : Jan Kyska +// Version : 0.9 +// Description : A code to access internals of the CChainWalkContext +// for the CUDA generator of FreeRainbowTables +//============================================================================ + +#include "rcuda_ext.h" +#include +#include +#include +#include +#include + +CudaCWCExtender::CudaCWCExtender(CChainWalkContext *cwc) { + this->cwc = cwc; + hash = rcuda::RHASH_UNDEF; +} + +void CudaCWCExtender::Init(void) { + std::string hashName; + int ii, jj; + + plainDimVec.clear(); + plainCharSet.clear(); + + hashName = CChainWalkContext::m_sHashRoutineName; + std::transform(hashName.begin(), hashName.end(), hashName.begin(), tolower); + if(hashName.compare("lm") == 0) + hash = rcuda::RHASH_LM; + else if(hashName.compare("md4") == 0) + hash = rcuda::RHASH_MD4; + else if(hashName.compare("md5") == 0) + hash = rcuda::RHASH_MD5; + else if(hashName.compare("sha1") == 0) + hash = rcuda::RHASH_SHA1; + else if(hashName.compare("ntlm") == 0) + hash = rcuda::RHASH_NTLM; + else + hash = rcuda::RHASH_UNDEF; + + for(ii = 0; ii < (int)CChainWalkContext::m_vCharset.size(); ii++) { + stCharset &chs = CChainWalkContext::m_vCharset[ii]; + int chSetOffset = plainCharSet.size(); + plainCharSet.append((char*)chs.m_PlainCharset, chs.m_nPlainCharsetLen); + for(jj = 0; jj < chs.m_nPlainLenMax; jj++) { + plainDimVec.push_back((unsigned int)chs.m_nPlainCharsetLen); + plainDimVec.push_back((unsigned int)-1/(unsigned int)chs.m_nPlainCharsetLen); + plainDimVec.push_back((unsigned int)chSetOffset); + } + } +} + +int CudaCWCExtender::IndexToStartPlain(const uint64 nIndex, std::vector& stPlain) { + int nPlainLen, nCharsetLen; + int ii, jj; + + stPlain.clear(); + stPlain.reserve(0x20); + nPlainLen = 0; + for(ii = CChainWalkContext::m_nPlainLenMaxTotal - 1; ii >= CChainWalkContext::m_nPlainLenMinTotal - 1; ii--) { + if(nIndex >= CChainWalkContext::m_nPlainSpaceUpToX[ii]) { + nPlainLen = ii + 1; + break; + } + } + if(nPlainLen == 0) + nPlainLen = CChainWalkContext::m_nPlainLenMinTotal; + uint64 nIndexOfX = nIndex - CChainWalkContext::m_nPlainSpaceUpToX[nPlainLen - 1]; + + // Slow version, but never mind + for(ii = nPlainLen - 1; ii >= 0; ii--) { + nCharsetLen = 0; + for(jj = 0; jj < (int)CChainWalkContext::m_vCharset.size(); jj++) { + stCharset &chs = CChainWalkContext::m_vCharset[jj]; + nCharsetLen += chs.m_nPlainLenMax; + if(ii < nCharsetLen) { // We found the correct charset + stPlain.push_back(nIndexOfX % chs.m_nPlainCharsetLen + 1); + nIndexOfX /= chs.m_nPlainCharsetLen; + } + } + } + return stPlain.size(); +} diff --git a/BOINC software/BOINC client apps/distrrtgen_cuda/rcuda_ext.h b/BOINC software/BOINC client apps/distrrtgen_cuda/rcuda_ext.h new file mode 100644 index 0000000..93c2d59 --- /dev/null +++ b/BOINC software/BOINC client apps/distrrtgen_cuda/rcuda_ext.h @@ -0,0 +1,29 @@ +#ifndef RCUDA_EXT_H +#define RCUDA_EXT_H + +#include "rcuda.h" +#include "ChainWalkContext.h" + +class CudaCWCExtender { +public: + CudaCWCExtender(CChainWalkContext *cwc); + void Init(void); + int IndexToStartPlain(const uint64 nIndex, std::vector& stPlain); + + inline rcuda::RHash GetHash(void) { return hash; } + inline unsigned int* GetPlainDimVec(void) { return &plainDimVec[0]; } + inline int GetPlainDimVecSize(void) { return plainDimVec.size(); } + inline unsigned char* GetCharSet(void) { return (unsigned char*)plainCharSet.c_str(); } + inline int GetCharSetSize(void) { return plainCharSet.size(); } + inline uint64 GetPlainSpaceTotal(void) { return CChainWalkContext::m_nPlainSpaceTotal; } + inline uint64 GetRainbowTableIndex(void) { return CChainWalkContext::m_nRainbowTableIndex; } + inline uint64 GetReduceOffset(void) { return CChainWalkContext::m_nReduceOffset; } + +protected: + CChainWalkContext *cwc; + rcuda::RHash hash; + std::vector plainDimVec; + std::string plainCharSet; +}; + +#endif //RCUDA_EXT_H diff --git a/BOINC software/BOINC client apps/win_build/boinc_apps.sln b/BOINC software/BOINC client apps/win_build/boinc_apps.sln new file mode 100644 index 0000000..ac2739c --- /dev/null +++ b/BOINC software/BOINC client apps/win_build/boinc_apps.sln @@ -0,0 +1,26 @@ + +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 diff --git a/Client Applications/converti2/converti2.suo b/Client Applications/converti2/converti2.suo new file mode 100644 index 0000000..969775d Binary files /dev/null and b/Client Applications/converti2/converti2.suo differ diff --git a/Client Applications/rcracki_mt/ChangeLog.txt b/Client Applications/rcracki_mt/ChangeLog.txt index 945b37e..ecebd60 100644 --- a/Client Applications/rcracki_mt/ChangeLog.txt +++ b/Client Applications/rcracki_mt/ChangeLog.txt @@ -1,5 +1,8 @@ [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 diff --git a/Client Applications/rcracki_mt/CrackEngine.cpp b/Client Applications/rcracki_mt/CrackEngine.cpp index 8d3981e..0a4b181 100644 --- a/Client Applications/rcracki_mt/CrackEngine.cpp +++ b/Client Applications/rcracki_mt/CrackEngine.cpp @@ -1077,6 +1077,7 @@ void CCrackEngine::SearchRainbowTable(string sPathName, CHashSet& hs) if(pReader->GetChainsLeft() <= 0) // No more data break; pReader->ReadChains(nDataRead, (RainbowChain*)pChain); + nDataRead *= 8; // Convert from chains read to bytes } else @@ -1091,9 +1092,11 @@ void CCrackEngine::SearchRainbowTable(string sPathName, CHashSet& hs) m_fTotalDiskAccessTime += fTime; int nRainbowChainCountRead = nDataRead / 16; + if(doRti2Format) { nRainbowChainCountRead = nDataRead / 8; } + // Verify table chunk if (!fVerified) { diff --git a/Client Applications/rcracki_mt/HashAlgorithm.cpp b/Client Applications/rcracki_mt/HashAlgorithm.cpp new file mode 100644 index 0000000..db22aeb --- /dev/null +++ b/Client Applications/rcracki_mt/HashAlgorithm.cpp @@ -0,0 +1,428 @@ +/* + * rcracki_mt is a multithreaded implementation and fork of the original + * RainbowCrack + * + * Copyright (C) Zhu Shuanglei + * Copyright Martin Westergaard Jørgensen + * Copyright 2009, 2010 Daniël Niggebrugge + * Copyright 2009, 2010 James Nobis + * + * 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 . + * + * Changes: not using OpenSSL routines the slow way anymore, as suggested by jci. + */ + +#include "HashAlgorithm.h" + +#include "Public.h" + +#include +//#include +#include +#include +//#include +#include "fast_md5.h" +#include "md4.h" +//#include "sha1.h" +#if defined(_WIN32) && !defined(__GNUC__) + #pragma comment(lib, "libeay32.lib") +#endif + +#ifdef __NetBSD__ + #include +#endif + +#define MSCACHE_HASH_SIZE 16 +void setup_des_key(unsigned char key_56[], des_key_schedule &ks) +{ + des_cblock key; + + key[0] = key_56[0]; + key[1] = (key_56[0] << 7) | (key_56[1] >> 1); + key[2] = (key_56[1] << 6) | (key_56[2] >> 2); + key[3] = (key_56[2] << 5) | (key_56[3] >> 3); + key[4] = (key_56[3] << 4) | (key_56[4] >> 4); + key[5] = (key_56[4] << 3) | (key_56[5] >> 5); + key[6] = (key_56[5] << 2) | (key_56[6] >> 6); + key[7] = (key_56[6] << 1); + + //des_set_odd_parity(&key); + des_set_key(&key, ks); +} + +void HashLM(unsigned char* pPlain, int nPlainLen, unsigned char* pHash) +{ + /* + unsigned char data[7] = {0}; + memcpy(data, pPlain, nPlainLen > 7 ? 7 : nPlainLen); + */ + + int i; + for (i = nPlainLen; i < 7; i++) + pPlain[i] = 0; + + static unsigned char magic[] = {0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25}; + des_key_schedule ks; + //setup_des_key(data, ks); + setup_des_key(pPlain, ks); + des_ecb_encrypt((des_cblock*)magic, (des_cblock*)pHash, ks, DES_ENCRYPT); +} + +void HashLMCHALL(unsigned char* pPlain, int nPlainLen, unsigned char* pHash) +{ + unsigned char pass[14]; + unsigned char pre_lmresp[21]; + static unsigned char magic[] = {0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25}; + static unsigned char spoofed_challange[] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}; + des_key_schedule ks; + + memset (pass,0,sizeof(pass)); + memset (pre_lmresp,0,sizeof(pre_lmresp)); + + memcpy (pass,pPlain, nPlainLen); + + setup_des_key(pass, ks); + des_ecb_encrypt((des_cblock*)magic, (des_cblock*)pre_lmresp, ks, DES_ENCRYPT); + + setup_des_key(&pass[7], ks); + des_ecb_encrypt((des_cblock*)magic, (des_cblock*)&pre_lmresp[8], ks, DES_ENCRYPT); + + setup_des_key(pre_lmresp, ks); + des_ecb_encrypt((des_cblock*)spoofed_challange, (des_cblock*)pHash, ks, DES_ENCRYPT); + + setup_des_key(&pre_lmresp[7], ks); + des_ecb_encrypt((des_cblock*)spoofed_challange, (des_cblock*)&pHash[8], ks, DES_ENCRYPT); + + setup_des_key(&pre_lmresp[14], ks); + des_ecb_encrypt((des_cblock*)spoofed_challange, (des_cblock*)&pHash[16], ks, DES_ENCRYPT); + +} + +void HashHALFLMCHALL(unsigned char* pPlain, int nPlainLen, unsigned char* pHash) +{ + unsigned char pre_lmresp[8]; + static unsigned char magic[] = {0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25}; + static unsigned char salt[] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}; + + des_key_schedule ks; + unsigned char plain[8] = {0}; + memcpy(plain, pPlain, nPlainLen); + setup_des_key(plain, ks); + des_ecb_encrypt((des_cblock*)magic, (des_cblock*)pre_lmresp, ks, DES_ENCRYPT); + + setup_des_key(pre_lmresp, ks); + des_ecb_encrypt((des_cblock*)salt, (des_cblock*)pHash, ks, DES_ENCRYPT); +} + + + +void HashNTLMCHALL(unsigned char* pPlain, int nPlainLen, unsigned char* pHash) +{ + unsigned char UnicodePlain[MAX_PLAIN_LEN]; + static unsigned char spoofed_challange[] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}; + + int len = (nPlainLen < 127) ? nPlainLen : 127; + int i; + + for (i = 0; i < len; i++) + { + UnicodePlain[i * 2] = pPlain[i]; + UnicodePlain[i * 2 + 1] = 0x00; + } + + des_key_schedule ks; + unsigned char lm[21]; + + /*MD4_CTX ctx; + MD4_Init(&ctx); + MD4_Update(&ctx, UnicodePlain, len * 2); + MD4_Final(lm, &ctx); */ + MD4_NEW(UnicodePlain, len * 2, lm); + + //MD4(UnicodePlain, len * 2, lm); + lm[16] = lm[17] = lm[18] = lm[19] = lm[20] = 0; + + setup_des_key(lm, ks); + des_ecb_encrypt((des_cblock*)spoofed_challange, (des_cblock*)pHash, ks, DES_ENCRYPT); + + setup_des_key(&lm[7], ks); + des_ecb_encrypt((des_cblock*)spoofed_challange, (des_cblock*)&pHash[8], ks, DES_ENCRYPT); + + setup_des_key(&lm[14], ks); + des_ecb_encrypt((des_cblock*)spoofed_challange, (des_cblock*)&pHash[16], ks, DES_ENCRYPT); +} + +void HashORACLE(unsigned char* pPlain, int nPlainLen, unsigned char* pHash) +{ + char ToEncrypt[256]; + char temp[256]; + char username[256]; + + DES_cblock iv,iv2; + DES_key_schedule ks1,ks2; + unsigned char deskey_fixed[]={ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}; + int i,j; +#if defined(_WIN32) && !defined(__GNUC__) + strcpy_s(username, sizeof(username), "SYS"); +#else + strcpy(username, "SYS"); +#endif + int userlen = 3; +#if defined(_WIN32) && !defined(__GNUC__) + _strupr((char*) pPlain); +#else + strupr((char*) pPlain); +#endif + memset (ToEncrypt,0,sizeof(ToEncrypt)); + + for (i=1,j=0; j ascii - 64 */ + "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + +void _crypt_to64(char *s, unsigned long v, int n) +{ + while (--n >= 0) { + *s++ = itoa64[v&0x3f]; + v >>= 6; + } +} + +void HashPIX(unsigned char* pPlain, int nPlainLen, unsigned char* pHash) +{ + char temp[MD5_DIGEST_LENGTH+1]; + unsigned char final[MD5_DIGEST_LENGTH]; + char* pass = (char*) calloc (nPlainLen+MD5_DIGEST_LENGTH,sizeof(char)); + + memcpy (pass,pPlain,nPlainLen); + + /*MD5_CTX ctx; + MD5_Init(&ctx); + MD5_Update(&ctx, (unsigned char *) pass, MD5_DIGEST_LENGTH); + MD5_Final(final, &ctx);*/ + fast_MD5((unsigned char *) pass, MD5_DIGEST_LENGTH, final); + + char* p = (char*) temp; + _crypt_to64(p,*(unsigned long*) (final+0),4); p += 4; + _crypt_to64(p,*(unsigned long*) (final+4),4); p += 4; + _crypt_to64(p,*(unsigned long*) (final+8),4); p += 4; + _crypt_to64(p,*(unsigned long*) (final+12),4); p += 4; + *p=0; + + memcpy(pHash,temp,MD5_DIGEST_LENGTH); + + free (pass); +} + +#if !defined(_WIN32) || defined(__GNUC__) +char *strupr(char *s1) +{ + char *p = s1; + while(*p) + { + *p = (char) toupper(*p); + p++; + } + return s1; +} +#endif diff --git a/Client Applications/rcracki_mt/HashAlgorithm.h b/Client Applications/rcracki_mt/HashAlgorithm.h new file mode 100644 index 0000000..401784f --- /dev/null +++ b/Client Applications/rcracki_mt/HashAlgorithm.h @@ -0,0 +1,64 @@ +/* + * rcracki_mt is a multithreaded implementation and fork of the original + * RainbowCrack + * + * Copyright (C) Zhu Shuanglei + * Copyright Martin Westergaard Jørgensen + * Copyright 2009, 2010 Daniël Niggebrugge + * Copyright 2009, 2010 James Nobis + * + * 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 . + */ + +#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 diff --git a/Client Applications/rcracki_mt/HashRoutine.cpp b/Client Applications/rcracki_mt/HashRoutine.cpp new file mode 100644 index 0000000..595f13d --- /dev/null +++ b/Client Applications/rcracki_mt/HashRoutine.cpp @@ -0,0 +1,96 @@ +/* + * rcracki_mt is a multithreaded implementation and fork of the original + * RainbowCrack + * + * Copyright (C) Zhu Shuanglei + * Copyright Martin Westergaard Jørgensen + * Copyright 2009, 2010 Daniël Niggebrugge + * Copyright 2009, 2010 James Nobis + * + * 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 . + */ + +#if defined(_WIN32) && !defined(__GNUC__) + #pragma warning(disable : 4786 4267 4018) +#endif + +#include "HashRoutine.h" +#include "HashAlgorithm.h" + +////////////////////////////////////////////////////////////////////// + +CHashRoutine::CHashRoutine() +{ + // Notice: MIN_HASH_LEN <= nHashLen <= MAX_HASH_LEN + + + AddHashRoutine("lm", HashLM, 8); + AddHashRoutine("ntlm", HashNTLM, 16); +// AddHashRoutine("md2", HashMD2, 16); + AddHashRoutine("md4", HashMD4, 16); + AddHashRoutine("md5", HashMD5, 16); + AddHashRoutine("doublemd5", HashDoubleMD5, 16); + AddHashRoutine("sha1", HashSHA1, 20); +// AddHashRoutine("ripemd160", HashRIPEMD160, 20); + AddHashRoutine("mysql323", HashMySQL323, 8); + AddHashRoutine("mysqlsha1", HashMySQLSHA1, 20); + AddHashRoutine("ciscopix", HashPIX, 16); + AddHashRoutine("mscache", HashMSCACHE, 16); + AddHashRoutine("halflmchall", HashHALFLMCHALL, 8); + + // Added from mao + AddHashRoutine("lmchall", HashLMCHALL, 24); + AddHashRoutine("ntlmchall", HashNTLMCHALL, 24); + AddHashRoutine("oracle", HashORACLE, 8); +} + +CHashRoutine::~CHashRoutine() +{ +} + +void CHashRoutine::AddHashRoutine(string sHashRoutineName, HASHROUTINE pHashRoutine, int nHashLen) +{ + vHashRoutineName.push_back(sHashRoutineName); + vHashRoutine.push_back(pHashRoutine); + vHashLen.push_back(nHashLen); +} + +string CHashRoutine::GetAllHashRoutineName() +{ + string sRet; + UINT4 i; + for (i = 0; i < vHashRoutineName.size(); i++) + sRet += vHashRoutineName[i] + " "; + + return sRet; +} + +void CHashRoutine::GetHashRoutine(string sHashRoutineName, HASHROUTINE& pHashRoutine, int& nHashLen) +{ + UINT4 i; + for (i = 0; i < vHashRoutineName.size(); i++) + { + if (sHashRoutineName == vHashRoutineName[i]) + { + pHashRoutine = vHashRoutine[i]; + nHashLen = vHashLen[i]; + return; + } + } + + pHashRoutine = NULL; + nHashLen = 0; +} diff --git a/Client Applications/rcracki_mt/HashRoutine.h b/Client Applications/rcracki_mt/HashRoutine.h new file mode 100644 index 0000000..eaa10ce --- /dev/null +++ b/Client Applications/rcracki_mt/HashRoutine.h @@ -0,0 +1,55 @@ +/* + * rcracki_mt is a multithreaded implementation and fork of the original + * RainbowCrack + * + * Copyright (C) Zhu Shuanglei + * Copyright Martin Westergaard Jørgensen + * Copyright 2009, 2010 Daniël Niggebrugge + * Copyright 2009, 2010 James Nobis + * + * 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 . + */ + +#ifndef _HASHROUTINE_H +#define _HASHROUTINE_H + +#include +#include + +#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 vHashRoutineName; + vector vHashRoutine; + vector vHashLen; + void AddHashRoutine(string sHashRoutineName, HASHROUTINE pHashRoutine, int nHashLen); + +public: + string GetAllHashRoutineName(); + void GetHashRoutine(string sHashRoutineName, HASHROUTINE& pHashRoutine, int& nHashLen); +}; + +#endif diff --git a/Client Applications/rcracki_mt/md4.cpp b/Client Applications/rcracki_mt/md4.cpp new file mode 100644 index 0000000..cb11c7e --- /dev/null +++ b/Client Applications/rcracki_mt/md4.cpp @@ -0,0 +1,334 @@ +/* + * rcracki_mt is a multithreaded implementation and fork of the original + * RainbowCrack + * + * Copyright Bitweasil + * Copyright 2009, 2010 Daniël Niggebrugge + * Copyright 2009, 2010 James Nobis + * + * 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 . + * + * This code implements the MD4 message-digest algorithm. + * "Just the reference implementation, single stage. Hardly "optimized." Though a good bit faster than libssl's MD4, as it isn't doing nearly the same amount of work." - Bitweasil + * + * little bit optimized (or at least attempted) for NTLM (unicode) by neinbrucke + */ + + +//#include +//#include +#include "md4.h" + +/* MD4 Defines as per RFC reference implementation */ +#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) +#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) +#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) +#define FF(a, b, c, d, x, s) { \ + (a) += F ((b), (c), (d)) + (x); \ + (a) = ROTATE_LEFT ((a), (s)); \ + } +#define GG(a, b, c, d, x, s) { \ + (a) += G ((b), (c), (d)) + (x) + (UINT4)0x5a827999; \ + (a) = ROTATE_LEFT ((a), (s)); \ + } +#define HH(a, b, c, d, x, s) { \ + (a) += H ((b), (c), (d)) + (x) + (UINT4)0x6ed9eba1; \ + (a) = ROTATE_LEFT ((a), (s)); \ + } +#define S11 3 +#define S12 7 +#define S13 11 +#define S14 19 +#define S21 3 +#define S22 5 +#define S23 9 +#define S24 13 +#define S31 3 +#define S32 9 +#define S33 11 +#define S34 15 +/* End MD4 Defines */ + +void MD4_NEW( unsigned char * pData, int length, unsigned char * pDigest) +{ + // access data as 4-byte word + #define uData ((UINT4 *)pData) + #define uDigest ((UINT4 *)pDigest) + + // pad word and append bit at appropriate location + #define MD4_pad_w0() (0x00000080) + #define MD4_pad_w1(data) (((data) & 0x000000FF) | 0x00008000) + #define MD4_pad_w2(data) (((data) & 0x0000FFFF) | 0x00800000) + #define MD4_pad_w3(data) (((data) & 0x00FFFFFF) | 0x80000000) + + // For the hash working space + //__attribute__((aligned(16))) UINT4 data[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + //__declspec(align(16)) UINT4 data[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + UINT4 data[MD4_DIGEST_LENGTH] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + + // For the output result + UINT4 a,b,c,d; + + switch (length) + { + case 0: + { + data[ 0] = MD4_pad_w0(); + + data[14] = 0; + } + break; + case 1: + { + data[ 0] = MD4_pad_w1(uData[0]); + + data[14] = 1 << 3; + } + break; + case 2: + { + data[ 0] = MD4_pad_w2(uData[0]); + + data[14] = 2 << 3; + } + break; + case 3: + { + data[ 0] = MD4_pad_w3(uData[0]); + + data[14] = 3 << 3; + } + break; + case 4: + { + data[ 0] = uData[0]; + data[ 1] = MD4_pad_w0(); + + data[14] = 4 << 3; + } + break; + case 5: + { + data[ 0] = uData[0]; + data[ 1] = MD4_pad_w1(uData[1]); + + data[14] = 5 << 3; + } + break; + case 6: + { + data[ 0] = uData[0]; + data[ 1] = MD4_pad_w2(uData[1]); + + data[14] = 6 << 3; + } + break; + case 7: + { + data[ 0] = uData[0]; + data[ 1] = MD4_pad_w3(uData[1]); + + data[14] = 7 << 3; + } + break; + case 8: + { + data[ 0] = uData[0]; + data[ 1] = uData[1]; + data[ 2] = MD4_pad_w0(); + + data[14] = 8 << 3; + } + break; + case 9: + { + data[ 0] = uData[0]; + data[ 1] = uData[1]; + data[ 2] = MD4_pad_w1(uData[2]); + + data[14] = 9 << 3; + } + break; + case 10: + { + data[ 0] = uData[0]; + data[ 1] = uData[1]; + data[ 2] = MD4_pad_w2(uData[2]); + + data[14] = 10 << 3; + } + break; + case 11: + { + data[ 0] = uData[0]; + data[ 1] = uData[1]; + data[ 2] = MD4_pad_w3(uData[2]); + + data[14] = 11 << 3; + } + break; + case 12: + { + data[ 0] = uData[0]; + data[ 1] = uData[1]; + data[ 2] = uData[2]; + data[ 3] = MD4_pad_w0(); + + data[14] = 12 << 3; + } + break; + case 13: + { + data[ 0] = uData[0]; + data[ 1] = uData[1]; + data[ 2] = uData[2]; + data[ 3] = MD4_pad_w1(uData[3]); + + data[14] = 13 << 3; + } + break; + case 14: + { + data[ 0] = uData[0]; + data[ 1] = uData[1]; + data[ 2] = uData[2]; + data[ 3] = MD4_pad_w2(uData[3]); + + data[14] = 14 << 3; + } + break; + case 15: + { + data[ 0] = uData[0]; + data[ 1] = uData[1]; + data[ 2] = uData[2]; + data[ 3] = MD4_pad_w3(uData[3]); + + data[14] = 15 << 3; + } + break; + + default: + { + length = length % 32; // lenght >= 32 not suported + + int word = length >> 2; + + int i = 0; + while (i < word) { + data[i] = uData[i]; + i++; + } + + switch (length & 0x3) { + case 0: + { + data[word] = MD4_pad_w0(); + } + break; + case 1: + { + data[word] = MD4_pad_w1(uData[word]); + } + break; + case 2: + { + data[word] = MD4_pad_w2(uData[word]); + } + break; + case 3: + { + data[word] = MD4_pad_w3(uData[word]); + } + break; + } + + data[14] = length << 3; + } + break; + } + + a = 0x67452301; + b = 0xefcdab89; + c = 0x98badcfe; + d = 0x10325476; + + /* Round 1 */ + FF (a, b, c, d, data[ 0], S11); /* 1 */ + FF (d, a, b, c, data[ 1], S12); /* 2 */ + FF (c, d, a, b, data[ 2], S13); /* 3 */ + FF (b, c, d, a, data[ 3], S14); /* 4 */ + FF (a, b, c, d, data[ 4], S11); /* 5 */ + FF (d, a, b, c, data[ 5], S12); /* 6 */ + FF (c, d, a, b, data[ 6], S13); /* 7 */ + FF (b, c, d, a, data[ 7], S14); /* 8 */ + FF (a, b, c, d, 0, S11); /* 9 */ + FF (d, a, b, c, 0, S12); /* 10 */ + FF (c, d, a, b, 0, S13); /* 11 */ + FF (b, c, d, a, 0, S14); /* 12 */ + FF (a, b, c, d, 0, S11); /* 13 */ + FF (d, a, b, c, 0, S12); /* 14 */ + FF (c, d, a, b, data[14], S13); /* 15 */ + FF (b, c, d, a, 0, S14); /* 16 */ + + /* Round 2 */ + GG (a, b, c, d, data[ 0], S21); /* 17 */ + GG (d, a, b, c, data[ 4], S22); /* 18 */ + GG (c, d, a, b, 0, S23); /* 19 */ + GG (b, c, d, a, 0, S24); /* 20 */ + GG (a, b, c, d, data[ 1], S21); /* 21 */ + GG (d, a, b, c, data[ 5], S22); /* 22 */ + GG (c, d, a, b, 0, S23); /* 23 */ + GG (b, c, d, a, 0, S24); /* 24 */ + GG (a, b, c, d, data[ 2], S21); /* 25 */ + GG (d, a, b, c, data[ 6], S22); /* 26 */ + GG (c, d, a, b, 0, S23); /* 27 */ + GG (b, c, d, a, data[14], S24); /* 28 */ + GG (a, b, c, d, data[ 3], S21); /* 29 */ + GG (d, a, b, c, data[ 7], S22); /* 30 */ + GG (c, d, a, b, 0, S23); /* 31 */ + GG (b, c, d, a, 0, S24); /* 32 */ + + /* Round 3 */ + HH (a, b, c, d, data[ 0], S31); /* 33 */ + HH (d, a, b, c, 0, S32); /* 34 */ + HH (c, d, a, b, data[ 4], S33); /* 35 */ + HH (b, c, d, a, 0, S34); /* 36 */ + HH (a, b, c, d, data[ 2], S31); /* 37 */ + HH (d, a, b, c, 0, S32); /* 38 */ + HH (c, d, a, b, data[ 6], S33); /* 39 */ + HH (b, c, d, a, data[14], S34); /* 40 */ + HH (a, b, c, d, data[ 1], S31); /* 41 */ + HH (d, a, b, c, 0, S32); /* 42 */ + HH (c, d, a, b, data[ 5], S33); /* 43 */ + HH (b, c, d, a, 0, S34); /* 44 */ + HH (a, b, c, d, data[ 3], S31); /* 45 */ + HH (d, a, b, c, 0, S32); /* 46 */ + HH (c, d, a, b, data[ 7], S33); /* 47 */ + HH (b, c, d, a, 0, S34); /* 48 */ + + // Finally, add initial values, as this is the only pass we make. + a += 0x67452301; + b += 0xefcdab89; + c += 0x98badcfe; + d += 0x10325476; + + uDigest[0] = a; + uDigest[1] = b; + uDigest[2] = c; + uDigest[3] = d; +} diff --git a/Client Applications/rcracki_mt/md4.h b/Client Applications/rcracki_mt/md4.h new file mode 100644 index 0000000..aeb3822 --- /dev/null +++ b/Client Applications/rcracki_mt/md4.h @@ -0,0 +1,35 @@ +/* + * rcracki_mt is a multithreaded implementation and fork of the original + * RainbowCrack + * + * Copyright Bitweasil + * Copyright 2009, 2010 Daniël Niggebrugge + * Copyright 2009, 2010 James Nobis + * + * 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 . + */ + +#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 */ diff --git a/Common/rt api/Public.cpp b/Common/rt api/Public.cpp index 66e8ce4..834dea7 100644 --- a/Common/rt api/Public.cpp +++ b/Common/rt api/Public.cpp @@ -125,7 +125,38 @@ bool GetHybridCharsets(string sCharset, vector& vCharset) bool boinc_ReadLinesFromFile(string sPathName, vector& vLine) { vLine.clear(); - char input_path[512]; + 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]"); + +/* char input_path[512]; boinc_resolve_filename(sPathName.c_str(), input_path, sizeof(input_path)); FILE *file = boinc_fopen(input_path, "rb"); if (!file) { @@ -166,7 +197,7 @@ bool boinc_ReadLinesFromFile(string sPathName, vector& vLine) } else return false; - + */ return true; } #endif diff --git a/Common/rt api/des_enc.c b/Common/rt api/des_enc.c index 8364c74..f2c99b7 100644 --- a/Common/rt api/des_enc.c +++ b/Common/rt api/des_enc.c @@ -63,6 +63,8 @@ //#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; diff --git a/Common/rt api/ecb_enc.c b/Common/rt api/ecb_enc.c index 4a6093d..63d209a 100644 --- a/Common/rt api/ecb_enc.c +++ b/Common/rt api/ecb_enc.c @@ -51,11 +51,13 @@ #include #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; diff --git a/Common/rt api/sk.h b/Common/rt api/sk.h index 209dca6..b91473a 100644 --- a/Common/rt api/sk.h +++ b/Common/rt api/sk.h @@ -47,7 +47,6 @@ * 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 */ diff --git a/Common/rt api/spr.h b/Common/rt api/spr.h index d5dce8a..187cd26 100644 --- a/Common/rt api/spr.h +++ b/Common/rt api/spr.h @@ -61,6 +61,7 @@ #ifndef __SPR_H__ #define __SPR_H__ + const DES_LONG des_SPtrans[8][64]={ { /* nibble 0 */