* Copyright 2009, 2010 Daniƫl Niggebrugge <niggebrugge@fox-it.com>\r
* Copyright 2009, 2010 James Nobis <frt@quelrod.net>\r
*\r
- * This file is part of racrcki_mt.\r
+ * This file is part of rcracki_mt.\r
*\r
* rcracki_mt is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License as published by\r
#include <openssl/des.h>\r
//#include <openssl/md2.h>\r
#include <openssl/md4.h>\r
-//#include <openssl/md5.h>\r
#include <openssl/sha.h>\r
//#include <openssl/ripemd.h>\r
#include "fast_md5.h"\r
#include "md4.h"\r
//#include "sha1.h"\r
-#ifdef _WIN32\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
#pragma comment(lib, "libeay32.lib")\r
#endif\r
\r
des_ecb_encrypt((des_cblock*)spoofed_challange, (des_cblock*)&pHash[16], ks, DES_ENCRYPT);\r
}\r
\r
-\r
void HashORACLE(unsigned char* pPlain, int nPlainLen, unsigned char* pHash)\r
{\r
char ToEncrypt[256];\r
DES_key_schedule ks1,ks2;\r
unsigned char deskey_fixed[]={ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef};\r
int i,j;\r
-\r
- strcpy (username, "SYS");\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
+ strcpy_s(username, sizeof(username), "SYS");\r
+#else\r
+ strcpy(username, "SYS");\r
+#endif\r
int userlen = 3;\r
- \r
- strupr ((char*) pPlain);\r
+#if defined(_WIN32) && !defined(__GNUC__)\r
+ _strupr((char*) pPlain);\r
+#else\r
+ strupr((char*) pPlain);\r
+#endif\r
memset (ToEncrypt,0,sizeof(ToEncrypt));\r
\r
for (i=1,j=0; j<userlen; i++,j++)\r
UnicodePlain[i * 2 + 1] = 0x00;\r
}\r
\r
- /*MD4_CTX ctx;\r
- MD4_Init(&ctx);\r
- MD4_Update(&ctx, UnicodePlain, nPlainLen * 2);\r
- MD4_Final(pHash, &ctx);*/\r
-\r
- //MD4(UnicodePlain, nPlainLen * 2, pHash);\r
MD4_NEW(UnicodePlain, nPlainLen * 2, pHash);\r
}\r
\r
\r
void HashMD4(unsigned char* pPlain, int nPlainLen, unsigned char* pHash)\r
{\r
- /*MD4_CTX ctx;\r
- MD4_Init(&ctx);\r
- MD4_Update(&ctx, pPlain, nPlainLen);\r
- MD4_Final(pHash, &ctx);*/\r
-\r
MD4_NEW(pPlain, nPlainLen, pHash);\r
- //MD4(pPlain, nPlainLen, pHash);\r
}\r
\r
void HashMD5(unsigned char* pPlain, int nPlainLen, unsigned char* pHash)\r