]> git.sesse.net Git - freerainbowtables/commitdiff
rti2rto 64-bit fixes and Makefile cleanup
authorJames Nobis <quel@paranoia.quelrod.net>
Sat, 9 Oct 2010 20:44:14 +0000 (15:44 -0500)
committerJames Nobis <quel@paranoia.quelrod.net>
Sat, 9 Oct 2010 20:44:14 +0000 (15:44 -0500)
Client Applications/rti2rto/Makefile
Client Applications/rti2rto/rti2rto.cpp

index e31e1de397cf9a6041d5a999ff88d968cc49ed4a..3eadfbf8275cbb4e87bad9bfa29f12f2913242e6 100644 (file)
@@ -2,9 +2,8 @@ SHELL = /bin/sh
 CC = g++
 OPTIMIZATION = -O3
 INCLUDES = -I../../Common/rt\ api -I../../Server\ Applications/rsearchi
-# XXX todo currently only 32-bit targets work
-CFLAGS = -Wall -m32 -std=c++98 $(INCLUDES) $(OPTIMIZATION) -c
-LFLAGS = -Wall -m32 -std=c++98 $(INCLUDES) $(OPTIMIZATION)
+CFLAGS = -Wall -ansi $(INCLUDES) $(OPTIMIZATION) -c $(DEBUG)
+LFLAGS = -Wall -ansi $(INCLUDES) $(OPTIMIZATION) $(DEBUG)
 LIBS = 
 OBJS = MemoryPool.o Public.o RTI2Reader.o RTIReader.o
 COMMON_API_PATH = ../../Common/rt\ api
@@ -17,6 +16,9 @@ rti2rto: $(OBJS)
 clean:
        rm -f *.o rti2rto
 
+debug: DEBUG += -DDEBUG -g
+debug: all
+
 rebuild: clean all
 
 MemoryPool.o: $(COMMON_API_PATH)/MemoryPool.h $(COMMON_API_PATH)/MemoryPool.cpp $(COMMON_API_PATH)/Public.h
index bf08be3a58a1909cf49b77c053e55f6f6897057d..e4ee4fc740cfd88cd60e7c0322a3f00252ad95a7 100644 (file)
@@ -98,6 +98,7 @@ void ConvertRainbowTable(string sPathName, string sResultFileName, string sType)
        static CMemoryPool mp;
        unsigned int nAllocatedSize;
        BaseRTReader *reader = NULL;
+
        if(sType == "RTI2")
                reader = (BaseRTReader*)new RTI2Reader(sFileName);
        else if(sType == "RTI")
@@ -107,6 +108,7 @@ void ConvertRainbowTable(string sPathName, string sResultFileName, string sType)
                printf("Invalid table type '%s'", sType.c_str());
                return ;
        }
+
        RainbowChainCP* pChain = (RainbowChainCP*)mp.Allocate(reader->GetChainsLeft() * sizeof(RainbowChainCP), nAllocatedSize);
        if (pChain != NULL)
        {
@@ -115,7 +117,7 @@ void ConvertRainbowTable(string sPathName, string sResultFileName, string sType)
                while(reader->GetChainsLeft() > 0)
                {
                        reader->ReadChains(nChains, pChain);
-                       for(int i = 0; i < nChains; i++)
+                       for(UINT4 i = 0; i < nChains; i++)
                        {
                                fwrite(&pChain[i], 1, 16, fResult);
                        }
@@ -156,7 +158,7 @@ int main(int argc, char* argv[])
                printf("no rainbow table found\n");
                return 0;
        }
-       for (int i = 0; i < vPathName.size(); i++)
+       for (UINT4 i = 0; i < vPathName.size(); i++)
        {
                string sResultFile, sType;
                        
@@ -179,4 +181,4 @@ int main(int argc, char* argv[])
                printf("\n");
        }
        return 0;
-}
\ No newline at end of file
+}