Permalink
Browse files

update

  • Loading branch information...
1 parent a6763d7 commit 7b0107a7cfc2c4ede63970620886a9aaa5e8ab5a @szank committed Aug 14, 2011
View
@@ -21,9 +21,18 @@
<builder autoBuildTarget="all" buildPath="${workspace_loc:/sequential/Default}" cleanBuildTarget="clean" id="org.eclipse.cdt.build.core.internal.builder.1713691945" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="org.eclipse.cdt.build.core.internal.builder"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1076707992" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1069393857" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
+ <option id="gnu.cpp.compiler.option.other.other.385661727" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fmessage-length=0 " valueType="string"/>
+ <option id="gnu.cpp.compiler.option.include.paths.946760914" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="/usr/include"/>
+ </option>
+ <option id="gnu.cpp.compiler.option.optimization.level.2142222890" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1745316292" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.815455266" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
+ <option id="gnu.c.compiler.option.include.paths.1056063292" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="/usr/include/openssl"/>
+ <listOptionValue builtIn="false" value="/usr/include"/>
+ </option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1440745059" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.79787019" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
@@ -41,6 +50,10 @@
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.assembler.base.1908900405" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
+ <option id="gnu.both.asm.option.include.paths.1199307112" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="/usr/include"/>
+ <listOptionValue builtIn="false" value="/usr/include/c++/4.6/parallel/"/>
+ </option>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1444490141" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
@@ -515,6 +528,7 @@
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+ <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
@@ -0,0 +1,3 @@
+MainClass.d MainClass.o: ../MainClass.cpp ../MainClass.h
+
+../MainClass.h:
Binary file not shown.
@@ -0,0 +1,5 @@
+Params.d Params.o: ../Params.cpp ../Params.h ../MainClass.h
+
+../Params.h:
+
+../MainClass.h:
Binary file not shown.
@@ -0,0 +1,58 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+-include ../makefile.init
+
+RM := rm -rf
+
+# All of the sources participating in the build are defined here
+-include sources.mk
+-include subdir.mk
+-include objects.mk
+
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(strip $(C++_DEPS)),)
+-include $(C++_DEPS)
+endif
+ifneq ($(strip $(C_DEPS)),)
+-include $(C_DEPS)
+endif
+ifneq ($(strip $(CC_DEPS)),)
+-include $(CC_DEPS)
+endif
+ifneq ($(strip $(CPP_DEPS)),)
+-include $(CPP_DEPS)
+endif
+ifneq ($(strip $(CXX_DEPS)),)
+-include $(CXX_DEPS)
+endif
+ifneq ($(strip $(C_UPPER_DEPS)),)
+-include $(C_UPPER_DEPS)
+endif
+endif
+
+-include ../makefile.defs
+
+# Add inputs and outputs from these tool invocations to the build variables
+
+# All Target
+all: sequential
+
+# Tool invocations
+sequential: $(OBJS) $(USER_OBJS)
+ @echo 'Building target: $@'
+ @echo 'Invoking: GCC C++ Linker'
+ g++ -o"sequential" $(OBJS) $(USER_OBJS) $(LIBS)
+ @echo 'Finished building target: $@'
+ @echo ' '
+
+# Other Targets
+clean:
+ -$(RM) $(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) sequential
+ -@echo ' '
+
+.PHONY: all clean dependents
+.SECONDARY:
+
+-include ../makefile.targets
@@ -0,0 +1,8 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+USER_OBJS :=
+
+LIBS := -lssl -lcrypto
+
Binary file not shown.
@@ -0,0 +1,27 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+O_SRCS :=
+CPP_SRCS :=
+C_UPPER_SRCS :=
+C_SRCS :=
+S_UPPER_SRCS :=
+OBJ_SRCS :=
+ASM_SRCS :=
+CXX_SRCS :=
+C++_SRCS :=
+CC_SRCS :=
+OBJS :=
+C++_DEPS :=
+C_DEPS :=
+CC_DEPS :=
+CPP_DEPS :=
+EXECUTABLES :=
+CXX_DEPS :=
+C_UPPER_DEPS :=
+
+# Every subdirectory with source files must be described here
+SUBDIRS := \
+. \
+
@@ -0,0 +1,27 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables
+CPP_SRCS += \
+../MainClass.cpp \
+../Params.cpp
+
+OBJS += \
+./MainClass.o \
+./Params.o
+
+CPP_DEPS += \
+./MainClass.d \
+./Params.d
+
+
+# Each subdirectory must supply rules for building sources it contributes
+%.o: ../%.cpp
+ @echo 'Building file: $<'
+ @echo 'Invoking: GCC C++ Compiler'
+ g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
+ @echo 'Finished building: $<'
+ @echo ' '
+
+
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -11,6 +11,7 @@
#include "PasswordGenerator.h"
+
int main()
{
// sequential test :
@@ -54,11 +55,33 @@ namespace mga {
{
// mga::PasswordGenerator generator(5,m_oParams.m_sAlphabet.c_str(),m_oParams.m_sAlphabet.c_str());
mga::PasswordGenerator generator(m_oParams);
+ int iRes = RET_OK;
while(const char * szHash = m_oParams.GetNextHash() )
- generator.ComputePasswordForHash(m_oParams.m_sHashFunction.c_str(),szHash);
+ {
+ iRes = generator.ComputePasswordForHash(m_oParams.m_sHashFunction.c_str(),szHash);
+ if( iRes == RET_FOUND )
+ SavePasswordToFile(szHash, generator.m_szPassword, m_oParams.m_sHashFunction.c_str() );
+ }
+ return 0;
}
+
+ //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ void
+ MainClass::SavePasswordToFile(const char * v_szHash ,const char* v_szResultPassword, const char * v_szCypher)
+ //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ {
+ char szFileName[1024] = { 0 } ;
+ char szTextLine[2048] = { 0 } ;
+ snprintf(szFileName,1023, "%s/%s_%s", MAIN_DIR, v_szCypher,"sequential.txt");
+ snprintf(szTextLine, 2047, "%s : %s \n", v_szHash, v_szResultPassword );
+ FILE* pFile = fopen(szFileName, "a+");
+ fwrite(szTextLine, sizeof(char) , strlen( szTextLine), pFile);
+ fclose( pFile);
+ cout << "password found , appending results to " << szFileName << endl ;
+ }
}
+
@@ -11,7 +11,7 @@
#define RET_OK 1
#define RET_ERROR 0
#define RET_FOUND 2
-
+#define MAIN_DIR "/home/cl"
#include "Params.h"
@@ -24,6 +24,7 @@ class MainClass {
int Run();
Params m_oParams;
+ void SavePasswordToFile(const char * v_szHash ,const char* v_szResultPassword,const char * v_szCypher);
};
}
@@ -95,7 +95,7 @@ Params::Parse(char *v_pData)
stringstream s(params,stringstream::out | stringstream::in );
string line;
char* szBuffer = NULL;
- char* pToken = NULL;
+
s >> m_sHashFunction;
Oops, something went wrong.

0 comments on commit 7b0107a

Please sign in to comment.