2 # Author: Gabriele Gristina <matrix@hashcat.net>
6 DEPS
="make gcc g++ gcc-multilib g++-multilib libc6-dev-i386 mingw-w64 build-essential unzip opencl-headers ocl-icd-libopencl1"
7 DEPS_AMD_DEV
="ocl-icd-opencl-dev"
8 DOWNLOAD_DEPS
="ADL_SDK8.zip R352-developer.zip gdk_linux_amd64_352_55_release.run"
10 ## enter the deps directory
11 cur_directory
=$
(dirname ${0})
12 script_directory
=$
(cd ${cur_directory} && pwd -P)
13 deps_dir
=${script_directory}/..
/deps
15 mkdir
-p ${deps_dir} # but it should already exist (is part of the repository)
18 ## cleanup the directories under the 'deps' folder
19 rm -rf {adl-sdk
*,nvidia-gdk
,R352-developer
} && \
20 mkdir
-p {tmp
,adl-sdk
,nvidia-gdk
,R352-developer
} && \
24 echo "! Cannot create deps directories."
30 for d
in ${DOWNLOAD_DEPS}; do
31 if [ ! -f "${d}" ]; then
32 echo "! ${d} not found."
37 if [ ${i} -gt 0 ]; then
38 echo "! Please manually download all the above dependencies to the deps/tmp/ directory"
42 ## installing needed packages
43 for pkg
in ${DEPS}; do
45 # check if the package is already installed
46 dpkg
-s ${pkg} &>/dev
/null
49 if [ $
(id
-u) -ne 0 ]; then
50 echo "! Must be root to install the required package '${pkg}' with apt-get"
54 apt-get
-y install ${pkg}
56 echo "! failed to install ${pkg}"
63 unzip ADL_SDK8.
zip -d ${deps_dir}/adl-sdk-8
66 if [[ ${ret} -ne 0 ]] && [[ ${ret} -ne 1 ]]; then
67 echo "! failed to extract ADL SDK"
71 rm -rf ${deps_dir}/adl-sdk && ln -s ${deps_dir}/adl-sdk-8 ${deps_dir}/adl-sdk
74 echo "! failed to setup ADL SDK link"
79 unzip R352-developer.
zip -d ${deps_dir}
82 if [[ ${ret} -ne 0 ]] && [[ ${ret} -ne 1 ]]; then
83 echo "! failed to extract NVAPI"
87 ## install NVIDIA GPU Deployment Kit
88 chmod +x gdk_linux_amd64_352_55_release.run
&& \
89 .
/gdk_linux_amd64_352_55_release.run
--silent --installdir=${deps_dir}/nvidia-gdk
92 echo "! failed to install NVIDIA GPU Deployment Kit"
96 ## check if libOpenCL.so is available (and if not install DEPS_AMD_DEV)
98 ls /usr
/lib
/*/libOpenCL.so
&> /dev
/null
100 if [ $?
-ne 0 ]; then
102 if [ $
(id
-u) -ne 0 ]; then
103 echo "! Must be root to install '${DEPS_AMD_DEV}'"
107 apt-get
-y install ${DEPS_AMD_DEV}
108 if [ $?
-ne 0 ]; then
109 echo "! failed to install ${DEPS_AMD_DEV}"
114 echo "> oclHashcat dependencies have been resolved."