Prepare to rename project into hashcat

This release markes the fusion of "hashcat" and "oclHashcat" into "hashcat".
It combines all features of all hashcat projects in one project.
This commit is contained in:
jsteube
2016-05-10 19:07:07 +02:00
parent 768ffbdad8
commit e47030ed7d
41 changed files with 273866 additions and 273844 deletions
@@ -4,19 +4,19 @@
## License.....: MIT
##
OCLHASHCAT_ROOT="."
HASHCAT_ROOT="."
# helper functions
_oclHashcat_get_permutations ()
_hashcat_get_permutations ()
{
local num_devices=${1}
oclHashcat_devices_permutation=""
hashcat_devices_permutation=""
# Formula: Sum (k=1...num_devices) (num_devices! / (k! * (num_devices - k)!))
# or ofc (2 ^ num_devices) - 1
if [ "${num_devices}" -gt 0 ]; then
oclHashcat_devices_permutation=$(seq 1 $num_devices)
hashcat_devices_permutation=$(seq 1 $num_devices)
local k
@@ -24,7 +24,7 @@ _oclHashcat_get_permutations ()
if [ "${k}" -eq ${num_devices} ];then
oclHashcat_devices_permutation="${oclHashcat_devices_permutation} $(seq 1 $num_devices | tr '\n' ',' | sed 's/, *$//')"
hashcat_devices_permutation="${hashcat_devices_permutation} $(seq 1 $num_devices | tr '\n' ',' | sed 's/, *$//')"
else
@@ -65,7 +65,7 @@ _oclHashcat_get_permutations ()
if [ "${pos_changed}" -eq 0 ]; then
oclHashcat_devices_permutation="${oclHashcat_devices_permutation} ${out_str}"
hashcat_devices_permutation="${hashcat_devices_permutation} ${out_str}"
else
@@ -127,7 +127,7 @@ _oclHashcat_get_permutations ()
fi
}
_oclHashcat_opencl_devices ()
_hashcat_opencl_devices ()
{
local num_devices=0
@@ -144,7 +144,7 @@ _oclHashcat_opencl_devices ()
return ${num_devices}
}
_oclHashcat_cpu_devices ()
_hashcat_cpu_devices ()
{
local num_devices=0
@@ -157,7 +157,7 @@ _oclHashcat_cpu_devices ()
return ${num_devices}
}
_oclHashcat_contains ()
_hashcat_contains ()
{
local haystack=${1}
local needle="${2}"
@@ -173,7 +173,7 @@ _oclHashcat_contains ()
return 1
}
_oclHashcat ()
_hashcat ()
{
local VERSION=2.10
@@ -246,12 +246,12 @@ _oclHashcat ()
;;
-d|--opencl-devices)
_oclHashcat_opencl_devices
_hashcat_opencl_devices
local num_devices=${?}
_oclHashcat_get_permutations ${num_devices}
_hashcat_get_permutations ${num_devices}
COMPREPLY=($(compgen -W "${oclHashcat_devices_permutation}" -- ${cur}))
COMPREPLY=($(compgen -W "${hashcat_devices_permutation}" -- ${cur}))
return 0
;;
@@ -294,12 +294,12 @@ _oclHashcat ()
;;
--cpu-affinity)
_oclHashcat_cpu_devices
_hashcat_cpu_devices
local num_devices=${?}
_oclHashcat_get_permutations ${num_devices}
_hashcat_get_permutations ${num_devices}
COMPREPLY=($(compgen -W "${oclHashcat_devices_permutation}" -- ${cur}))
COMPREPLY=($(compgen -W "${hashcat_devices_permutation}" -- ${cur}))
return 0
;;
@@ -422,12 +422,12 @@ _oclHashcat ()
;;
-d*)
_oclHashcat_opencl_devices
_hashcat_opencl_devices
local num_devices=${?}
_oclHashcat_get_permutations ${num_devices}
_hashcat_get_permutations ${num_devices}
local opencl_devices_var="$(echo " "${oclHashcat_devices_permutation} | sed 's/ / -d/g')"
local opencl_devices_var="$(echo " "${hashcat_devices_permutation} | sed 's/ / -d/g')"
COMPREPLY=($(compgen -W "${opencl_devices_var}" -- ${cur}))
return 0
;;
@@ -450,7 +450,7 @@ _oclHashcat ()
local h=1
local no_opts=0
local attack_mode=0 # also default of oclHashcat
local attack_mode=0 # also default of hashcat
local has_charset_1=0
local has_charset_2=0
local has_charset_3=0
@@ -504,13 +504,13 @@ _oclHashcat ()
fi
if _oclHashcat_contains "${OPTIONS}" "${COMP_WORDS[h]}"; then
if _hashcat_contains "${OPTIONS}" "${COMP_WORDS[h]}"; then
h=$((h + 2))
else
if ! _oclHashcat_contains "${LONG_OPTS}${SHORT_OPTS}" "${COMP_WORDS[h]}"; then
if ! _hashcat_contains "${LONG_OPTS}${SHORT_OPTS}" "${COMP_WORDS[h]}"; then
local variants="-m -a -w -n -u -o -r -d"
local skip=0
local v
@@ -759,4 +759,4 @@ _oclHashcat ()
esac
}
complete -F _oclHashcat -o filenames "${OCLHASHCAT_ROOT}"/oclHashcat64.bin "${OCLHASHCAT_ROOT}"/oclHashcat32.bin "${OCLHASHCAT_ROOT}"/oclHashcat oclHashcat
complete -F _hashcat -o filenames "${HASHCAT_ROOT}"/hashcat64.bin "${HASHCAT_ROOT}"/hashcat32.bin "${HASHCAT_ROOT}"/hashcat hashcat
+1 -1
View File
@@ -1,4 +1,4 @@
run:
source ./install
OR
source ./oclHashcat.sh # not working permanently (i.e. not working after a reboot)
source ./hashcat.sh # not working permanently (i.e. not working after a reboot)
+7 -7
View File
@@ -1,11 +1,11 @@
#!/bin/bash
# Programmable bash completion for oclHashcat
# Programmable bash completion for hashcat
# this script was tested under ubuntu, please verify if on your
# distro /etc/bash_completion.d/ exists (otherwise it won't work)
COMPGENSCRIPT=/etc/bash_completion
COMPGENFOLDER=${COMPGENSCRIPT}.d
COMPGENTARGET=${COMPGENFOLDER}/oclHashcat.sh
COMPGENTARGET=${COMPGENFOLDER}/hashcat.sh
BASHRC=~/.bashrc
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -131,15 +131,15 @@ fi
if [ -d "${COMPGENFOLDER}" ]; then
# remove the old version of oclHashcat64.sh (was renamed to just oclHashcat.sh)
# remove the old version of hashcat64.sh (was renamed to just hashcat.sh)
rm -f "${COMPGENTARGET}"/oclHashcat64.sh
rm -f "${COMPGENTARGET}"/hashcat64.sh
# copy the script to target folder
cp ${ROOT}/oclHashcat.sh "${COMPGENTARGET}"
cp ${ROOT}/hashcat.sh "${COMPGENTARGET}"
# adjust paths to the main binaries of oclHashcat
# adjust paths to the main binaries of hashcat
sed -ri "s!^(ROOT=).*!\1\"${ROOT_PARENT}\"!" "${COMPGENTARGET}"
@@ -162,7 +162,7 @@ EOF
if source_completion; then
echo "Bash completion scripts for oclHashcat were successfully installed, but since you didn't 'source' this file, you need to run:"
echo "Bash completion scripts for hashcat were successfully installed, but since you didn't 'source' this file, you need to run:"
echo "source ${COMPGENTARGET} # or source ${BASHRC}"
echo
echo "in order to be able to use the tab completion within the current shell."