mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-12-29 11:52:59 +08:00
Merged VID/PID queries
This commit is contained in:
parent
59ab2f3387
commit
a265888e08
1 changed files with 2 additions and 26 deletions
28
pm3
28
pm3
|
@ -148,16 +148,7 @@ function get_pm3_list_Windows {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 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%'" 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/ */}
|
|
||||||
PM3LIST+=("$DEV")
|
|
||||||
if [ ${#PM3LIST[*]} -ge "$N" ]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Original SERIAL PORTS (COM)
|
|
||||||
for DEV in $(wmic /locale:ms_409 path Win32_SerialPort Where "PNPDeviceID LIKE '%VID_2D2D&PID_504D%'" Get DeviceID 2>/dev/null | awk -b '/^COM/{print $1}'); do
|
|
||||||
DEV=${DEV/ */}
|
DEV=${DEV/ */}
|
||||||
PM3LIST+=("$DEV")
|
PM3LIST+=("$DEV")
|
||||||
if [ ${#PM3LIST[*]} -ge "$N" ]; then
|
if [ ${#PM3LIST[*]} -ge "$N" ]; then
|
||||||
|
@ -201,22 +192,7 @@ function get_pm3_list_WSL {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 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*' | Select DeviceID" 2>/dev/null | sed -nr 's#^COM([0-9]+)\b#/dev/ttyS\1#p'); 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 DeviceID" 2>/dev/null | sed -nr 's#^COM([0-9]+)\b#/dev/ttyS\1#p'); do
|
||||||
# ttyS counterpart takes some more time to appear
|
|
||||||
if [ -e "$DEV" ]; then
|
|
||||||
PM3LIST+=("$DEV")
|
|
||||||
if [ ! -w "$DEV" ]; then
|
|
||||||
echo "[!] Let's give users read/write access to $DEV"
|
|
||||||
sudo chmod 666 "$DEV"
|
|
||||||
fi
|
|
||||||
if [ ${#PM3LIST[*]} -ge "$N" ]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Original SERIAL PORTS (COM)
|
|
||||||
for DEV in $($PSHEXE -command "Get-CimInstance -ClassName Win32_serialport | Where-Object PNPDeviceID -like '*VID_2D2D&PID_504D*' | Select DeviceID" 2>/dev/null | sed -nr 's#^COM([0-9]+)\b#/dev/ttyS\1#p'); do
|
|
||||||
# ttyS counterpart takes some more time to appear
|
# ttyS counterpart takes some more time to appear
|
||||||
if [ -e "$DEV" ]; then
|
if [ -e "$DEV" ]; then
|
||||||
PM3LIST+=("$DEV")
|
PM3LIST+=("$DEV")
|
||||||
|
|
Loading…
Reference in a new issue