X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=Client%20Applications%2Frcracki_mt%2FPublic.h;h=13fb0d380eb44d2f7bf2af3b5815e113c6912ad0;hb=ce75ca839a9cd1863ea13636ffebf7ee1dcc4267;hp=5e5e8d5f9ce09ede6022e9eddf99cbf22fa4c8c3;hpb=4d512f6f97940c2f10ab435ef017e39cdc69837a;p=freerainbowtables diff --git a/Client Applications/rcracki_mt/Public.h b/Client Applications/rcracki_mt/Public.h index 5e5e8d5..13fb0d3 100644 --- a/Client Applications/rcracki_mt/Public.h +++ b/Client Applications/rcracki_mt/Public.h @@ -1,118 +1,135 @@ -/* - RainbowCrack - a general propose implementation of Philippe Oechslin's faster time-memory trade-off technique. - - Copyright (C) Zhu Shuanglei -*/ - -#ifndef _PUBLIC_H -#define _PUBLIC_H - -#include -#include -#include - -#include -#include -#include -using namespace std; - -#ifdef _WIN32 - #define uint64 unsigned __int64 -#else - #ifndef u_int64_t - #define uint64 unsigned long long - #else - #define uint64 u_int64_t - #endif -#endif - -struct RainbowChainO -{ - uint64 nIndexS; - uint64 nIndexE; -}; -//struct RainbowChain -//{ -// //uint64 nChain; -// uint64 nIndexS; -// int nIndexE; -// int nCheckPoint; -//}; - -union RainbowChain -{ - //uint64 nChain; - uint64 nIndexS; - struct - { - unsigned short foo[3]; - unsigned short nIndexE; - }; - //int nCheckPoint; -}; -//struct RainbowChain -//{ -// uint64 nIndexS : 48; -// unsigned short nIndexE : 16; -//}; -//struct IndexChain -//{ -// uint64 nPrefix; -// int nFirstChain; -// int nChainCount; -// //unsigned short nChainCount; //(maybe union with nPrefix, 1 byte spoiled) -//}; -#pragma pack(1) -union IndexChain -{ - uint64 nPrefix; //5 - struct - { - unsigned char foo[5]; - int nFirstChain; //4 - unsigned short nChainCount; //2 - }; - //unsigned short nChainCount; (maybe union with nPrefix, 1 byte spoiled, no pack(1) needed) -}; -#pragma pack() -typedef struct -{ - string sName; - int nPlainLenMin; - int nPlainLenMax; -} tCharset; - -#define MAX_PLAIN_LEN 256 -#define MIN_HASH_LEN 8 -#define MAX_HASH_LEN 256 -#define MAX_SALT_LEN 256 - -// Code comes from nmap, used for the linux implementation of kbhit() -#ifndef _WIN32 -#include -#include -#include - -int tty_getchar(); -void tty_done(); -void tty_init(); -void tty_flush(void); - -#endif - - -unsigned int GetFileLen(FILE* file); -string TrimString(string s); -bool ReadLinesFromFile(string sPathName, vector& vLine); -bool SeperateString(string s, string sSeperator, vector& vPart); -string uint64tostr(uint64 n); -string uint64tohexstr(uint64 n); -string HexToStr(const unsigned char* pData, int nLen); -unsigned int GetAvailPhysMemorySize(); -string GetApplicationPath(); -void ParseHash(string sHash, unsigned char* pHash, int& nHashLen); -bool GetHybridCharsets(string sCharset, vector& vCharset); -void Logo(); -bool writeResultLineToFile(string sOutputFile, string sHash, string sPlain, string sBinary); - -#endif +/* + * rcracki_mt is a multithreaded implementation and fork of the original + * RainbowCrack + * + * Copyright (C) Zhu Shuanglei + * 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, version 2 of the License. + * + * 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 . + */ + +#ifndef _PUBLIC_H +#define _PUBLIC_H + +#include +#include +#include + +#include +#include +#include + +#include "global.h" + +using namespace std; + + +struct RainbowChainO +{ + uint64 nIndexS; + uint64 nIndexE; +}; +//struct RainbowChain +//{ +// //uint64 nChain; +// uint64 nIndexS; +// int nIndexE; +// int nCheckPoint; +//}; +union RainbowChain +{ + //uint64 nChain; + uint64 nIndexS; + struct + { + unsigned short foo[3]; + unsigned short nIndexE; + }; + //int nCheckPoint; +}; +//struct RainbowChain +//{ +// uint64 nIndexS : 48; +// unsigned short nIndexE : 16; +//}; +//struct IndexChain +//{ +// uint64 nPrefix; +// int nFirstChain; +// int nChainCount; +// //unsigned short nChainCount; //(maybe union with nPrefix, 1 byte spoiled) +//}; +#pragma pack(1) +union IndexChain +{ + uint64 nPrefix; //5 + struct + { + unsigned char foo[5]; + int nFirstChain; //4 + unsigned short nChainCount; //2 + }; + //unsigned short nChainCount; (maybe union with nPrefix, 1 byte spoiled, no pack(1) needed) +}; +#pragma pack() +typedef struct +{ + string sName; + int nPlainLenMin; + int nPlainLenMax; +} tCharset; + +#define MAX_PLAIN_LEN 256 +#define MIN_HASH_LEN 8 +#define MAX_HASH_LEN 256 +#define MAX_SALT_LEN 256 + +// XXX nmap is GPL2, will check newer releases regarding license +// Code comes from nmap, used for the linux implementation of kbhit() +#ifndef _WIN32 +#include +#include +#include + +int tty_getchar(); +void tty_done(); +void tty_init(); +void tty_flush(void); +// end nmap code + +#include + +#else + int gettimeofday( struct timeval *tv, struct timezone *tz ); +#endif + +timeval sub_timeofday( timeval tv2, timeval tv ); + +unsigned int GetFileLen(FILE* file); +string TrimString(string s); +bool ReadLinesFromFile(string sPathName, vector& vLine); +bool SeperateString(string s, string sSeperator, vector& vPart); +string uint64tostr(uint64 n); +string uint64tohexstr(uint64 n); +string HexToStr(const unsigned char* pData, int nLen); +uint64 GetAvailPhysMemorySize(); +string GetApplicationPath(); +void ParseHash(string sHash, unsigned char* pHash, int& nHashLen); +bool GetHybridCharsets(string sCharset, vector& vCharset); +void Logo(); +bool writeResultLineToFile(string sOutputFile, string sHash, string sPlain, string sBinary); + +#endif