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