X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=Client%20Applications%2Frcracki_mt%2FrcrackiThread.h;h=c5abeb4acf4fedcb65f7780406b3bb35881e1ad3;hb=ce75ca839a9cd1863ea13636ffebf7ee1dcc4267;hp=74b96dc339c58d428b89d4e82fee50d96301a83a;hpb=1f5948bf50f1eafad5ab3a4737f6eb3e492999e8;p=freerainbowtables diff --git a/Client Applications/rcracki_mt/rcrackiThread.h b/Client Applications/rcracki_mt/rcrackiThread.h index 74b96dc..c5abeb4 100644 --- a/Client Applications/rcracki_mt/rcrackiThread.h +++ b/Client Applications/rcracki_mt/rcrackiThread.h @@ -1,60 +1,85 @@ -#pragma once -#include "ChainWalkContext.h" -#include "Public.h" -#include "HashSet.h" -//#include -#include - -class rcrackiThread -{ -private: - unsigned char* t_TargetHash; - int t_nPos; - int t_nRainbowChainLen; - CChainWalkContext t_cwc; - vector t_vStartPosIndexE; - int t_ID; - int t_count; - uint64* t_pStartPosIndexE; - int t_nChainWalkStep; - bool falseAlarmChecker; - bool falseAlarmCheckerO; - vector t_pChainsFound; - vector t_pChainsFoundO; - vector t_nGuessedPoss; - unsigned char* t_pHash; - bool foundHash; - int t_nChainWalkStepDueToFalseAlarm; - int t_nFalseAlarm; - string t_Hash; - string t_Plain; - string t_Binary; - -public: - rcrackiThread(unsigned char* TargetHash, int thread_id, int nRainbowChainLen, int thread_count, uint64* pStartPosIndexE); - rcrackiThread(unsigned char* pHash); - rcrackiThread(unsigned char* pHash, bool oldFormat); - rcrackiThread(void); - ~rcrackiThread(void); - - //void SetWork(unsigned char* TargetHash, int nPos, int nRainbowChainLen); - //static unsigned __stdcall rcrackiThread::rcrackiThreadStaticEntryPoint(void * pThis); - static void * rcrackiThreadStaticEntryPointPthread(void * pThis); - int GetIndexCount(); - int GetChainWalkStep(); - uint64 GetIndex(int nPos); - bool FoundHash(); - void AddAlarmCheck(RainbowChain* pChain, int nGuessedPos); - void AddAlarmCheckO(RainbowChainO* pChain, int nGuessedPos); - int GetChainWalkStepDueToFalseAlarm(); - int GetnFalseAlarm(); - string GetHash(); - string GetPlain(); - string GetBinary(); - -private: - void rcrackiThreadEntryPoint(); - void PreCalculate(); - void CheckAlarm(); - void CheckAlarmO(); -}; +/* + * rcracki_mt is a multithreaded implementation and fork of the original + * RainbowCrack + * + * Copyright 2009, 2010 Daniël Niggebrugge + * Copyright 2009, 2010 James Nobis + * + * This file is part of racrcki_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 + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * rcracki_mt 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 rcracki_mt. If not, see . + */ + +#ifdef _WIN32 + #pragma once +#endif + +#include "ChainWalkContext.h" +#include "Public.h" +#include "HashSet.h" +//#include +#include + +class rcrackiThread +{ +private: + unsigned char* t_TargetHash; + int t_nPos; + int t_nRainbowChainLen; + CChainWalkContext t_cwc; + vector t_vStartPosIndexE; + int t_ID; + int t_count; + uint64* t_pStartPosIndexE; + int t_nChainWalkStep; + bool falseAlarmChecker; + bool falseAlarmCheckerO; + vector t_pChainsFound; + vector t_pChainsFoundO; + vector t_nGuessedPoss; + unsigned char* t_pHash; + bool foundHash; + int t_nChainWalkStepDueToFalseAlarm; + int t_nFalseAlarm; + string t_Hash; + string t_Plain; + string t_Binary; + +public: + rcrackiThread(unsigned char* TargetHash, int thread_id, int nRainbowChainLen, int thread_count, uint64* pStartPosIndexE); + rcrackiThread(unsigned char* pHash, bool oldFormat = false); + rcrackiThread(void); + ~rcrackiThread(void); + + //void SetWork(unsigned char* TargetHash, int nPos, int nRainbowChainLen); + //static unsigned __stdcall rcrackiThread::rcrackiThreadStaticEntryPoint(void * pThis); + static void * rcrackiThreadStaticEntryPointPthread(void * pThis); + int GetIndexCount(); + int GetChainWalkStep(); + uint64 GetIndex(int nPos); + bool FoundHash(); + void AddAlarmCheck(RainbowChain* pChain, int nGuessedPos); + void AddAlarmCheckO(RainbowChainO* pChain, int nGuessedPos); + int GetChainWalkStepDueToFalseAlarm(); + int GetnFalseAlarm(); + string GetHash(); + string GetPlain(); + string GetBinary(); + +private: + void rcrackiThreadEntryPoint(); + void PreCalculate(); + void CheckAlarm(); + void CheckAlarmO(); +};