SHOW:
|
|
- or go back to the newest paste.
| 1 | #!/bin/sh | |
| 2 | # | |
| 3 | # Star Wars: The Old Republic Password Hash Extractor | |
| 4 | # Used for running the game on Wine. | |
| 5 | # | |
| 6 | # Instructions: | |
| 7 | # Run the launcher and log in. | |
| 8 | # Click play. | |
| 9 | # Run script. | |
| 10 | # Copy the arguments and paste it on PlayOnLinux configuration. | |
| 11 | # Run the hack. | |
| 12 | # | |
| 13 | ||
| 14 | # Sample Args: | |
| 15 | # C:\Program Files (x86)\Electronic Arts\BioWare\Star Wars - The Old Republic\swtor\RetailClient\swtor.exe -set username sampleuser -set password somelonghashxxyy== -set platform gamepad.swtor.com:443 -set environment swtor -set lang en-us -set torsets main,en-us @swtor_dual.icb | |
| 16 | ||
| 17 | PID=`pidof swtor.exe` | |
| 18 | ||
| 19 | if [ -z "$PID" ]; then | |
| 20 | echo "No PID found. Exiting." | |
| 21 | exit 1; | |
| 22 | fi | |
| 23 | ||
| 24 | case "$PID" in | |
| 25 | *\ * ) | |
| 26 | - | echo "Invalid PID: $PID." |
| 26 | + | found=0 |
| 27 | - | exit 1 |
| 27 | + | # look for the proper PID. |
| 28 | for testpid in $PID | |
| 29 | do | |
| 30 | TESTARG=$(cat "/proc/$testpid/cmdline") | |
| 31 | case "$TESTARG" in | |
| 32 | *username*) | |
| 33 | PID=$testpid | |
| 34 | found=1 | |
| 35 | ;; | |
| 36 | *);; | |
| 37 | esac | |
| 38 | done; | |
| 39 | ||
| 40 | if [ "$found" -eq "0" ];then | |
| 41 | zenity --title "SWTOR Arguments" --text "Too many SWTOR PIDs found. $PID No appropriate PID found." --info & | |
| 42 | exit 1 | |
| 43 | fi | |
| 44 | ;; | |
| 45 | *) echo "PID Found is: $PID" ;; | |
| 46 | esac | |
| 47 | ||
| 48 | ||
| 49 | ARGPATH="/proc/$PID/cmdline" | |
| 50 | ||
| 51 | OUTPUT="swtor.exe " | |
| 52 | ||
| 53 | echo "Commandline Executed is in: $ARGPATH" | |
| 54 | ||
| 55 | WRITE=0 | |
| 56 | ||
| 57 | for i in $(cat $ARGPATH | xargs -0 echo); do | |
| 58 | #printf "cmd: %s \n" "$i"; | |
| 59 | if [ "$WRITE" -eq "1" ];then | |
| 60 | OUTPUT="$OUTPUT $i" | |
| 61 | fi | |
| 62 | ||
| 63 | # This effectively skips the swotr.exe part. | |
| 64 | if [ "$WRITE" -eq "0" ];then | |
| 65 | case "$i" in | |
| 66 | *swtor.exe*) WRITE=1 ;; | |
| 67 | *) ;; | |
| 68 | esac | |
| 69 | fi | |
| 70 | ||
| 71 | done; | |
| 72 | ||
| 73 | echo "RECONSTRUCTED OUTPUT: $OUTPUT" | |
| 74 | ||
| 75 | zenity --title "SWTOR Arguments" --text "Copy/Paste these arguments: $OUTPUT" --info --width 800 & | |
| 76 | ||
| 77 | echo "Killing stray SWTOR process..." | |
| 78 | kill -9 $PID |