]> git.sesse.net Git - freerainbowtables/blob - Client Applications/rcracki/tmp/Public.h
initial
[freerainbowtables] / Client Applications / rcracki / 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
17 #ifdef _WIN32
18         #define uint64 unsigned __int64
19 #else
20         #define uint64 u_int64_t
21 #endif
22
23 struct RainbowChainO
24 {
25         uint64 nIndexS;
26         uint64 nIndexE;
27 };
28 struct RainbowChain
29 {
30         uint64 nIndexS;
31         int nIndexE;
32         int nCheckPoint;
33 };
34 struct RainbowChainCP
35 {
36         uint64 nIndexS;
37         uint64 nIndexE;
38         int nCheckPoint;
39 };
40
41 struct IndexChain
42 {
43         uint64 nPrefix;
44         int nFirstChain;
45         unsigned int nChainCount;
46 };
47 typedef struct
48 {
49         string sName;
50         int nPlainLenMin;
51         int nPlainLenMax;
52 } tCharset;
53
54 #define MAX_PLAIN_LEN 256
55 #define MIN_HASH_LEN  8
56 #define MAX_HASH_LEN  256
57 #define MAX_SALT_LEN  256
58
59 unsigned int GetFileLen(FILE* file);
60 string TrimString(string s);
61 bool ReadLinesFromFile(string sPathName, vector<string>& vLine);
62 bool SeperateString(string s, string sSeperator, vector<string>& vPart);
63 string uint64tostr(uint64 n);
64 string uint64tohexstr(uint64 n);
65 string HexToStr(const unsigned char* pData, int nLen);
66 unsigned int GetAvailPhysMemorySize();
67 void ParseHash(string sHash, unsigned char* pHash, int& nHashLen);
68 bool GetHybridCharsets(string sCharset, vector<tCharset>& vCharset);
69 void Logo();
70
71 #endif