2 * rcracki_mt is a multithreaded implementation and fork of the original
5 * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
6 * Copyright 2009, 2010 Daniƫl Niggebrugge <niggebrugge@fox-it.com>
7 * Copyright 2009, 2010 James Nobis <frt@quelrod.net>
9 * This file is part of rcracki_mt.
11 * rcracki_mt is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation, version 2 of the License.
15 * rcracki_mt is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.
58 unsigned short foo[3];
59 unsigned short nIndexE;
65 // uint64 nIndexS : 48;
66 // unsigned short nIndexE : 16;
73 // //unsigned short nChainCount; //(maybe union with nPrefix, 1 byte spoiled)
83 unsigned short nChainCount; //2
85 //unsigned short nChainCount; (maybe union with nPrefix, 1 byte spoiled, no pack(1) needed)
95 #define MAX_PLAIN_LEN 256
96 #define MIN_HASH_LEN 8
97 #define MAX_HASH_LEN 256
98 #define MAX_SALT_LEN 256
100 // XXX nmap is GPL2, will check newer releases regarding license
101 // Code comes from nmap, used for the linux implementation of kbhit()
110 void tty_flush(void);
114 #if defined(_WIN32) && !defined(__GNUC__)
115 int gettimeofday( struct timeval *tv, struct timezone *tz );
118 #if !defined(_WIN32) || defined(__GNUC__)
119 #include <sys/time.h>
122 timeval sub_timeofday( timeval tv2, timeval tv );
124 unsigned int GetFileLen(FILE* file);
125 string TrimString(string s);
126 bool ReadLinesFromFile(string sPathName, vector<string>& vLine);
127 bool SeperateString(string s, string sSeperator, vector<string>& vPart);
128 string uint64tostr(uint64 n);
129 string uint64tohexstr(uint64 n);
130 string HexToStr(const unsigned char* pData, int nLen);
131 uint64 GetAvailPhysMemorySize();
132 string GetApplicationPath();
133 void ParseHash(string sHash, unsigned char* pHash, int& nHashLen);
134 bool GetHybridCharsets(string sCharset, vector<tCharset>& vCharset);
136 bool writeResultLineToFile(string sOutputFile, string sHash, string sPlain, string sBinary);