]> git.sesse.net Git - freerainbowtables/commitdiff
0.6.5 release synced from rcracki.sourceforge.net
authorJames Nobis <quel@quelrod.net>
Sun, 24 Oct 2010 19:30:07 +0000 (14:30 -0500)
committerJames Nobis <quel@quelrod.net>
Sun, 24 Oct 2010 19:30:07 +0000 (14:30 -0500)
37 files changed:
Client Applications/rcracki_mt/BaseRTReader.cpp
Client Applications/rcracki_mt/BaseRTReader.h
Client Applications/rcracki_mt/ChainWalkContext.cpp
Client Applications/rcracki_mt/ChainWalkContext.h
Client Applications/rcracki_mt/ChainWalkSet.cpp
Client Applications/rcracki_mt/ChainWalkSet.h
Client Applications/rcracki_mt/ChangeLog.txt
Client Applications/rcracki_mt/CrackEngine.cpp
Client Applications/rcracki_mt/CrackEngine.h
Client Applications/rcracki_mt/HashAlgorithm.cpp
Client Applications/rcracki_mt/HashAlgorithm.h
Client Applications/rcracki_mt/HashRoutine.cpp
Client Applications/rcracki_mt/HashRoutine.h
Client Applications/rcracki_mt/HashSet.cpp
Client Applications/rcracki_mt/HashSet.h
Client Applications/rcracki_mt/Makefile
Client Applications/rcracki_mt/MemoryPool.cpp
Client Applications/rcracki_mt/MemoryPool.h
Client Applications/rcracki_mt/Public.cpp
Client Applications/rcracki_mt/Public.h
Client Applications/rcracki_mt/README.txt
Client Applications/rcracki_mt/RTI2Reader.cpp
Client Applications/rcracki_mt/RTI2Reader.h
Client Applications/rcracki_mt/RainbowCrack.cpp
Client Applications/rcracki_mt/TODO
Client Applications/rcracki_mt/fast_md5.cpp
Client Applications/rcracki_mt/fast_md5.h
Client Applications/rcracki_mt/global.h
Client Applications/rcracki_mt/lm2ntlm.cpp
Client Applications/rcracki_mt/lm2ntlm.h
Client Applications/rcracki_mt/md4.cpp
Client Applications/rcracki_mt/md4.h
Client Applications/rcracki_mt/rcrackiThread.cpp
Client Applications/rcracki_mt/rcrackiThread.h
Client Applications/rcracki_mt/rcracki_mt.ini
Client Applications/rcracki_mt/sha1.cpp
Client Applications/rcracki_mt/sha1.h

index cae94f8a117e699f766bc89c14a1774b1027ce42..9b797ecf7d2966916f4ec45221870aa43fe9d892 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
  * Copyright 2010 James Nobis <frt@quelrod.net>
  *
- * This file is part of racrcki_mt.
+ * 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
index b95f930fd37df55beae4ac4bb00d4edeccdb9bb0..17a93ac51de7171aeaba31e9fd593125d0eebd33 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
  * Copyright 2010 James Nobis <frt@quelrod.net>
  *
- * This file is part of racrcki_mt.
+ * 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
index 1158dc6c648fa9450e1fefa49efae6f3da96558f..ae58f77894c6e074279bb38cf7487228df8af6b6 100644 (file)
@@ -8,7 +8,7 @@
  * Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
  * Copyright 2010 Yngve AAdlandsvik\r
  *\r
- * This file is part of racrcki_mt.\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
@@ -76,22 +76,18 @@ bool CChainWalkContext::LoadCharset(string sName)
                return true;\r
        }\r
        if(sName.substr(0, 6) == "hybrid") // Hybrid charset consisting of 2 charsets\r
-       {\r
                m_nHybridCharset = 1;           \r
-       }\r
        else\r
-       {\r
                m_nHybridCharset = 0;\r
-       }\r
        \r
        bool readCharset = false;\r
        vector<string> vLine;\r
