2015-12-04 14:47:52 +00:00
|
|
|
/**
|
2016-09-11 20:20:15 +00:00
|
|
|
* Author......: See docs/credits.txt
|
2015-12-04 14:47:52 +00:00
|
|
|
* License.....: MIT
|
|
|
|
*/
|
|
|
|
|
2016-09-06 16:44:05 +00:00
|
|
|
#ifndef _COMMON_H
|
|
|
|
#define _COMMON_H
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2016-09-21 14:07:49 +00:00
|
|
|
#define PROGNAME "hashcat"
|
|
|
|
|
2016-09-07 20:29:57 +00:00
|
|
|
#if defined (__linux__)
|
|
|
|
#define _POSIX
|
|
|
|
#elif defined (__APPLE__)
|
|
|
|
#define _POSIX
|
|
|
|
#elif defined (__FreeBSD__)
|
|
|
|
#define _POSIX
|
|
|
|
#elif defined (_WIN32) || defined (_WIN64)
|
2016-10-01 11:37:09 +00:00
|
|
|
#define _WIN 1
|
|
|
|
#define WIN 1
|
2016-09-07 20:29:57 +00:00
|
|
|
#else
|
|
|
|
#error Your Operating System is not supported or detected
|
|
|
|
#endif
|
|
|
|
|
2015-12-04 14:47:52 +00:00
|
|
|
#define _GNU_SOURCE
|
|
|
|
#define _FILE_OFFSET_BITS 64
|
|
|
|
|
2016-09-30 20:52:44 +00:00
|
|
|
// don't try to simply change this, it will not work
|
2016-09-24 23:02:44 +00:00
|
|
|
#define PW_MIN 0
|
|
|
|
#define PW_MAX 54
|
|
|
|
#define PW_MAX1 (PW_MAX + 1)
|
|
|
|
|
2016-09-28 09:55:02 +00:00
|
|
|
#define PW_DICTMAX 31
|
|
|
|
#define PW_DICTMAX1 (PW_DICTMAX + 1)
|
|
|
|
|
2016-09-08 10:17:56 +00:00
|
|
|
#define EXEC_CACHE 128
|
2016-02-11 08:54:50 +00:00
|
|
|
|
2016-09-08 10:17:56 +00:00
|
|
|
#define SPEED_CACHE 128
|
|
|
|
#define SPEED_MAXAGE 4096
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2016-09-08 10:17:56 +00:00
|
|
|
// general buffer size in case the size is unknown at compile-time
|
|
|
|
#define HCBUFSIZ_TINY 0x100
|
|
|
|
#define HCBUFSIZ_LARGE 0x50000
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2016-09-08 10:17:56 +00:00
|
|
|
#define BLOCK_SIZE 64
|
2016-09-06 13:28:56 +00:00
|
|
|
|
2016-06-14 08:18:42 +00:00
|
|
|
#define EXPECTED_ITERATIONS 10000
|
|
|
|
|
2016-01-15 16:16:43 +00:00
|
|
|
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
|
|
|
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
|
2015-12-15 17:41:11 +00:00
|
|
|
|
2016-09-05 19:47:26 +00:00
|
|
|
#define DEVICES_MAX 128
|
|
|
|
|
2016-09-10 09:32:26 +00:00
|
|
|
#define MAX_CUT_TRIES 4
|
|
|
|
|
2016-05-01 16:34:59 +00:00
|
|
|
#define CEIL(a) ((a - (int) (a)) > 0 ? a + 1 : a)
|
|
|
|
|
2016-10-01 11:40:09 +00:00
|
|
|
#define NOMINMAX 1
|
|
|
|
|
2016-09-07 20:29:57 +00:00
|
|
|
#if defined (__APPLE__)
|
2016-09-05 19:47:26 +00:00
|
|
|
#define __stdcall
|
|
|
|
#endif
|
|
|
|
|
2016-10-01 11:40:09 +00:00
|
|
|
#if defined (__MSC_VER)
|
|
|
|
#define HC_API_CALL __cdecl
|
|
|
|
#elif defined (_WIN32) || defined (__WIN32__) || defined (__CYGWIN__)
|
2016-09-08 07:21:25 +00:00
|
|
|
#define HC_API_CALL __stdcall
|
|
|
|
#else
|
|
|
|
#define HC_API_CALL
|
|
|
|
#endif
|
|
|
|
|
2016-09-07 20:29:57 +00:00
|
|
|
#if defined (_WIN)
|
2016-09-05 19:47:26 +00:00
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
|
#endif
|
2016-09-06 16:44:05 +00:00
|
|
|
|
2016-10-01 11:42:40 +00:00
|
|
|
/* The C++ standard denies redefinition of keywords,
|
|
|
|
but this is nededed for VS compiler which doesn't have inline keyword but has __inline
|
|
|
|
*/
|
|
|
|
#ifndef __cplusplus
|
|
|
|
#if defined (_MSC_VER)
|
|
|
|
#define inline __inline
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2016-09-08 12:22:10 +00:00
|
|
|
#if defined (_WIN)
|
|
|
|
#define EOL "\r\n"
|
|
|
|
#else
|
|
|
|
#define EOL "\n"
|
|
|
|
#endif
|
|
|
|
|
2016-10-10 07:12:36 +00:00
|
|
|
#define MAYBE_UNUSED __attribute__((unused))
|
|
|
|
|
2016-09-06 16:44:05 +00:00
|
|
|
#endif // _COMMON_H
|