mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
make miscchecks
This commit is contained in:
parent
9ae1ebc8a5
commit
bf8cd5c00b
1 changed files with 39 additions and 39 deletions
78
pm3
78
pm3
|
@ -17,27 +17,27 @@ BOOTIMAGE="bootrom.elf"
|
||||||
|
|
||||||
#Skip check if --list is used
|
#Skip check if --list is used
|
||||||
if [ ! "$1" == "--list" ]; then
|
if [ ! "$1" == "--list" ]; then
|
||||||
# try pm3 dirs in current repo workdir
|
# try pm3 dirs in current repo workdir
|
||||||
if [ -d "$PM3PATH/client/" ]; then
|
if [ -d "$PM3PATH/client/" ]; then
|
||||||
if [ -x "$PM3PATH/client/proxmark3" ]; then
|
if [ -x "$PM3PATH/client/proxmark3" ]; then
|
||||||
CLIENT="$PM3PATH/client/proxmark3"
|
CLIENT="$PM3PATH/client/proxmark3"
|
||||||
elif [ -x "$PM3PATH/client/build/proxmark3" ]; then
|
elif [ -x "$PM3PATH/client/build/proxmark3" ]; then
|
||||||
CLIENT="$PM3PATH/client/build/proxmark3"
|
CLIENT="$PM3PATH/client/build/proxmark3"
|
||||||
else
|
else
|
||||||
echo >&2 "[!!] In devel workdir but no executable found, did you compile it?"
|
echo >&2 "[!!] In devel workdir but no executable found, did you compile it?"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Devel mode: point to workdir pm3.py module
|
# Devel mode: point to workdir pm3.py module
|
||||||
EVALENV+=" PYTHONPATH=$PM3PATH/client/src"
|
EVALENV+=" PYTHONPATH=$PM3PATH/client/src"
|
||||||
# try install dir
|
# try install dir
|
||||||
elif [ -x "$PM3PATH/proxmark3" ]; then
|
elif [ -x "$PM3PATH/proxmark3" ]; then
|
||||||
CLIENT="$PM3PATH/proxmark3"
|
CLIENT="$PM3PATH/proxmark3"
|
||||||
EVALENV+=" PYTHONPATH=$PM3PATH/../share/proxmark3/pyscripts/"
|
EVALENV+=" PYTHONPATH=$PM3PATH/../share/proxmark3/pyscripts/"
|
||||||
# or /usr/[local/]lib/python3/dist-packages/pm3.py ?
|
# or /usr/[local/]lib/python3/dist-packages/pm3.py ?
|
||||||
else
|
else
|
||||||
# hope it's installed somehow, still not sure where fw images and pm3.py are...
|
# hope it's installed somehow, still not sure where fw images and pm3.py are...
|
||||||
CLIENT="proxmark3"
|
CLIENT="proxmark3"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# LeakSanitizer suppressions
|
# LeakSanitizer suppressions
|
||||||
|
@ -150,15 +150,15 @@ function get_pm3_list_Windows {
|
||||||
# Normal SERIAL PORTS (COM)
|
# Normal SERIAL PORTS (COM)
|
||||||
for DEV in $(wmic /locale:ms_409 path Win32_SerialPort Where "PNPDeviceID LIKE '%VID_9AC4&PID_4B8F%' Or PNPDeviceID LIKE '%VID_2D2D&PID_504D%'" Get DeviceID 2>/dev/null | awk -b '/^COM/{print $1}'); do
|
for DEV in $(wmic /locale:ms_409 path Win32_SerialPort Where "PNPDeviceID LIKE '%VID_9AC4&PID_4B8F%' Or PNPDeviceID LIKE '%VID_2D2D&PID_504D%'" Get DeviceID 2>/dev/null | awk -b '/^COM/{print $1}'); do
|
||||||
DEV=${DEV/ */}
|
DEV=${DEV/ */}
|
||||||
#prevent soft bricking when using pm3-flash-all on an outdated bootloader
|
#prevent soft bricking when using pm3-flash-all on an outdated bootloader
|
||||||
if [ $(basename -- "$0") = "pm3-flash-all" ]; then
|
if [ $(basename -- "$0") = "pm3-flash-all" ]; then
|
||||||
if [ ! $(wmic /locale:ms_409 path Win32_SerialPort Where "DeviceID='$DEV'" Get PNPDeviceID 2>/dev/null | awk -b '/^USB/{print $1}') = "USB\VID_9AC4&PID_4B8F\ICEMAN" ]; then
|
if [ ! $(wmic /locale:ms_409 path Win32_SerialPort Where "DeviceID='$DEV'" Get PNPDeviceID 2>/dev/null | awk -b '/^USB/{print $1}') = "USB\VID_9AC4&PID_4B8F\ICEMAN" ]; then
|
||||||
echo -e "\033[0;31m[!] Using pm3-flash-all on an oudated bootloader, use pm3-flash-bootrom first!"
|
echo -e "\033[0;31m[!] Using pm3-flash-all on an oudated bootloader, use pm3-flash-bootrom first!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
#Prioritise USB connections
|
#Prioritise USB connections
|
||||||
PM3LIST=("$DEV" "${PM3LIST[@]}")
|
PM3LIST=("$DEV" "${PM3LIST[@]}")
|
||||||
if [ ${#PM3LIST[*]} -ge "$N" ]; then
|
if [ ${#PM3LIST[*]} -ge "$N" ]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
@ -201,19 +201,19 @@ function get_pm3_list_WSL {
|
||||||
|
|
||||||
# Normal SERIAL PORTS (COM)
|
# Normal SERIAL PORTS (COM)
|
||||||
for DEV in $($PSHEXE -command "Get-CimInstance -ClassName Win32_serialport | Where-Object {\$_.PNPDeviceID -like '*VID_9AC4&PID_4B8F*' -or \$_.PNPDeviceID -like '*VID_2D2D&PID_504D*'} | Select -expandproperty DeviceID" 2>/dev/null | tr -dc '[:print:]'); do
|
for DEV in $($PSHEXE -command "Get-CimInstance -ClassName Win32_serialport | Where-Object {\$_.PNPDeviceID -like '*VID_9AC4&PID_4B8F*' -or \$_.PNPDeviceID -like '*VID_2D2D&PID_504D*'} | Select -expandproperty DeviceID" 2>/dev/null | tr -dc '[:print:]'); do
|
||||||
_comport=$DEV
|
_comport=$DEV
|
||||||
DEV=$(echo $DEV | sed -nr 's#^COM([0-9]+)\b#/dev/ttyS\1#p')
|
DEV=$(echo $DEV | sed -nr 's#^COM([0-9]+)\b#/dev/ttyS\1#p')
|
||||||
# ttyS counterpart takes some more time to appear
|
# ttyS counterpart takes some more time to appear
|
||||||
if [ -e "$DEV" ]; then
|
if [ -e "$DEV" ]; then
|
||||||
#prevent soft bricking when using pm3-flash-all on an outdated bootloader
|
#prevent soft bricking when using pm3-flash-all on an outdated bootloader
|
||||||
if [ $(basename -- "$0") = "pm3-flash-all" ]; then
|
if [ $(basename -- "$0") = "pm3-flash-all" ]; then
|
||||||
if [ ! $($PSHEXE -command "Get-CimInstance -ClassName Win32_serialport | Where-Object {\$_.DeviceID -eq '$_comport'} | Select -expandproperty PNPDeviceID" 2>/dev/null | tr -dc '[:print:]') = "USB\VID_9AC4&PID_4B8F\ICEMAN" ]; then
|
if [ ! $($PSHEXE -command "Get-CimInstance -ClassName Win32_serialport | Where-Object {\$_.DeviceID -eq '$_comport'} | Select -expandproperty PNPDeviceID" 2>/dev/null | tr -dc '[:print:]') = "USB\VID_9AC4&PID_4B8F\ICEMAN" ]; then
|
||||||
echo -e "\033[0;31m[!] Using pm3-flash-all on an oudated bootloader, use pm3-flash-bootrom first!"
|
echo -e "\033[0;31m[!] Using pm3-flash-all on an oudated bootloader, use pm3-flash-bootrom first!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
#Prioritise USB connections
|
#Prioritise USB connections
|
||||||
PM3LIST=("$DEV" "${PM3LIST[@]}")
|
PM3LIST=("$DEV" "${PM3LIST[@]}")
|
||||||
if [ ! -w "$DEV" ]; then
|
if [ ! -w "$DEV" ]; then
|
||||||
echo "[!] Let's give users read/write access to $DEV"
|
echo "[!] Let's give users read/write access to $DEV"
|
||||||
sudo chmod 666 "$DEV"
|
sudo chmod 666 "$DEV"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue