mirror of
https://gitlab.com/Nanolx/smashbroshaxer.git
synced 2024-11-22 01:09:16 +01:00
modularize code, add non-interactive mode, update README, add --help
This commit is contained in:
parent
b8b9b326b2
commit
2d5881e6c3
8
README
8
README
@ -8,7 +8,7 @@ Requirements:
|
||||
* Gtk+ 3
|
||||
* sudo
|
||||
|
||||
Usage:
|
||||
Usage (interactive mode):
|
||||
* run script
|
||||
* select wifi device
|
||||
* select game version
|
||||
@ -16,3 +16,9 @@ Usage:
|
||||
* enter your password in terminal
|
||||
* in game go to Smash > Group
|
||||
* ... profit?
|
||||
|
||||
Usage (non-interactive mode):
|
||||
* smashbroshaxer <wifi-device> <pcap-file>
|
||||
* enter your password in terminal
|
||||
* in game go to Smash > Group
|
||||
* ... profit?
|
||||
|
@ -3,6 +3,9 @@
|
||||
basedir=$(readlink -m "${BASH_SOURCE[0]}")
|
||||
basedir=$(dirname ${basedir})
|
||||
|
||||
reldate="2016/07/24"
|
||||
version="2.0"
|
||||
|
||||
if [[ $(uname -m) == "x86_64" ]]; then
|
||||
YAD=${basedir}/bin/yad.64
|
||||
AIREPLAY=${basedir}/bin/aireplay-ng.64
|
||||
@ -10,6 +13,31 @@ else YAD=${basedir}/bin/yad.32
|
||||
AIREPLAY=${basedir}/bin/aireplay-ng.32
|
||||
fi
|
||||
|
||||
smash_my_hax () {
|
||||
|
||||
x-terminal-emulator -e /bin/bash -c \
|
||||
"sudo ifconfig ${device} down && \
|
||||
sudo iwconfig ${device} mode monitor && \
|
||||
sudo ifconfig ${device} up && \
|
||||
yes | sudo ${AIREPLAY} \
|
||||
--interactive \
|
||||
-r ${replay} \
|
||||
-h 59:ee:3f:2a:37:e0 \
|
||||
-x 20 \
|
||||
${device}"
|
||||
|
||||
}
|
||||
|
||||
open_3ds_homebrew () {
|
||||
xdg-open "https://smealum.github.io/3ds/"
|
||||
}
|
||||
|
||||
open_smashbroshax () {
|
||||
xdg-open "https://github.com/yellows8/3ds_smashbroshax"
|
||||
}
|
||||
|
||||
interactive_mode () {
|
||||
|
||||
wireless=""
|
||||
for device in /sys/class/net/*; do
|
||||
[[ -e ${device}/wireless ]] && \
|
||||
@ -48,32 +76,50 @@ array=($(${YAD} \
|
||||
ret=$?
|
||||
|
||||
device=${array[0]}
|
||||
replay=${array[1]}
|
||||
replay=${basedir}/pcap/${array[1]}
|
||||
|
||||
case ${ret} in
|
||||
0 ) smash_my_hax ;;
|
||||
|
||||
0 )
|
||||
x-terminal-emulator -e /bin/bash -c \
|
||||
"sudo ifconfig ${device} down && \
|
||||
sudo iwconfig ${device} mode monitor && \
|
||||
sudo ifconfig ${device} up && \
|
||||
yes | sudo ${AIREPLAY} \
|
||||
--interactive \
|
||||
-r ${basedir}/pcap/${replay} \
|
||||
-h 59:ee:3f:2a:37:e0 \
|
||||
-x 20 \
|
||||
${device}"
|
||||
;;
|
||||
2 ) open_3ds_homebrew ;;
|
||||
|
||||
2 )
|
||||
xdg-open "https://smealum.github.io/3ds/"
|
||||
;;
|
||||
3 ) open_smashbroshax ;;
|
||||
|
||||
3 )
|
||||
xdg-open "https://github.com/yellows8/3ds_smashbroshax"
|
||||
;;
|
||||
|
||||
1 )
|
||||
echo -e "\n cancelled by user \n"
|
||||
1 ) echo -e "\n cancelled by user \n"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
case ${1} in
|
||||
--help )
|
||||
echo -e "
|
||||
smashbroshaxer version ${version} (${reldate})
|
||||
|
||||
usage:
|
||||
smashbroshaxer | interactive (UI) mode
|
||||
smashbrosaxer <wifi> <pcap> | non-interactive mode
|
||||
"
|
||||
;;
|
||||
|
||||
"" )
|
||||
interactive_mode
|
||||
;;
|
||||
|
||||
* )
|
||||
if [[ -e /sys/class/net/${1}/wireless ]]; then
|
||||
device=${1}
|
||||
else echo -e "\nspecified device ${1} is not a wireless device!\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -f ${2} ]]; then
|
||||
replay=$(readlink -m ${2})
|
||||
else echo -e "\nspecified replay ${2} is not a pcap replay!\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
smash_my_hax
|
||||
;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user