2 # Author: Gabriele Gristina <matrix@hashcat.net>
6 DEPS
="make gcc-4.9 g++-4.9 gcc-4.9-multilib g++-4.9-multilib libc6-dev-i386 mingw-w64 build-essential unzip"
7 DOWNLOAD_DEPS
="ADL_SDK8.zip R352-developer.zip cuda_7.5.18_linux.run NVIDIA-Linux-x86_64-352.21.run gdk_linux_amd64_352_55_release.run AMD-APP-SDKInstaller-v3.0.130.135-GA-linux64.tar.bz2"
9 ## enter the hashcat-deps directory
10 cur_directory
=$
(dirname ${0})
11 script_directory
=$
(cd ${cur_directory} && pwd -P)
12 hashcat_deps_dir
=${script_directory}/..
/hashcat-deps
14 mkdir
-p ${hashcat_deps_dir} # but it should already exist (is part of the repository)
15 cd ${hashcat_deps_dir}
17 ## cleanup the directories under the 'hashcat-deps' folder
18 rm -rf {adl-sdk
,cuda-7.5
,NVIDIA-Linux-x86_64-352.21
,nvidia-gdk
,amd-app-sdk
} && \
19 mkdir
-p {tmp
,adl-sdk
,cuda-7.5
,NVIDIA-Linux-x86_64-352.21
,nvidia-gdk
,amd-app-sdk
} && \
23 echo "! Cannot create hashcat-deps directories."
29 for d
in ${DOWNLOAD_DEPS}; do
30 if [ ! -f "${d}" ]; then
31 echo "! ${d} not found."
36 if [ ${i} -gt 0 ]; then
37 echo "! Please manually download all the above dependencies to the hashcat-deps/tmp/ directory"
41 ## installing needed packages
42 for pkg
in ${DEPS}; do
44 # check if the package is already installed
45 dpkg
-s ${pkg} &>/dev
/null
48 if [ $
(id
-u) -ne 0 ]; then
49 echo "! Must be root to install the required package '${pkg}' with apt-get"
53 apt-get
-y install ${pkg}
55 echo "! failed to install ${pkg}"
62 unzip ADL_SDK8.
zip -d ${hashcat_deps_dir}/adl-sdk-8
65 if [[ ${ret} -ne 0 ]] && [[ ${ret} -ne 1 ]]; then
66 echo "! failed to extract ADL SDK"
70 rm -rf ${hashcat_deps_dir}/adl-sdk && ln -s ${hashcat_deps_dir}/adl-sdk-8 ${hashcat_deps_dir}/adl-sdk
73 echo "! failed to setup ADL SDK link"
78 unzip R352-developer.
zip -d ${hashcat_deps_dir}
81 if [[ ${ret} -ne 0 ]] && [[ ${ret} -ne 1 ]]; then
82 echo "! failed to extract NVAPI"
87 chmod +x cuda_7.5
.18_linux.run
&& \
88 .
/cuda_7.5
.18_linux.run
-toolkit -silent -override --toolkitpath=${hashcat_deps_dir}/cuda-7.5
91 echo "! failed to install CUDA SDK"
95 ## install NVIDIA Driver
96 chmod +x NVIDIA-Linux-x86_64-352.21.run
&& \
97 .
/NVIDIA-Linux-x86_64-352.21.run
-x && \
98 mv NVIDIA-Linux-x86_64-352.21
${hashcat_deps_dir}/ && \
99 cd ${hashcat_deps_dir}/NVIDIA-Linux-x86_64-352.21
&& \
100 ln -s libnvidia-ml.so
.352.21 libnvidia-ml.so
&& \
101 ln -s libcuda.so
.352.21 libcuda.so
&& \
103 ln -s libnvidia-ml.so
.352.21 libnvidia-ml.so
&& \
104 ln -s libcuda.so
.352.21 libcuda.so
&& \
105 cd ${hashcat_deps_dir}/tmp
107 if [ $?
-ne 0 ]; then
108 echo "! failed to install NVIDIA Driver"
112 ## install NVIDIA GPU Deployment Kit
113 chmod +x gdk_linux_amd64_352_55_release.run
&& \
114 .
/gdk_linux_amd64_352_55_release.run
--silent --installdir=${hashcat_deps_dir}/nvidia-gdk
116 if [ $?
-ne 0 ]; then
117 echo "! failed to install NVIDIA GPU Deployment Kit"
121 ## extract AMD APP SDK
122 tar xjf AMD-APP-SDKInstaller-v3.0
.130.135-GA-linux64.
tar.bz2
&& \
123 .
/AMD-APP-SDK-v3.0
.130.135-GA-linux64.sh
--noexec --target ${hashcat_deps_dir}/amd-app-sdk-v3.0
.130.135
125 if [ $?
-ne 0 ]; then
126 echo "! failed to extract AMD APP SDK"
130 rm -rf ${hashcat_deps_dir}/amd-app-sdk && ln -s ${hashcat_deps_dir}/amd-app-sdk-v3.0.130.135 ${hashcat_deps_dir}/amd-app-sdk
132 if [ $?
-ne 0 ]; then
133 echo "! failed to setup ADL SDK link"
137 echo "> oclHashcat dependencies have been resolved."