]> git.sesse.net Git - freerainbowtables/commitdiff
misc cleanup
authorJames Nobis <quel@quelrod.net>
Wed, 19 Jan 2011 01:49:23 +0000 (19:49 -0600)
committerJames Nobis <quel@quelrod.net>
Wed, 19 Jan 2011 01:49:23 +0000 (19:49 -0600)
Common/rt api/BaseRTReader.h
Common/rt api/ChainWalkContext.cpp
Common/rt api/ChainWalkContext.h
Common/rt api/md4.h

index a9923cf325683b768da4bf056a3e8f63fbce57aa..9eecd25516de5f6f723a12c77a0aac4112406d9f 100644 (file)
@@ -37,8 +37,8 @@ using namespace std;
 class BaseRTReader
 {
 public:
-       virtual int ReadChains(UINT4 &numChains, RainbowChain *pData) = 0;
-       virtual UINT4 GetChainsLeft() = 0;
+       virtual int ReadChains(uint32 &numChains, RainbowChainO *pData) = 0;
+       virtual uint32 GetChainsLeft() = 0;
        
        virtual ~BaseRTReader()  { };
 };
index f551d639b5fc6fd397efe3b34bee9937719a62f3..2fe6b1b87b780c64ce45f34879e5e4fee32a0e27 100644 (file)
@@ -410,8 +410,12 @@ void CChainWalkContext::Dump()
        printf("hash routine: %s\n", m_sHashRoutineName.c_str());
        printf("hash length: %d\n", m_nHashLen);
 
+       printf( "m_vCharset[0].m_nPlainCharSetLen: %d\n", m_vCharset[0].m_nPlainCharsetLen );
+       printf( "m_vCharset[1].m_nPlainCharSetLen: %d\n", m_vCharset[1].m_nPlainCharsetLen );
+
        printf("plain charset: ");
        unsigned int i;
+       
        for (i = 0; i < m_vCharset[0].m_nPlainCharsetLen; i++)
        {
                if (isprint(m_vCharset[0].m_PlainCharset[i]))
@@ -548,15 +552,11 @@ void CChainWalkContext::IndexToPlain()
                }
                m_Plain[i] = m_vCharset[j].m_PlainCharset[nTemp];
 #else
-               __asm__ __volatile__ (  "mov %2, %%eax;"
-                                                               "xor %%edx, %%edx;"
+               __asm__ __volatile__ ("xor %%edx, %%edx;"
                                                                "divl %3;"
-                                                               "mov %%eax, %0;"
-                                                               "mov %%edx, %1;"
-                                                               : "=m"(nIndexOfX32), "=m"(nTemp)
-                                                               : "m"(nIndexOfX32), "m"(m_vCharset[j].m_nPlainCharsetLen)
-                                                               : "%eax", "%edx"
-                                                        );
+                                                               : "=a"(nIndexOfX32), "=d"(nTemp)
+                                                               : "a"(nIndexOfX32), "rm"(m_vCharset[j].m_nPlainCharsetLen)
+                                                               : );
                m_Plain[i] = m_vCharset[j].m_PlainCharset[nTemp];
 #endif
                break;
@@ -605,24 +605,7 @@ string CChainWalkContext::GetBinary()
 {
        return HexToStr(m_Plain, m_nPlainLen);
 }
-/*
-string CChainWalkContext::GetPlainBinary()
-{
-       string sRet;
-       sRet += GetPlain();
-       int i;
-       for (i = 0; i < m_nPlainLenMax - m_nPlainLen; i++)
-               sRet += ' ';
 
-       sRet += "|";
-
-       sRet += GetBinary();
-       for (i = 0; i < m_nPlainLenMax - m_nPlainLen; i++)
-               sRet += "  ";
-
-       return sRet;
-}
-*/
 string CChainWalkContext::GetHash()
 {
        return HexToStr(m_Hash, m_nHashLen);
index 9854c59e0f2ef9f2f678723f6bed40ccfd437c1c..0435ef7dc58f5c02bfa04b5d01a1f14f54ecd131 100644 (file)
@@ -51,8 +51,8 @@ public:
        static bool isRti2RtFormat;
        static vector<stCharset> m_vCharset;
        static int m_nPlainLenMinTotal, m_nPlainLenMaxTotal;
-       static uint64 m_nPlainSpaceTotal;                                                       // Performance consideration
        static uint64 m_nPlainSpaceUpToX[MAX_PLAIN_LEN + 1];            // Performance consideration
+       static uint64 m_nPlainSpaceTotal;                                                       // Performance consideration
        static int m_nHybridCharset;
        static int m_nRainbowTableIndex;                                                        // Configuration
        static uint64 m_nReduceOffset;                                                          // Performance consideration
@@ -96,7 +96,6 @@ public:
        const uint64* GetIndexPtr();
        string GetPlain();
        string GetBinary();
-//     string GetPlainBinary();
        string GetHash();
        bool CheckHash(unsigned char* pHash);   // The length should be m_nHashLen
 };
index f83aa1a7cf21aec91cb4be8d2ca899ae0da6c518..0049e37f3173963d876e4991a9ed3cfc52030d64 100644 (file)
@@ -1,9 +1,32 @@
+/*
+ * freerainbowtables is a project for generating, distributing, and using
+ * perfect rainbow tables
+ *
+ * Copyright Bitweasil
+ * Copyright 2009, 2010 DaniĆ«l Niggebrugge <niggebrugge@fox-it.com>
+ * Copyright 2009, 2010, 2011 James Nobis <frt@quelrod.net>
+ *
+ * This file is part of freerainbowtables.
+ *
+ * freerainbowtables is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * freerainbowtables is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with freerainbowtables.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
 #ifndef MD4_H
 #define MD4_H
 
 #include "global.h"
 
-
 #define MD4_DIGEST_LENGTH 16
 
 //Main function