X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=Client%20Applications%2Frcracki_mt%2FPublic.h;h=89bbc805ed981ff2bd10f27bf07e17f54f810c72;hb=57b0f6696d60ccfbc6e2da76c3fa71e6d1da9db5;hp=27d4dcda5a99703a651412695d4cb4d9c4847371;hpb=59bc65eea1e9a2cab6b1d51f4567cffc033fe938;p=freerainbowtables diff --git a/Client Applications/rcracki_mt/Public.h b/Client Applications/rcracki_mt/Public.h index 27d4dcd..89bbc80 100644 --- a/Client Applications/rcracki_mt/Public.h +++ b/Client Applications/rcracki_mt/Public.h @@ -1,138 +1,138 @@ -/* - * 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 rcracki_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 -#endif - -#if defined(_WIN32) && !defined(__GNUC__) - int gettimeofday( struct timeval *tv, struct timezone *tz ); -#endif - -#if !defined(_WIN32) || defined(__GNUC__) - #include -#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 +/* + * 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 rcracki_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 +#endif + +#if defined(_WIN32) && !defined(__GNUC__) + int gettimeofday( struct timeval *tv, struct timezone *tz ); +#endif + +#if !defined(_WIN32) || defined(__GNUC__) + #include +#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