From 2381af313db6f003d0e5316158509281782e6784 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Thu, 4 Feb 2016 15:47:52 +0100 Subject: [PATCH] Some cleanups --- .../{kernel_aes256_amd.c => kernel_aes256.c} | 0 ...l_serpent256_amd.c => kernel_serpent256.c} | 0 ...l_twofish256_amd.c => kernel_twofish256.c} | 0 OpenCL/m06211.cl | 6 +- OpenCL/m06212.cl | 6 +- OpenCL/m06213.cl | 6 +- OpenCL/m06221.cl | 6 +- OpenCL/m06222.cl | 6 +- OpenCL/m06223.cl | 6 +- OpenCL/m06231.cl | 6 +- OpenCL/m06232.cl | 6 +- OpenCL/m06233.cl | 6 +- include/ext_dummy.h | 15 ---- include/ext_smi.h | 20 ------ include/shared.h | 5 +- src/ext_dummy.c | 1 - src/ext_smi.c | 68 ------------------- tools/package_bin.sh | 6 +- 18 files changed, 33 insertions(+), 136 deletions(-) rename OpenCL/{kernel_aes256_amd.c => kernel_aes256.c} (100%) rename OpenCL/{kernel_serpent256_amd.c => kernel_serpent256.c} (100%) rename OpenCL/{kernel_twofish256_amd.c => kernel_twofish256.c} (100%) delete mode 100644 include/ext_dummy.h delete mode 100644 include/ext_smi.h delete mode 100644 src/ext_dummy.c delete mode 100644 src/ext_smi.c diff --git a/OpenCL/kernel_aes256_amd.c b/OpenCL/kernel_aes256.c similarity index 100% rename from OpenCL/kernel_aes256_amd.c rename to OpenCL/kernel_aes256.c diff --git a/OpenCL/kernel_serpent256_amd.c b/OpenCL/kernel_serpent256.c similarity index 100% rename from OpenCL/kernel_serpent256_amd.c rename to OpenCL/kernel_serpent256.c diff --git a/OpenCL/kernel_twofish256_amd.c b/OpenCL/kernel_twofish256.c similarity index 100% rename from OpenCL/kernel_twofish256_amd.c rename to OpenCL/kernel_twofish256.c diff --git a/OpenCL/m06211.cl b/OpenCL/m06211.cl index a1f9cd322..40dcf61ad 100644 --- a/OpenCL/m06211.cl +++ b/OpenCL/m06211.cl @@ -17,9 +17,9 @@ #include "OpenCL/types_ocl.c" #include "OpenCL/common.c" -#include "OpenCL/kernel_aes256_amd.c" -#include "OpenCL/kernel_twofish256_amd.c" -#include "OpenCL/kernel_serpent256_amd.c" +#include "OpenCL/kernel_aes256.c" +#include "OpenCL/kernel_twofish256.c" +#include "OpenCL/kernel_serpent256.c" static void ripemd160_transform (const u32 w[16], u32 dgst[5]) { diff --git a/OpenCL/m06212.cl b/OpenCL/m06212.cl index 83327f473..dfd958c9f 100644 --- a/OpenCL/m06212.cl +++ b/OpenCL/m06212.cl @@ -17,9 +17,9 @@ #include "OpenCL/types_ocl.c" #include "OpenCL/common.c" -#include "OpenCL/kernel_aes256_amd.c" -#include "OpenCL/kernel_twofish256_amd.c" -#include "OpenCL/kernel_serpent256_amd.c" +#include "OpenCL/kernel_aes256.c" +#include "OpenCL/kernel_twofish256.c" +#include "OpenCL/kernel_serpent256.c" static void ripemd160_transform (const u32 w[16], u32 dgst[5]) { diff --git a/OpenCL/m06213.cl b/OpenCL/m06213.cl index 4df4d9e8d..ce072bbab 100644 --- a/OpenCL/m06213.cl +++ b/OpenCL/m06213.cl @@ -17,9 +17,9 @@ #include "OpenCL/types_ocl.c" #include "OpenCL/common.c" -#include "OpenCL/kernel_aes256_amd.c" -#include "OpenCL/kernel_twofish256_amd.c" -#include "OpenCL/kernel_serpent256_amd.c" +#include "OpenCL/kernel_aes256.c" +#include "OpenCL/kernel_twofish256.c" +#include "OpenCL/kernel_serpent256.c" static void ripemd160_transform (const u32 w[16], u32 dgst[5]) { diff --git a/OpenCL/m06221.cl b/OpenCL/m06221.cl index 3cd7408c1..d2d5d04df 100644 --- a/OpenCL/m06221.cl +++ b/OpenCL/m06221.cl @@ -17,9 +17,9 @@ #include "OpenCL/types_ocl.c" #include "OpenCL/common.c" -#include "OpenCL/kernel_aes256_amd.c" -#include "OpenCL/kernel_twofish256_amd.c" -#include "OpenCL/kernel_serpent256_amd.c" +#include "OpenCL/kernel_aes256.c" +#include "OpenCL/kernel_twofish256.c" +#include "OpenCL/kernel_serpent256.c" __constant u64 k_sha512[80] = { diff --git a/OpenCL/m06222.cl b/OpenCL/m06222.cl index 7246459bb..5b29270c2 100644 --- a/OpenCL/m06222.cl +++ b/OpenCL/m06222.cl @@ -17,9 +17,9 @@ #include "OpenCL/types_ocl.c" #include "OpenCL/common.c" -#include "OpenCL/kernel_aes256_amd.c" -#include "OpenCL/kernel_twofish256_amd.c" -#include "OpenCL/kernel_serpent256_amd.c" +#include "OpenCL/kernel_aes256.c" +#include "OpenCL/kernel_twofish256.c" +#include "OpenCL/kernel_serpent256.c" __constant u64 k_sha512[80] = { diff --git a/OpenCL/m06223.cl b/OpenCL/m06223.cl index 4f4ccf6ff..5c8eda427 100644 --- a/OpenCL/m06223.cl +++ b/OpenCL/m06223.cl @@ -17,9 +17,9 @@ #include "OpenCL/types_ocl.c" #include "OpenCL/common.c" -#include "OpenCL/kernel_aes256_amd.c" -#include "OpenCL/kernel_twofish256_amd.c" -#include "OpenCL/kernel_serpent256_amd.c" +#include "OpenCL/kernel_aes256.c" +#include "OpenCL/kernel_twofish256.c" +#include "OpenCL/kernel_serpent256.c" __constant u64 k_sha512[80] = { diff --git a/OpenCL/m06231.cl b/OpenCL/m06231.cl index f9ecaa109..ec85d1965 100644 --- a/OpenCL/m06231.cl +++ b/OpenCL/m06231.cl @@ -19,9 +19,9 @@ #include "OpenCL/types_ocl.c" #include "OpenCL/common.c" -#include "OpenCL/kernel_aes256_amd.c" -#include "OpenCL/kernel_twofish256_amd.c" -#include "OpenCL/kernel_serpent256_amd.c" +#include "OpenCL/kernel_aes256.c" +#include "OpenCL/kernel_twofish256.c" +#include "OpenCL/kernel_serpent256.c" #define R 10 diff --git a/OpenCL/m06232.cl b/OpenCL/m06232.cl index 4315f7cc1..475c8dcbf 100644 --- a/OpenCL/m06232.cl +++ b/OpenCL/m06232.cl @@ -19,9 +19,9 @@ #include "OpenCL/types_ocl.c" #include "OpenCL/common.c" -#include "OpenCL/kernel_aes256_amd.c" -#include "OpenCL/kernel_twofish256_amd.c" -#include "OpenCL/kernel_serpent256_amd.c" +#include "OpenCL/kernel_aes256.c" +#include "OpenCL/kernel_twofish256.c" +#include "OpenCL/kernel_serpent256.c" #define R 10 diff --git a/OpenCL/m06233.cl b/OpenCL/m06233.cl index 16a7888ae..aa81f3175 100644 --- a/OpenCL/m06233.cl +++ b/OpenCL/m06233.cl @@ -19,9 +19,9 @@ #include "OpenCL/types_ocl.c" #include "OpenCL/common.c" -#include "OpenCL/kernel_aes256_amd.c" -#include "OpenCL/kernel_twofish256_amd.c" -#include "OpenCL/kernel_serpent256_amd.c" +#include "OpenCL/kernel_aes256.c" +#include "OpenCL/kernel_twofish256.c" +#include "OpenCL/kernel_serpent256.c" #define R 10 diff --git a/include/ext_dummy.h b/include/ext_dummy.h deleted file mode 100644 index c5139ae5a..000000000 --- a/include/ext_dummy.h +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Author......: Jens Steube - * License.....: MIT - */ - -#ifndef EXT_SMI_H -#define EXT_SMI_H - -#ifdef HAVE_HWMON - -#include - -#endif // HAVE_HWMON - -#endif diff --git a/include/ext_smi.h b/include/ext_smi.h deleted file mode 100644 index 3e88bde33..000000000 --- a/include/ext_smi.h +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Author......: Jens Steube - * License.....: MIT - */ - -#ifndef EXT_SMI_H -#define EXT_SMI_H - -#ifdef HAVE_HWMON - -#include - -#define SMI_OK 0 -#define SMI_NOBIN 1 - -int hc_nvidia_smi (int dev, int *temperature, int *gpu); - -#endif // HAVE_HWMON - -#endif diff --git a/include/shared.h b/include/shared.h index 08d0cd8a2..c10c7d223 100644 --- a/include/shared.h +++ b/include/shared.h @@ -100,10 +100,7 @@ * temperature management */ -#ifdef OSX -#include -#include -#elif _WIN +#if _WIN #include #include #else diff --git a/src/ext_dummy.c b/src/ext_dummy.c deleted file mode 100644 index 3b09b02da..000000000 --- a/src/ext_dummy.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/src/ext_smi.c b/src/ext_smi.c deleted file mode 100644 index ef032bf8f..000000000 --- a/src/ext_smi.c +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Author......: Jens Steube - * License.....: MIT - */ - -#include - -int hc_nvidia_smi (int dev, int *temperature, int *gpu) -{ - char cmd[256] = { 0 }; - - snprintf (cmd, sizeof (cmd) - 1, "nvidia-smi -q -g %d", dev); - - FILE *fp = popen (cmd, "r"); - - if (fp == NULL) - { - log_info ("WARN: %s\n", "nvidia-smi is missing!"); - - return SMI_NOBIN; - } - - int temp_found = 0; - int util_found = 0; - - char token[32]; - - while (fscanf (fp, " %31s ", token) == 1) - { - if (strcmp (token, "Temperature") == 0) - { - if (fscanf (fp, " : %4s C", token) == 1) *temperature = atoi (token); - - temp_found = 1; - } - - if (temp_found == 1) - { - if ((strcmp (token, "GPU") == 0) || (strcmp (token, "Gpu") == 0)) - { - if (fscanf (fp, " : %4s C", token) == 1) *temperature = atoi (token); - - temp_found = 0; - } - } - - if (strcmp (token, "Utilization") == 0) - { - util_found = 1; - - temp_found = 0; - } - - if (util_found == 1) - { - if ((strcmp (token, "GPU") == 0) || (strcmp (token, "Gpu") == 0)) - { - if (fscanf (fp, " : %2s%%", token) == 1) *gpu = atoi (token); - - util_found = 0; - } - } - } - - pclose (fp); - - return (SMI_OK); -} diff --git a/tools/package_bin.sh b/tools/package_bin.sh index e0f879437..3dad85537 100755 --- a/tools/package_bin.sh +++ b/tools/package_bin.sh @@ -12,6 +12,7 @@ rm -rf $OUT rm -rf $OUT.7z mkdir -p $OUT +mkdir -p $OUT/include cp $IN/oclHashcat??.exe $OUT/ cp $IN/oclHashcat??.bin $OUT/ @@ -26,7 +27,10 @@ cp $IN/example.dict $OUT/ cp $IN/example[0123456789]*.hash $OUT/ cp $IN/example[0123456789]*.cmd $OUT/ -cp -r $IN/include $OUT/ +cp -r $IN/include/constants.h $OUT/include +cp -r $IN/include/kernel_functions.c $OUT/include +cp -r $IN/include/kernel_vendor.h $OUT/include +cp -r $IN/include/rp_kernel.h $OUT/include cp -r $IN/OpenCL $OUT/ # since for the binary distribution we still use .bin, we need to rewrite the commands