]> git.sesse.net Git - freerainbowtables/blob - BOINC software/BOINC client apps/distrrtgen/tmp/Public.h
cleanup
[freerainbowtables] / BOINC software / BOINC client apps / distrrtgen / tmp / Public.h
1 /*
2    RainbowCrack - a general propose implementation of Philippe Oechslin's faster time-memory trade-off technique.
3
4    Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
5 */
6
7 #ifndef _PUBLIC_H
8 #define _PUBLIC_H
9
10 #include <stdio.h>
11
12 #include <string>
13 #include <vector>
14 #include <list>
15 using namespace std;
16 #define INPUT_FILENAME "charset.txt"
17 #define OUTPUT_FILENAME "result"
18
19 #ifdef _WIN32
20         #define uint64 unsigned __int64
21 #else
22         //#define uint64 u_int64_t
23         #define uint64 unsigned long long
24 #endif
25
26 struct RainbowChain
27 {
28         uint64 nIndexS;
29         uint64 nIndexE;
30 };
31
32
33 struct RainbowChainCP
34 {
35         uint64 nIndexS;
36         uint64 nIndexE;
37         unsigned short checkpoint;
38 };
39
40 typedef struct
41 {
42         string sName;
43         int nPlainLenMin;
44         int nPlainLenMax;
45 } tCharset;
46
47 #define MAX_PLAIN_LEN 256
48 #define MIN_HASH_LEN  8
49 #define MAX_HASH_LEN  256
50 #define MAX_SALT_LEN  256
51
52 unsigned int GetFileLen(FILE* file);
53 string TrimString(string s);
54 bool ReadLinesFromFile(string sPathName, vector<string>& vLine);
55 bool SeperateString(string s, string sSeperator, vector<string>& vPart);
56 string uint64tostr(uint64 n);
57 string uint64tohexstr(uint64 n);
58 string HexToStr(const unsigned char* pData, int nLen);
59 unsigned int GetAvailPhysMemorySize();
60 void ParseHash(string sHash, unsigned char* pHash, int& nHashLen);
61 bool GetHybridCharsets(string sCharset, vector<tCharset>& vCharset);
62 void Logo();
63
64 #endif