-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathPublic.h
54 lines (44 loc) · 1.13 KB
/
Public.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
RainbowCrack - a general propose implementation of Philippe Oechslin's faster time-memory trade-off technique.
Copyright (C) Zhu Shuanglei <[email protected]>
*/
#ifndef _PUBLIC_H
#define _PUBLIC_H
#include <stdio.h>
#include <cstdio>
#include <cctype>
#include <ctime>
#include <cstring>
#include <cstdlib>
#include <stdint.h>
#include <csignal>
#include <unistd.h>
#include <string>
#include <vector>
#include <list>
using namespace std;
#ifdef _WIN32
#define uint64 unsigned __int64
#else
#include <sys/types.h>
#define uint64 u_int64_t
#endif
struct RainbowChain
{
uint64 nIndexS;
uint64 nIndexE;
};
#define MAX_PLAIN_LEN 256
#define MIN_HASH_LEN 8
#define MAX_HASH_LEN 256
unsigned int GetFileLen(FILE* file);
string TrimString(string s);
bool ReadLinesFromFile(string sPathName, vector<string>& vLine);
bool SeperateString(string s, string sSeperator, vector<string>& vPart);
string uint64tostr(uint64 n);
string uint64tohexstr(uint64 n);
string HexToStr(const unsigned char* pData, int nLen);
unsigned long GetAvailPhysMemorySize();
void ParseHash(string sHash, unsigned char* pHash, int& nHashLen);
void Logo();
#endif