]> git.sesse.net Git - freerainbowtables/blob - Client Applications/converti2/Public.h
a2f5657fcb5d485e3a7f0994fb2726560dc31554
[freerainbowtables] / Client Applications / converti2 / 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 RainbowChain
24 {
25         uint64 nIndexS;
26         uint64 nIndexE;
27 };
28
29 struct RainbowChainCP
30 {
31         uint64 nIndexS;
32         uint64 nIndexE;
33         unsigned short nCheckPoint;
34 };
35 struct IndexChain
36 {
37         uint64 nPrefix;
38         int nFirstChain;
39         unsigned int nChainCount;
40 };
41 struct FoundRainbowChain
42 {
43         uint64 nIndexS;
44         int nIndexE;
45         int nCheckPoint;
46         int nGuessedPos;
47 };
48 struct ChainCheckChain
49 {
50         uint64 nIndexS;
51         int nGuessedPos;
52 };
53 struct IndexRow
54 {
55         uint64 prefix;
56         unsigned int prefixstart, numchains;
57 };
58
59 typedef struct
60 {
61         string sName;
62         int nPlainLenMin;
63         int nPlainLenMax;
64 } tCharset;
65
66 #define MAX_PLAIN_LEN 256
67 #define MIN_HASH_LEN  8
68 #define MAX_HASH_LEN  256
69 #define MAX_SALT_LEN  256
70
71 unsigned int GetFileLen(FILE* file);
72 string TrimString(string s);
73 bool ReadLinesFromFile(string sPathName, vector<string>& vLine);
74 bool SeperateString(string s, string sSeperator, vector<string>& vPart);
75 string uint64tostr(uint64 n);
76 string uint64tohexstr(uint64 n);
77 string HexToStr(const unsigned char* pData, int nLen);
78 unsigned int GetAvailPhysMemorySize();
79 void ParseHash(string sHash, unsigned char* pHash, int& nHashLen);
80 bool GetHybridCharsets(string sCharset, vector<tCharset>& vCharset);
81 void Logo();
82
83 #endif