3
* Ophcrack is a Lanmanager/NTLM hash cracker based on the faster time-memory
4
* trade-off using rainbow tables.
6
* Created with the help of: Maxime Mueller, Luca Wullschleger, Claude
7
* Hochreutiner, Andreas Huber and Etienne Dysli.
9
* Copyright (c) 2008 Philippe Oechslin, Cedric Tissieres, Bertrand Mesot
11
* Ophcrack is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; either version 2 of the License, or
14
* (at your option) any later version.
16
* Ophcrack is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
21
* You should have received a copy of the GNU General Public License
22
* along with Ophcrack; if not, write to the Free Software
23
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
* This program is released under the GPL with the additional exemption
26
* that compiling, linking, and/or using OpenSSL is allowed.
30
* $Date: 2008-05-05 14:11:52 +0200 (Mon, 05 May 2008) $
41
#if defined(HAVE_ENDIAN_H)
43
#elif defined(__FreeBSD__) || defined(OSX)
44
#include <machine/endian.h>
49
#define MY_MAX(a,b) ((a)>(b)?(a):(b))
50
#define MY_MIN(a,b) ((a)<(b)?(a):(b))
52
#define my_setbit(x,pos) x | (1 << pos);
53
#define my_getbit(x,pos) (x & (1 << pos)) ? 1 : 0
55
/** Maximum size of the buffers. */
57
#define STR_BUFF_SIZE 512
59
/** Maximum length of a password. */
61
#define MAX_PWD_LEN 50
63
/* Endianness conversion */
66
# if BYTE_ORDER == LITTLE_ENDIAN
67
# define ftohl(x) (x) /**< File (f) to host (h) long. */
68
# define ftohs(x) (x) /**< File (f) to host (h) short. */
69
# define htofl(x) (x) /**< Host (h) to file (f) long. */
70
# define htofs(x) (x) /**< Host (h) to file (f) short. */
71
# elif BYTE_ORDER == BIG_ENDIAN
72
# define ftohl(x) __bswap_32 (x) /**< File (f) to host (h) long. */
73
# define ftohs(x) __bswap_16 (x) /**< File (f) to host (h) short. */
74
# define htofl(x) __bswap_32 (x) /**< Host (h) to file (f) long. */
75
# define htofs(x) __bswap_16 (x) /**< Host (h) to file (f) short. */
77
# error "No byte order specified."
80
# error "BYTE_ORDER is not defined."
87
typedef unsigned char uchar_t;
88
typedef unsigned long ulong_t;
91
char *strsep(char** stringp, const char* delim);
94
uint64_t find_freeram(void);
95
void convert_to_colon(uchar_t *input);
96
void convert_from_colon(uchar_t *input);
97
void wincp1252_to_ascii(uchar_t *str);
98
void fprintf_hex(FILE *file, char *str, int len);