~ubuntu-branches/ubuntu/maverick/ophcrack/maverick

« back to all changes in this revision

Viewing changes to src/misc.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Cécile (Le_Vert)
  • Date: 2008-08-11 15:58:58 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080811155858-calnhe07mxkkqb1s
Tags: 3.0.1-1
* Upload to experimental because of lenny freeze.
* New upstream release.
* Update debian/watch.
* Switch from libgtk2.0-dev to libqt4-dev b-dep.
* Drop dpatch, not needed anymore.
* Add new package ophcrack-cli that provides command-line binary.
* Rewrite whole debian/rules to build qt4 and cli flavours.
* Update README.Debian with new tables names/urls.
* Do not depend anymore on bkhive/samdump2, both are embedded.
* Update debian/copyright.
* Add imagemagick b-dep to create icons.
* Write a new manpage for the new command line switches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *   
 
3
 *   Ophcrack is a Lanmanager/NTLM hash cracker based on the faster time-memory
 
4
 *   trade-off using rainbow tables. 
 
5
 *   
 
6
 *   Created with the help of: Maxime Mueller, Luca Wullschleger, Claude
 
7
 *   Hochreutiner, Andreas Huber and Etienne Dysli.
 
8
 *   
 
9
 *   Copyright (c) 2008 Philippe Oechslin, Cedric Tissieres, Bertrand Mesot
 
10
 *   
 
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.
 
15
 *   
 
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.
 
20
 *   
 
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
 
24
 *   
 
25
 *   This program is released under the GPL with the additional exemption 
 
26
 *   that compiling, linking, and/or using OpenSSL is allowed.
 
27
 *   
 
28
 *   
 
29
 *   $Rev: 124 $
 
30
 *   $Date: 2008-05-05 14:11:52 +0200 (Mon, 05 May 2008) $
 
31
 *   
 
32
 *   
 
33
*/
 
34
#ifndef DEFS_H
 
35
#define DEFS_H
 
36
 
 
37
#include <stdio.h>
 
38
#include <stdint.h>
 
39
#include <config.h>
 
40
 
 
41
#if defined(HAVE_ENDIAN_H)
 
42
#include <endian.h>
 
43
#elif defined(__FreeBSD__) || defined(OSX)
 
44
#include <machine/endian.h>
 
45
#endif
 
46
 
 
47
#include "bswap.h"
 
48
 
 
49
#define MY_MAX(a,b) ((a)>(b)?(a):(b))
 
50
#define MY_MIN(a,b) ((a)<(b)?(a):(b))
 
51
 
 
52
#define my_setbit(x,pos) x | (1 << pos);
 
53
#define my_getbit(x,pos) (x & (1 << pos)) ? 1 : 0
 
54
 
 
55
/** Maximum size of the buffers. */
 
56
 
 
57
#define STR_BUFF_SIZE 512
 
58
 
 
59
/** Maximum length of a password. */
 
60
 
 
61
#define MAX_PWD_LEN 50
 
62
 
 
63
/* Endianness conversion */
 
64
 
 
65
#ifdef BYTE_ORDER
 
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. */
 
76
#   else
 
77
#      error "No byte order specified."
 
78
#   endif
 
79
#else
 
80
#   error "BYTE_ORDER is not defined."
 
81
#endif
 
82
 
 
83
#ifdef  __cplusplus
 
84
extern "C" {
 
85
#endif
 
86
 
 
87
typedef unsigned char uchar_t;
 
88
typedef unsigned long ulong_t;
 
89
 
 
90
#ifdef WIN32
 
91
char *strsep(char** stringp, const char* delim);
 
92
#endif
 
93
 
 
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);
 
99
 
 
100
#ifdef __cplusplus
 
101
}
 
102
#endif
 
103
#endif