Monday, January 30, 2017

Using SWProxy for summoners war

First you need to install git (or the gui github desktop). Then you can clone the code from https://github.com/kakaroto/SWProxy. Then you can clone the repository in the GUI or from the command line:

git clone https://github.com/kakaroto/SWProxy.git

Now you have to have python 2.7 and pip installed (best to leave default directory of c:\python27). Pip should be installed automatically as of 2.7.9 and higher, but I did it a while ago and had to install it manually.

You need to be able to run python and pip from the command line. You can run "python --version" and "pip --version" to see if they are in your path, otherwise you need to add "C:\python27" and "C:\python27\scripts" to your path.

Next you need to install Microsoft Visual C++ Compiler for Python 2.7. This is required for one of the encryption packages you'll install next with pip because it compiles some C++ code. After installing that you can install the pip packages required with this:

pip install pycrypto dpkt yapsy

To use the proxy your computer has to be attached to the same access point as your phone (unless you setup the routing yourself, but then you don't need to be reading this :)). Check your computer's ip address by running "ipconfig". You should see a wifi adapter with an address like 192.168.1.101:

   IPv4 Address. . . . . . . . . . . : 192.168.1.101
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1


Now you're ready to run the proxy. Go to the folder with the code in it and run "python SWProxy.py". It should start and tell you the ip address and port it is running on:

########################################
# SWParser v0.100 - Summoners War Proxy #
########################################
        Written by:
                KaKaRoTo

        Authors:
                Youness Alaoui
                Leonardo Stern
                Azrethos

        Plugins:
                Generate Visit Friend
                Demo Plugin
                SWARFARM Export Plugin
                Generate Runes
                Print Unit Collection
                Barion Rune Efficiency Plugin

Licensed under LGPLv3 and available at:
        https://github.com/kakaroto/SWProxy

Failed to load GUI dependencies. Switching to CLI mode
Running Proxy server at 192.168.1.101 on port 8080


Now on your phone make sure you're connected to the same wifi access point as your computer and change the settings of the access point to use the proxy 192.168.1.101 (or whatever your ip address is) and port 8080. Then kill your game and restart it or log out and back in. The login packet has all your account data and will produce several files, these are mine:

-rw-r--r-- 1 Jason 197609 2581564 Jan 29 17:35 6202709.json
-rw-r--r-- 1 Jason 197609     714 Jan 29 17:35 6202709-info.csv
-rw-r--r-- 1 Jason 197609   35236 Jan 29 17:35 6202709-monsters.csv
-rw-r--r-- 1 Jason 197609  852821 Jan 29 17:35 6202709-optimizer.json
-rw-r--r-- 1 Jason 197609   91540 Jan 29 17:35 6202709-runes.csv
-rw-r--r-- 1 Jason 197609  696553 Jan 29 17:35 6202709-swarfarm.json


When you visit another player you will get lists for them too but they have much less data:

-rw-r--r-- 1 Jason 197609  942112 Jan 29 17:36 visit-2403436.json
-rw-r--r-- 1 Jason 197609   47097 Jan 29 17:36 visit-2403436-monsters.csv
-rw-r--r-- 1 Jason 197609  931956 Jan 29 17:36 visit-2913465.json
-rw-r--r-- 1 Jason 197609   45451 Jan 29 17:36 visit-2913465-monsters.csv
-rw-r--r-- 1 Jason 197609 1741862 Jan 29 17:35 visit-3563695.json
-rw-r--r-- 1 Jason 197609   88550 Jan 29 17:35 visit-3563695-monsters.csv