From 12e9c3bd02b40f9c8d6d2f88166201abd59b01b1 Mon Sep 17 00:00:00 2001 From: James Nobis Date: Sat, 9 Oct 2010 15:44:14 -0500 Subject: [PATCH] rti2rto 64-bit fixes and Makefile cleanup --- Client Applications/rti2rto/Makefile | 8 +++++--- Client Applications/rti2rto/rti2rto.cpp | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Client Applications/rti2rto/Makefile b/Client Applications/rti2rto/Makefile index e31e1de..3eadfbf 100644 --- a/Client Applications/rti2rto/Makefile +++ b/Client Applications/rti2rto/Makefile @@ -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 diff --git a/Client Applications/rti2rto/rti2rto.cpp b/Client Applications/rti2rto/rti2rto.cpp index bf08be3..e4ee4fc 100644 --- a/Client Applications/rti2rto/rti2rto.cpp +++ b/Client Applications/rti2rto/rti2rto.cpp @@ -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 +} -- 2.39.2