-       if (ReadLinesFromFile("charset.txt", vLine)) {\r
+\r
+       if ( ReadLinesFromFile("charset.txt", vLine) )\r
                readCharset = true;\r
-       }\r
-       else if (ReadLinesFromFile(GetApplicationPath() + "charset.txt", vLine)) {\r
+       else if ( ReadLinesFromFile(GetApplicationPath() + "charset.txt", vLine) )\r
                readCharset = true;\r
-       }\r
+\r
        if (readCharset)\r
        {\r
                UINT4 i;\r
@@ -268,11 +264,11 @@ bool CChainWalkContext::SetupWithPathName(string sPathName, int& nRainbowChainLe
        // something like lm_alpha#1-7_0_100x16_test.rt\r
 \r
 #ifdef _WIN32\r
-       int nIndex = sPathName.find_last_of('\\');\r
+       string::size_type nIndex = sPathName.find_last_of('\\');\r
 #else\r
-       int nIndex = (int) sPathName.find_last_of('/');\r
+       string::size_type nIndex = sPathName.find_last_of('/');\r
 #endif\r
-       if (nIndex != -1)\r
+       if (nIndex != string::npos)\r
                sPathName = sPathName.substr(nIndex + 1);\r
 \r
        if (sPathName.size() < 3)\r
@@ -324,7 +320,7 @@ bool CChainWalkContext::SetupWithPathName(string sPathName, int& nRainbowChainLe
        }\r
        else\r
        {\r
-               if (sCharsetDefinition.find('#') == (unsigned long)-1)          // For backward compatibility, "#1-7" is implied\r
+               if ( sCharsetDefinition.find('#') == string::npos )             // For backward compatibility, "#1-7" is implied\r
                {                       \r
                        sCharsetName = sCharsetDefinition;\r
                        nPlainLenMin = 1;\r
@@ -473,10 +469,10 @@ void CChainWalkContext::IndexToPlain()
                m_nPlainLen = m_nPlainLenMinTotal;\r
        uint64 nIndexOfX = m_nIndex - m_nPlainSpaceUpToX[m_nPlainLen - 1];\r
 \r
-// this is the generic code for non x86/x86-64 platforms\r
-#if !defined(_M_X64) && !defined(_M_X86) && !defined(__i386__) && !defined(__x86_64__)\r
+// this is the generic code for non x86/x86_64 platforms\r
+#if !defined(_M_X64) && !defined(_M_IX86) && !defined(__i386__) && !defined(__x86_64__)\r
        \r
-       // Slow/generic version\r
+       // generic version (slow for non 64-bit platforms and gcc < 4.5.x)\r
        for (i = m_nPlainLen - 1; i >= 0; i--)\r
        {\r
                int nCharsetLen = 0;\r
@@ -491,14 +487,14 @@ void CChainWalkContext::IndexToPlain()
                        }\r
                }\r
        }\r
-#else\r
 \r
+#elif defined(_M_X64) || defined(_M_IX86) || defined(__i386__) || defined(__x86_64__)\r
 \r
        // Fast ia32 version\r
        for (i = m_nPlainLen - 1; i >= 0; i--)\r
        {\r
                // 0x100000000 = 2^32\r
-#if defined(_M_X64) || defined(_M_X86)\r
+#ifdef _M_IX86\r
                if (nIndexOfX < 0x100000000I64)\r
                        break;\r
 #else\r
@@ -519,7 +515,7 @@ void CChainWalkContext::IndexToPlain()
                }\r
        }\r
 \r
-       unsigned int nIndexOfX32 = (unsigned int)nIndexOfX;\r
+       UINT4 nIndexOfX32 = (UINT4)nIndexOfX;\r
        for (; i >= 0; i--)\r
        {\r
                int nCharsetLen = 0;\r
@@ -540,11 +536,14 @@ void CChainWalkContext::IndexToPlain()
 \r
 #if defined(_WIN32) && !defined(__GNUC__)\r
 \r
+               // VC++ still needs this\r
+               unsigned int nPlainCharsetLen = m_vCharset[j].m_nPlainCharsetLen;\r
+\r
                __asm\r
                {\r
                        mov eax, nIndexOfX32\r
                        xor edx, edx\r
-                       div m_vCharset[j].m_nPlainCharsetLen\r
+                       div nPlainCharsetLen\r
                        mov nIndexOfX32, eax\r
                        mov nTemp, edx\r
                }\r
index 566f9f2cd4bc77b71040c8e2d38b2a0bb3d571d3..154daee9cf8edb4e01c5f9938755e5cd30895411 100644 (file)
@@ -6,7 +6,7 @@
  * 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 racrcki_mt.\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
index 488280ad9862450d6519f158556133256656b61d..84db65f028d00d4292c1cb276be83def82a0ef7a 100644 (file)
@@ -7,7 +7,7 @@
  * 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 racrcki_mt.\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
@@ -23,7 +23,7 @@
  * along with rcracki_mt.  If not, see <http://www.gnu.org/licenses/>.\r
  */\r
 \r
-#ifdef _WIN32\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
        #pragma warning(disable : 4786)\r
 #endif\r
 \r
index 3c29bcf64ea13f044d3322c5c2a2ceb2659d3873..757800764063fbde0facac3ea6f5b7ac7231236a 100644 (file)
@@ -7,7 +7,7 @@
  * 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 racrcki_mt.\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
index 0b07cd0462bccdafdd1fa8bc67da1d8b25c99b83..4c0eefddb996249d9db2bd46e0265d73e5460fbc 100644 (file)
@@ -1,52 +1,79 @@
-[rcracki_mt ChangeLog]
-
-0.6.2 (2 Juli 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
-
+[rcracki_mt ChangeLog]\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
index 00216101becbcd26586209c93fd8431a0bf85a3a..8adc18274a2e76efa33d3e59ac8c9861daeaa64f 100644 (file)
@@ -8,7 +8,7 @@
  * Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
  * Copyright 2010 uroskn\r
  *\r
- * This file is part of racrcki_mt.\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
  * along with rcracki_mt.  If not, see <http://www.gnu.org/licenses/>.\r
  */\r
 \r
-#ifdef _WIN32\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
        #pragma warning(disable : 4786 4267 4018)\r
 #endif\r
 \r
 #include "CrackEngine.h"\r
 #include "RTI2Reader.h"\r
 \r
+#ifndef _WIN32\r
+       #include <sys/resource.h>\r
+#endif\r
+\r
 CCrackEngine::CCrackEngine()\r
 {\r
        ResetStatistics();\r
@@ -299,15 +303,28 @@ void CCrackEngine::SearchTableChunkOld(RainbowChainO* pChain, int nRainbowChainL
        vector<rcrackiThread*> threadPool;\r
        vector<pthread_t> pThreads;\r
 \r
+       #ifndef _WIN32\r
+               /*\r
+                * On linux you cannot set the priority of a thread in the non real time\r
+                * scheduling groups.  You can set the priority of the process.  In\r
+                * windows BELOW_NORMAL represents a 1/8th drop in priority and this would\r
+                * be 20 * 1/8 on linux or about 2.5\r
+                */\r
+               setpriority( PRIO_PROCESS, 0, 2 );\r
+       #endif\r
+\r
        pthread_attr_t attr;\r
        pthread_attr_init(&attr);\r
        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);\r
        #ifdef _WIN32\r
        sched_param param;\r
+       /*\r
+        * windows scheduling is 0 to 32 (low to high) with 8 as normal and 7 as\r
+        * BELOW_NORMAL\r
+        */\r
        param.sched_priority = THREAD_PRIORITY_BELOW_NORMAL;\r
        pthread_attr_setschedparam (&attr, &param);\r
        #endif\r
-       // XXX else set it to 5 or something (for linux)?\r
 \r
        bool pausing = false;\r
 \r
@@ -615,6 +632,16 @@ void CCrackEngine::SearchTableChunk(RainbowChain* pChain, int nRainbowChainLen,
 \r
        vector<rcrackiThread*> threadPool;\r
        vector<pthread_t> pThreads;\r
+       \r
+       #ifndef _WIN32\r
+               /*\r
+                * On linux you cannot set the priority of a thread in the non real time\r
+                * scheduling groups.  You can set the priority of the process.  In\r
+                * windows BELOW_NORMAL represents a 1/8th drop in priority and this would\r
+                * be 20 * 1/8 on linux or about 2.5\r
+                */\r
+               setpriority( PRIO_PROCESS, 0, 2 );\r
+       #endif\r
 \r
        pthread_attr_t attr;\r
        pthread_attr_init(&attr);\r
@@ -943,12 +970,12 @@ void CCrackEngine::SearchRainbowTable(string sPathName, CHashSet& hs)
 \r
        // FileName\r
 #ifdef _WIN32\r
-       int nIndex = sPathName.find_last_of('\\');\r
+       string::size_type nIndex = sPathName.find_last_of('\\');\r
 #else\r
-       int nIndex = (int) sPathName.find_last_of('/');\r
+       string::size_type nIndex = sPathName.find_last_of('/');\r
 #endif\r
        string sFileName;\r
-       if (nIndex != -1)\r
+       if (nIndex != string::npos)\r
                sFileName = sPathName.substr(nIndex + 1);\r
        else\r
                sFileName = sPathName;\r
@@ -1018,7 +1045,12 @@ void CCrackEngine::SearchRainbowTable(string sPathName, CHashSet& hs)
 \r
                                static CMemoryPool mp(bytesForChainWalkSet, debug, maxMem);\r
                                RainbowChainO* pChain = (RainbowChainO*)mp.Allocate(nFileLen, nAllocatedSize);\r
-                               if (debug) printf("Allocated %llu bytes, filelen %lu\n", nAllocatedSize, (unsigned long)nFileLen);\r
+                               #ifdef _WIN32\r
+                                       if (debug) printf("Allocated %I64u bytes, filelen %lu\n", nAllocatedSize, (unsigned long)nFileLen);\r
+                               #else\r
+                                       if (debug) printf("Allocated %llu bytes, filelen %lu\n", nAllocatedSize, (unsigned long)nFileLen);\r
+                               #endif\r
+\r
                                if (pChain != NULL)\r
                                {\r
                                        nAllocatedSize = nAllocatedSize / sizeOfChain * sizeOfChain;            // Round to sizeOfChain boundary\r
@@ -1136,7 +1168,11 @@ void CCrackEngine::SearchRainbowTable(string sPathName, CHashSet& hs)
                                                //printf("index nSize: %d\n", nSize);\r
                                                //pIndex = (IndexChain*)new unsigned char[nSize];\r
                                                IndexChain *pIndex = (IndexChain*)mpIndex.Allocate(nFileLenIndex, nAllocatedSizeIndex);\r
-                                               if (debug) printf("Debug: Allocated %llu bytes for index with filelen %u\n", nAllocatedSizeIndex, nFileLenIndex);\r
+                                               #ifdef _WIN32\r
+                                                       if (debug) printf("Debug: Allocated %I64u bytes for index with filelen %u\n", nAllocatedSizeIndex, nFileLenIndex);\r
+                                               #else\r
+                                                       if (debug) printf("Debug: Allocated %llu bytes for index with filelen %u\n", nAllocatedSizeIndex, nFileLenIndex);\r
+                                               #endif\r
                                \r
                                                static CMemoryPool mp(bytesForChainWalkSet + nAllocatedSizeIndex, debug, maxMem);\r
                                                \r
@@ -1149,7 +1185,11 @@ void CCrackEngine::SearchRainbowTable(string sPathName, CHashSet& hs)
                                                        while ( (unsigned long)ftell(fIndex) != nFileLenIndex ) // Index chunk read loop\r
                                                        {\r
                                                                // Load index chunk\r
+#ifdef _WIN32\r
+                                                               if (debug) printf("Debug: Setting index to 0x00 in memory, %I64u bytes\n", nAllocatedSizeIndex);\r
+#else\r
                                                                if (debug) printf("Debug: Setting index to 0x00 in memory, %llu bytes\n", nAllocatedSizeIndex);\r
+#endif\r
                                                                memset(pIndex, 0x00, nAllocatedSizeIndex);\r
                                                                printf("reading index... ");\r
                                                                gettimeofday( &tv, NULL );\r
@@ -1172,7 +1212,11 @@ void CCrackEngine::SearchRainbowTable(string sPathName, CHashSet& hs)
 \r
                                                                //RainbowChain* pChain = (RainbowChain*)mp.Allocate(nFileLen, nAllocatedSize);\r
                                                                RainbowChain* pChain = (RainbowChain*)mp.Allocate(nCoveredRainbowTableChains * sizeOfChain, nAllocatedSize);\r
-                                                               if (debug) printf("Debug: Allocated %llu bytes for %u chains, filelen %lu\n", nAllocatedSize, nCoveredRainbowTableChains, (unsigned long)nFileLen);\r
+                                                               #ifdef _WIN32\r
+                                                                       if (debug) printf("Debug: Allocated %I64u bytes for %u chains, filelen %lu\n", nAllocatedSize, nCoveredRainbowTableChains, (unsigned long)nFileLen);\r
+                                                               #else\r
+                                                                       if (debug) printf("Debug: Allocated %llu bytes for %u chains, filelen %lu\n", nAllocatedSize, nCoveredRainbowTableChains, (unsigned long)nFileLen);\r
+                                                               #endif\r
 \r
                                                                if (pChain != NULL && nAllocatedSize > 0)\r
                                                                {\r
index 5826e7fe48bb118ac4c8b530c46dd8903ac25585..a5bc6a63417d4160f7698567c022e716d5225d6d 100644 (file)
@@ -8,7 +8,7 @@
  * Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
  * Copyright 2010 uroskn\r
  *\r
- * This file is part of racrcki_mt.\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
index caf30d63c38648b9851b674d042ad2893340a4d7..bf04682e6792e0ecbee9ef9dc89960d4308a5629 100644 (file)
@@ -7,7 +7,7 @@
  * 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 racrcki_mt.\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
 #include <openssl/des.h>\r
 //#include <openssl/md2.h>\r
 #include <openssl/md4.h>\r
-//#include <openssl/md5.h>\r
 #include <openssl/sha.h>\r
 //#include <openssl/ripemd.h>\r
 #include "fast_md5.h"\r
 #include "md4.h"\r
 //#include "sha1.h"\r
-#ifdef _WIN32\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
        #pragma comment(lib, "libeay32.lib")\r
 #endif\r
 \r
@@ -166,7 +165,6 @@ void HashNTLMCHALL(unsigned char* pPlain, int nPlainLen, unsigned char* pHash)
        des_ecb_encrypt((des_cblock*)spoofed_challange, (des_cblock*)&pHash[16], ks, DES_ENCRYPT);\r
 }\r
 \r
-\r
 void HashORACLE(unsigned char* pPlain, int nPlainLen, unsigned char* pHash)\r
 {\r
        char ToEncrypt[256];\r
@@ -177,11 +175,17 @@ void HashORACLE(unsigned char* pPlain, int nPlainLen, unsigned char* pHash)
        DES_key_schedule ks1,ks2;\r
        unsigned char deskey_fixed[]={ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef};\r
        int i,j;\r
-\r
-       strcpy (username, "SYS");\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
+       strcpy_s(username, sizeof(username), "SYS");\r
+#else\r
+       strcpy(username, "SYS");\r
+#endif\r
        int userlen = 3;\r
-       \r
-       strupr ((char*) pPlain);\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
+       _strupr((char*) pPlain);\r
+#else\r
+       strupr((char*) pPlain);\r
+#endif\r
        memset (ToEncrypt,0,sizeof(ToEncrypt));\r
 \r
        for (i=1,j=0; j<userlen; i++,j++)\r
@@ -216,12 +220,6 @@ void HashNTLM(unsigned char* pPlain, int nPlainLen, unsigned char* pHash)
                UnicodePlain[i * 2 + 1] = 0x00;\r
        }\r
 \r
-       /*MD4_CTX ctx;\r
-       MD4_Init(&ctx);\r
-       MD4_Update(&ctx, UnicodePlain, nPlainLen * 2);\r
-       MD4_Final(pHash, &ctx);*/\r
-\r
-       //MD4(UnicodePlain, nPlainLen * 2, pHash);\r
        MD4_NEW(UnicodePlain, nPlainLen * 2, pHash);\r
 }\r
 \r
@@ -239,13 +237,7 @@ void HashMD2(unsigned char* pPlain, int nPlainLen, unsigned char* pHash)
 \r
 void HashMD4(unsigned char* pPlain, int nPlainLen, unsigned char* pHash)\r
 {\r
-       /*MD4_CTX ctx;\r
-       MD4_Init(&ctx);\r
-       MD4_Update(&ctx, pPlain, nPlainLen);\r
-       MD4_Final(pHash, &ctx);*/\r
-\r
        MD4_NEW(pPlain, nPlainLen, pHash);\r
-       //MD4(pPlain, nPlainLen, pHash);\r
 }\r
 \r
 void HashMD5(unsigned char* pPlain, int nPlainLen, unsigned char* pHash)\r
index c22a04732a5bd235cd3c6ace354b08d5e2e30a19..a6b77b53fe72b230666d042241ba0e6fe9dcc623 100644 (file)
@@ -7,7 +7,7 @@
  * 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 racrcki_mt.\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
 \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 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
index e4dc811b8ec3ee0395e617a0f69350a840be4f3a..c85193f95297df3e96c1c19f98720ad8a8a5067b 100644 (file)
@@ -7,7 +7,7 @@
  * 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 racrcki_mt.\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
@@ -23,7 +23,7 @@
  * along with rcracki_mt.  If not, see <http://www.gnu.org/licenses/>.\r
  */\r
 \r
-#ifdef _WIN32\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
        #pragma warning(disable : 4786 4267 4018)\r
 #endif\r
 \r
index ebd0a177741814bfca615c98ed5b129932f8050c..2d53125261d3ef3177ed6b0aaa88aa30d2263833 100644 (file)
@@ -7,7 +7,7 @@
  * 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 racrcki_mt.\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
index 853efca79bc49dcda36245ab62465e526d30da56..683af0bf5f4a182dee788dd6de03f82887080359 100644 (file)
@@ -7,7 +7,7 @@
  * 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 racrcki_mt.\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
@@ -23,7 +23,7 @@
  * along with rcracki_mt.  If not, see <http://www.gnu.org/licenses/>.\r
  */\r
 \r
-#ifdef _WIN32\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
        #pragma warning(disable : 4786 4267 4018)\r
 #endif\r
 \r
index 17ed1292c80776dba2621d59a7fd54ad325b873b..d3f410a0c38d5ff49d82b0dc8f01b2d6a1ed0c39 100644 (file)
@@ -7,7 +7,7 @@
  * 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 racrcki_mt.\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
index a19f0c0bf594463818e1ee041782e2939d6cf0b9..3be21210d842a4f0871cd9454b7b76fdaf77787a 100644 (file)
@@ -5,7 +5,7 @@
 # Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
 # Copyright 2009, 2010 James Nobis <frt@quelrod.net>
 #
-# This file is part of racrcki_mt.
+# 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
 SHELL = /bin/sh
 BIN = $(DESTDIR)/usr/bin
 CC = g++
-OPTIMIZATION = -O3
-INCLUDES = -I../../Common/rt\ api
+OPTIMIZATION = -O3 -mtune=native
 CFLAGS = -Wall -ansi $(OPTIMIZATION) -c $(DEBUG)
-LFLAGS = -Wall -ansi $(OPTIMIZATION) $(DEBUG)
+LFLAGS = -Wall -ansi -filt $(OPTIMIZATION) $(DEBUG)
 LIBS = -lcrypto -lpthread
-OBJS = BaseRTReader.o ChainWalkContext.o ChainWalkSet.o CrackEngine.o fast_md5.o HashAlgorithm.o HashRoutine.o HashSet.o lm2ntlm.o md4.o MemoryPool.o Public.o RainbowCrack.o rcrackiThread.o RTI2Reader.o sha1.o
-COMMON_API_PATH = ../../Common/rt\ api
+OBJS = BaseRTReader.o ChainWalkContext.o ChainWalkSet.o CrackEngine.o fast_md5.o HashAlgorithm.o HashRoutine.o HashSet.o lm2ntlm.o md4.o MemoryPool.o Public.o RainbowCrack.o rcrackiThread.o RTI2Reader.o
+#sha1.o
+WARNALL = -Wextra -Wunused-macros -Wunsafe-loop-optimizations -Wundef -Woverlength-strings -Wdisabled-optimization -Wformat-extra-args -Wformat-security -Winline
 
 OSNAME = $(shell uname -s)
-STRIP = $(shell which strip) --strip-debug
+# apparently --string-debug works on Linux, OpenBSD, NetBSD, and FreeBSD
+# but not on OSX so to the short name -S
+STRIP = $(shell which strip) -S
 
 #LIBS_Darwin = -lcrypto
 LIBS_NetBSD = -ldes
@@ -51,9 +53,51 @@ clean:
 debug: DEBUG += -DDEBUG -g
 debug: rcracki_mt
 
-debugall: DEBUG += -DDEBUG -g -Wextra -Wunused-macros -Wunsafe-loop-optimizations -Wundef -Woverlength-strings -Wdisabled-optimization -Wformat-extra-args -Wformat-security -Winline
+debugall: DEBUG += -DDEBUG -g $(WARNALL)
 debugall: rcracki_mt
 
+dumpasmall: DEBUG += -S -fverbose-asm
+dumpasmall: rcracki_mt
+
+dumpasmprofileuseall: DEBUG += -S -fverbose-asm
+dumpasmprofileuseall: profileuseall
+
+debugprofileuseall: DEBUG += -fprofile-use
+debugprofileuseall: debugall
+
+m32: DEBUG += -m32
+m32: rcracki_mt
+
+m32debug: DEBUG += -m32
+m32debug: debug
+
+m32debugall: DEBUG += -m32
+m32debugall: debugll
+
+m32dumpasmall: DEBUG += -m32
+m32dumpasmall: dumpasmall
+
+m32dumpasmprofileuseall: DEBUG += -S -fverbose-asm -m32
+m32dumpasmprofileuseall: profileuseall
+
+m32profilegenall: DEBUG += -m32
+m32profilegenall: profilegenall
+
+m32profileuseall: DEBUG += -m32
+m32profileuseall: profileuseall
+
+profilegenall: DEBUG += -fprofile-generate $(WARNALL)
+profilegenall: rcracki_mt
+
+profileuseall: DEBUG += -fprofile-use $(WARNALL)
+profileuseall: rcracki_mt
+
+gcovall: DEBUG += -DDEBUG -g -fprofile-arcs -ftest-coverage
+gcovall: rcracki_mt
+
+gprofall: DEBUG += -DDEBUG -g -pg
+gprofall: rcracki_mt
+
 install:
        install -d $(BIN)
        install --group=root --owner=root --mode=755 rcracki_mt $(BIN)
@@ -78,13 +122,11 @@ ChainWalkSet.o: Public.h ChainWalkSet.h ChainWalkSet.cpp
 CrackEngine.o: CrackEngine.h CrackEngine.cpp Public.h HashSet.h ChainWalkContext.h MemoryPool.h ChainWalkSet.h rcrackiThread.h RTI2Reader.h
         $(CC) $(CFLAGS) CrackEngine.cpp
 
-fast_md5.o: $(COMMON_API_PATH)/fast_md5.h $(COMMON_API_PATH)/fast_md5.cpp \
-       $(COMMON_API_PATH)/global.h
-        $(CC) $(CFLAGS) $(COMMON_API_PATH)/fast_md5.cpp
+fast_md5.o: fast_md5.h fast_md5.cpp global.h
+        $(CC) $(CFLAGS) fast_md5.cpp
 
 #HashAlgorithm.o: HashAlgorithm.h HashAlgorithm.cpp Public.h fast_md5.h md4.h sha1.h
-HashAlgorithm.o: HashAlgorithm.h HashAlgorithm.cpp Public.h \
-       $(COMMON_API_PATH)/fast_md5.h md4.h
+HashAlgorithm.o: HashAlgorithm.h HashAlgorithm.cpp Public.h fast_md5.h md4.h
         $(CC) $(CFLAGS) HashAlgorithm.cpp
 
 HashRoutine.o: HashRoutine.h HashRoutine.cpp global.h HashAlgorithm.h
@@ -114,5 +156,5 @@ rcrackiThread.o: rcrackiThread.h rcrackiThread.cpp ChainWalkContext.h Public.h H
 RTI2Reader.o: RTI2Reader.h RTI2Reader.cpp BaseRTReader.h
        $(CC) $(CFLAGS) RTI2Reader.cpp
 
-sha1.o: sha1.h sha1.cpp global.h
-        $(CC) $(CFLAGS) sha1.cpp
+#sha1.o: sha1.h sha1.cpp global.h
+#       $(CC) $(CFLAGS) sha1.cpp
index f48961d895dfdceb07a28843378ebe5f023ee405..3673446af24dcc9e89a72418d24516deff914f5f 100644 (file)
@@ -8,7 +8,7 @@
  * Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
  * Copyright 2010 uroskn\r
  *\r
- * This file is part of racrcki_mt.\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
@@ -37,7 +37,11 @@ CMemoryPool::CMemoryPool(unsigned int bytesSaved, bool bDebug, uint64 maxMem)
 \r
        if ( debug )\r
        {\r
-               printf( "Debug: nAvailPhys: %llu\n", nAvailPhys );\r
+               #ifdef _WIN32\r
+                       printf( "Debug: nAvailPhys: %I64u\n", nAvailPhys );\r
+               #else\r
+                       printf( "Debug: nAvailPhys: %llu\n", nAvailPhys );\r
+               #endif\r
                printf( "Debug: bytesSaved: %d\n", bytesSaved );\r
        }\r
 \r
index a53c4861cb9821721ad6df683ccce87c038979e3..62ae52766014cf4bc1740ee336cb4037b2eb8c02 100644 (file)
@@ -8,7 +8,7 @@
  * Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
  * Copyright 2010 uroskn\r
  *\r
- * This file is part of racrcki_mt.\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
index 0aba1a8943311706202a6cbef4afde7d8f340e0f..41a95155ec9f47c41bf25630d5bf70aa69148481 100644 (file)
@@ -7,7 +7,7 @@
  * 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 racrcki_mt.\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
@@ -22,7 +22,7 @@
  * along with rcracki_mt.  If not, see <http://www.gnu.org/licenses/>.\r
  */\r
 \r
-#ifdef _WIN32\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
        #pragma warning(disable : 4786 4267 4018)\r
 #endif\r
 \r
 \r
 #ifdef _WIN32\r
        #include <windows.h>\r
+#endif\r
+\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
+       #include <windows.h>\r
        #include <time.h>\r
 \r
        #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)\r
@@ -161,8 +165,8 @@ bool GetHybridCharsets(string sCharset, vector<tCharset>& vCharset)
        if(sCharset.substr(0, 6) != "hybrid") // Not hybrid charset\r
                return false;\r
 \r
-       UINT4 nEnd = (int) sCharset.rfind(')');\r
-       UINT4 nStart = (int) sCharset.rfind('(');\r
+       string::size_type nEnd = sCharset.rfind(')');\r
+       string::size_type nStart = (int) sCharset.rfind('(');\r
        string sChar = sCharset.substr(nStart + 1, nEnd - nStart - 1);\r
        vector<string> vParts;\r
        SeperateString(sChar, ",", vParts);\r
@@ -202,8 +206,8 @@ bool ReadLinesFromFile(string sPathName, vector<string>& vLine)
                                content[i] = '\n';\r
                }\r
 \r
-               int n;\r
-               while ((n = content.find("\n", 0)) != -1)\r
+               string::size_type n;\r
+               while ((n = content.find("\n", 0)) != string::npos)\r
                {\r
                        string line = content.substr(0, n);\r
                        line = TrimString(line);\r
@@ -241,8 +245,8 @@ bool SeperateString(string s, string sSeperator, vector<string>& vPart)
        unsigned int i;\r
        for (i = 0; i < sSeperator.size(); i++)\r
        {\r
-               int n = s.find(sSeperator[i]);\r
-               if (n != -1)\r
+               string::size_type n;\r
+               if ( (n = s.find(sSeperator[i])) != string::npos)\r
                {\r
                        vPart.push_back(s.substr(0, n));\r
                        s = s.substr(n + 1);\r
@@ -301,7 +305,7 @@ string HexToStr(const unsigned char* pData, int nLen)
 \r
 uint64 GetAvailPhysMemorySize()\r
 {\r
-#ifdef _WIN32\r
+#if defined(_WIN32)\r
        MEMORYSTATUS ms;\r
        GlobalMemoryStatus(&ms);\r
        return ms.dwAvailPhys;\r
@@ -331,6 +335,7 @@ string GetApplicationPath()
        GetModuleFileName(NULL, fullPath, FILENAME_MAX);\r
 #else\r
        char szTmp[32];\r
+       // XXX linux/proc file system dependen\r
        sprintf(szTmp, "/proc/%d/exe", getpid());\r
        int bytes = readlink(szTmp, fullPath, FILENAME_MAX);\r
        if(bytes >= 0)\r
@@ -339,12 +344,12 @@ string GetApplicationPath()
 \r
        string sApplicationPath = fullPath;\r
 #ifdef _WIN32\r
-       int nIndex = sApplicationPath.find_last_of('\\');\r
+       string::size_type nIndex = sApplicationPath.find_last_of('\\');\r
 #else\r
-       int nIndex = sApplicationPath.find_last_of('/');\r
+       string::size_type nIndex = sApplicationPath.find_last_of('/');\r
 #endif\r
 \r
-       if (nIndex != -1)\r
+       if ( nIndex != string::npos )\r
                sApplicationPath = sApplicationPath.substr(0, nIndex+1);\r
 \r
        //printf ("\n\nDebug: The application directory is %s\n", sApplicationPath.c_str());\r
index 13fb0d380eb44d2f7bf2af3b5815e113c6912ad0..27d4dcda5a99703a651412695d4cb4d9c4847371 100644 (file)
@@ -6,7 +6,7 @@
  * 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 racrcki_mt.\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
@@ -109,13 +109,16 @@ void tty_done();
 void tty_init();\r
 void tty_flush(void);\r
 // end nmap code\r
+#endif\r
 \r
-#include <sys/time.h>\r
-\r
-#else\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
        int gettimeofday( struct timeval *tv, struct timezone *tz );\r
 #endif\r
 \r
+#if !defined(_WIN32) || defined(__GNUC__)\r
+       #include <sys/time.h>\r
+#endif\r
+\r
 timeval sub_timeofday( timeval tv2, timeval tv );\r
 \r
 unsigned int GetFileLen(FILE* file);\r
index 873c8689c6ac2b917ce84667e79db683a1f89520..3719dd6c90682a641b168221e8397abdaf17f9a5 100644 (file)
@@ -92,7 +92,8 @@ 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 \r
 features were added over time, making it less of an unofficial version with every release.\r
 \r
-James Nobis - <quel> is making improvements on the *nix compatibility.\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
@@ -108,22 +109,22 @@ SUPPORTED PLATFORMS
 ================\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 versions.  It has been tested on:\r
-32-bit Ubuntu 8.10 (Intrepid Ibex)\r
-32-bit Debian GNU/Linux 5.0 (Lenny)\r
-64-bit Debian GNU/Linux 5.0 (Lenny)\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 (10.5)\r
+32-bit MacOSX\r
 \r
-32-bit FreeBSD (7.2)\r
-64-bit FreeBSD (7.2)\r
-32-bit NetBSD (5.0)\r
-32-bit OpenBSD (4.5) - you must install and use eg++ (g++ 4.2 from ports)\r
-64-bit OpenBSD (4.5)\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 (10.6)\r
+64-bit MacOSX\r
 \r
 Please note that to compile under the BSDs you must use gmake.\r
 \r
index 3d8154d2ebaf688a3972d13041ce53b3810f025e..692c73e0961ab6ae9de8668816d77906b9a523d1 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
  * Copyright 2010 James Nobis <frt@quelrod.net>
  *
- * This file is part of racrcki_mt.
+ * 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
@@ -59,8 +59,8 @@ RTI2Reader::RTI2Reader(string Filename)
        memcpy(m_pHeader, m_pIndex, sizeof(RTI2Header));
        m_pHeader->m_cppos = (unsigned int*)(m_pIndex + 8);
        m_pHeader->prefixstart = *(uint64*)(m_pIndex + 8 + (m_pHeader->rti_cplength * 4));
-       m_chainsizebytes = ceil((float)(m_pHeader->rti_startptlength + m_pHeader->rti_endptlength + m_pHeader->rti_cplength) / 8); // Get the size of each chain in bytes
-       m_indexrowsizebytes = ceil((float)m_pHeader->rti_index_numchainslength / 8);
+       m_chainsizebytes = (UINT4)ceil((float)(m_pHeader->rti_startptlength + m_pHeader->rti_endptlength + m_pHeader->rti_cplength) / 8); // Get the size of each chain in bytes
+       m_indexrowsizebytes = (UINT4)ceil((float)m_pHeader->rti_index_numchainslength / 8);
        // Check the filesize
        fseek(m_pFile, 0, SEEK_END);
        len = ftell(m_pFile);
@@ -121,7 +121,7 @@ int RTI2Reader::ReadChains(unsigned int &numChains, RainbowChainO *pData)
        uint64 chainrow = 0; // Buffer to store a single read chain
        unsigned int chainsProcessed = 0; // Number of chains processed
 
-       // ALERT: same problem with unsigned char here.
+       // XXX: same problem with unsigned char here.
        unsigned int NumChainsInRow = *(pNumChains + indexRow);
        while(chainsProcessed < numChains && fread(&chainrow, 1, m_chainsizebytes, m_pFile) == m_chainsizebytes)
        {
@@ -138,13 +138,17 @@ int RTI2Reader::ReadChains(unsigned int &numChains, RainbowChainO *pData)
                        curRowPosition = 0;
                }
                // Load the starting point from the data
-               pData[chainsProcessed].nIndexS = chainrow << 64 - m_pHeader->rti_startptlength;
-               pData[chainsProcessed].nIndexS = pData[chainsProcessed].nIndexS >> 64 - m_pHeader->rti_startptlength;
+               pData[chainsProcessed].nIndexS = chainrow << ( 64 - m_pHeader->rti_startptlength );
+               pData[chainsProcessed].nIndexS = pData[chainsProcessed].nIndexS >> ( 64 - m_pHeader->rti_startptlength );
 
                // Load the ending point prefix 
-               pData[chainsProcessed].nIndexE = m_pHeader->prefixstart + indexRow << m_pHeader->rti_endptlength;
+               pData[chainsProcessed].nIndexE = ( m_pHeader->prefixstart + indexRow ) << m_pHeader->rti_endptlength;
                // Append the ending point suffix
+#if defined(_WIN32) && !defined(__GNUC__)
+               pData[chainsProcessed].nIndexE |= (chainrow & (0xFFFFFFFFFFFFFFFFI64 >> m_pHeader->rti_cplength)) >> m_pHeader->rti_startptlength;
+#else
                pData[chainsProcessed].nIndexE |= (chainrow & (0xFFFFFFFFFFFFFFFFllu >> m_pHeader->rti_cplength)) >> m_pHeader->rti_startptlength;
+#endif
                //pData[chainsProcessed].nCheckPoint = (chainrow >> m_pHeader->rti_startptlength + m_pHeader->rti_endptlength);
                curRowPosition++;
                chainsProcessed++;
index c3fc3bbf87ac63ba7a44f2730970db3c7ec525eb..cd36e7db26c693943dde77b3cdd30e3720aa6ee3 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
  * Copyright 2010 James Nobis <frt@quelrod.net>
  *
- * This file is part of racrcki_mt.
+ * 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
@@ -49,12 +49,12 @@ class RTI2Reader : BaseRTReader
 {
 private:
        FILE *m_pFile;
-       unsigned int m_chainPosition;
+       UINT4 m_chainPosition;
        unsigned char *m_pPos, *m_pChainPos;
        static RTI2Header *m_pHeader;
        unsigned char *m_pIndex;
-       unsigned int m_chainsizebytes;
-       unsigned int m_indexrowsizebytes;
+       UINT4 m_chainsizebytes;
+       UINT4 m_indexrowsizebytes;
        
 
 public:
index 9814834a560c49476e052247f64f48b908590f89..2959787041a0f828af291ccaf256b48f7dc850f8 100644 (file)
@@ -16,7 +16,7 @@
  * 2009-01-04 - <james.dickson@comhem.se> - Slightly modified (or "fulhack" as \r
  * we say in sweden)  to support cain .lst files.\r
  *\r
- * This file is part of racrcki_mt.\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
@@ -32,7 +32,7 @@
  * along with rcracki_mt.  If not, see <http://www.gnu.org/licenses/>.\r
  */\r
 \r
-#ifdef _WIN32\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
        #pragma warning(disable : 4786 4267 4018)\r
 #endif\r
 \r
@@ -49,7 +49,7 @@
        #include <dirent.h>\r
 #endif\r
 \r
-#ifdef _WIN32\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
        #pragma comment(lib, "libeay32.lib")\r
 #endif\r
 \r
@@ -61,15 +61,15 @@ void GetTableList(string sWildCharPathName, vector<string>& vPathName)
        //vPathName.clear();\r
 \r
        string sPath;\r
-       int n = sWildCharPathName.find_last_of('\\');\r
+       string::size_type n = sWildCharPathName.find_last_of('\\');\r
 \r
-       if (n == (sWildCharPathName.size() - 1))\r
+       if ( n == (sWildCharPathName.size() - 1) )\r
        {\r
                sWildCharPathName = sWildCharPathName.substr(0, n);\r
                n = sWildCharPathName.find_last_of('\\');\r
        }\r
 \r
-       if (n != -1)\r
+       if (n != string::npos)\r
                sPath = sWildCharPathName.substr(0, n + 1);\r
 \r
        _finddata_t fd;\r
index 98700d5400f52f5b303564fb525894b9b863ac02..ad8273ca6926e44d925e6fcc7677cfa934ec43a1 100644 (file)
@@ -1,10 +1,7 @@
-* linux thread priorities
 * testing/benchmarking suite
 * remove openssl dependencies
-       ChainWalkContext.cpp
-               rand.h
        HashAlgorithm.cpp
-               des.h
+               des.h - can't use frt upstream as it's BSD licensed ad clause and is GPL incompatible
                md4.h (fix md4 so it can handle mscache lengths)
                sha.h (the local sha1 impl is slower than openssl's)
 * more generic method for path seperator than _WIN32 ifdef?
 OpenBSD threading
 
 misc warnings:
-/tmp//ccWUTqDK.o(.text+0xcc7): In function `HashORACLE(unsigned char*, int, unsigned char*)':
-: warning: strcpy() is almost always misused, please use strlcpy()
-/usr/lib/libstdc++.so.47.0: warning: strcat() is almost always misused, please use strlcat()
+################################################################################
+OpenBSD x86_64
 
-/tmp//ccmjYwuS.o(.text+0xbf9): In function `CChainWalkSet::CheckOrRotatePreCalcFile()':
+/usr/local/lib/gcc/amd64-unknown-openbsd4.5/4.2.0/../../../libestdc++.so.8.0: warning: vsprintf() is often misused, please use vsnprintf()
+/usr/local/lib/gcc/amd64-unknown-openbsd4.5/4.2.0/../../../libestdc++.so.8.0: warning: strcpy() is almost always misused, please use strlcpy()
+/usr/local/lib/gcc/amd64-unknown-openbsd4.5/4.2.0/../../../libestdc++.so.8.0: warning: strcat() is almost always misused, please use strlcat()
+ChainWalkSet.o(.text+0x121): In function `CChainWalkSet::CheckOrRotatePreCalcFile()':
 : warning: sprintf() is often misused, please use snprintf()
 
-ChainWalkSet.cpp: In member function 'bool CChainWalkSet::FindInFile(long long
-unsigned int*, unsigned char*, int)':
-ChainWalkSet.cpp:154: warning: 'offset' may be used uninitialized in this
-function
+################################################################################
+only on win32 mingw32
 
 ChainWalkContext.cpp: In member function 'void CChainWalkContext::HashToIndex(int)':
-ChainWalkContext.cpp:544: warning: dereferencing type-punned pointer will break strict-aliasing rules
+ChainWalkContext.cpp:574: warning: dereferencing type-punned pointer will break strict-aliasing rules
 
 HashAlgorithm.cpp: In function 'void HashPIX(unsigned char*, int, unsigned char*)':
-HashAlgorithm.cpp:396: warning: dereferencing type-punned pointer will break strict-aliasing rules
+HashAlgorithm.cpp:406: warning: dereferencing type-punned pointer will break strict-aliasing rules
index 3df6afb276b8004dada612f12c001acea915c06b..514be09b0eed9b1e9c7520f42ad4d05079f2549b 100644 (file)
@@ -16,7 +16,7 @@
  * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
  * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
  *
- * This file is part of racrcki_mt.
+ * 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
index 47549f7636fb23440828b98182fbab463210cd57..b3db17f6cfdb2763ad25b9f178493fd83770a131 100644 (file)
@@ -13,7 +13,7 @@
  * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
  * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
  *
- * This file is part of racrcki_mt.
+ * 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
@@ -29,7 +29,6 @@
  * along with rcracki_mt.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-
 #ifndef FAST_MD5_H
 #define FAST_MD5_H
 
@@ -37,8 +36,6 @@
 
 #define MD5_DIGEST_LENGTH 16
 
-void
-fast_MD5(unsigned char *pData, int len, unsigned char *pDigest);
-
+void fast_MD5(unsigned char *pData, int len, unsigned char *pDigest);
 
 #endif // FAST_MD5_H
index 04c4e804dd1cd7b68f23398fa6adb916ac013655..952aab45deee9077d71d07fa21b5e9cb38435d40 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
  * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
  *
- * This file is part of racrcki_mt.
+ * 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
index d2afd27baf2e70566e4556121cdb2d1a96099594..33fd94d2abb3d9dda07baaf9eb0ae4feb13f0821 100644 (file)
@@ -5,7 +5,7 @@
  * 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 racrcki_mt.\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
@@ -21,7 +21,7 @@
  * along with rcracki_mt.  If not, see <http://www.gnu.org/licenses/>.\r
  */\r
 \r
-#ifdef _WIN32\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
        #pragma warning(disable : 4786 4267 4018)\r
 #endif\r
 \r
index e6080407620b4820531c1ba317461fcec05c50af..6a423f5f370f8688545ef565eb6ec35ad2fafbe5 100644 (file)
@@ -5,7 +5,7 @@
  * 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 racrcki_mt.\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
index a35cdb541a78488f4f4023e694879da7eb496e2c..e5d9c2f4fe4d752a43648acf4dbb7670fe639616 100644 (file)
@@ -6,7 +6,7 @@
  * 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 racrcki_mt.\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
index fd112782e4e5ce4905b8dca91b5137ee58d942ca..91753cbe300ed38a5cba9aefd6580773e3b518e4 100644 (file)
@@ -6,7 +6,7 @@
  * 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 racrcki_mt.\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
index 8123ba5d11d632a531c44fa94beefe31fd117315..0b64a7a6346d11f8fcab294943e5a50d59328559 100644 (file)
@@ -5,7 +5,7 @@
  * 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 racrcki_mt.\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
@@ -21,7 +21,7 @@
  * along with rcracki_mt.  If not, see <http://www.gnu.org/licenses/>.\r
  */\r
 \r
-#ifdef _WIN32\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
        #pragma warning(disable : 4786 4267 4018)\r
 #endif\r
 \r
index c5abeb4acf4fedcb65f7780406b3bb35881e1ad3..37fa28915d966e9bf17e763eaf894fd8b8477fe1 100644 (file)
@@ -5,7 +5,7 @@
  * 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 racrcki_mt.\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
index 17edb0a045bcea8f446b2380970510d6c5a2933c..27ab17e98e68537a58a318d02a6fa47ef9beb485 100644 (file)
@@ -1,33 +1,33 @@
-# 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.
+# 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
 #AlwaysKeepPrecalcFiles=1
\ No newline at end of file
index c1af7746a93017d9e851a97ef50bd315f8a27521..40c0e9f26c9b517fa2bfedf2d9535f4f9b4ed98d 100644 (file)
@@ -7,7 +7,7 @@
  * 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 racrcki_mt.\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
index 0e5927061a48e65e33ca30c1d0af082b6bbcbe91..231077b2ad91bdcbaffd4fbe673d38a48c1f7cdb 100644 (file)
@@ -5,7 +5,7 @@
  * 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 racrcki_mt.\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