GTS protocol: Difference between revisions

From ProjectPokemon Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 10: Line 10:


This takes the form of HTTP GET requests to the server. The requests are of the form <code><page>.asp?pid=<pid>&hash=<hash>&data=<data></code>. Before each "real" request, the game sends a request of the form <code><page>.asp?pid=<pid></code> and the server responds with a 32-byte challenge token. The game computes <code>sha1("sAdeqWo3voLeC5r16DYv" + token)</code> and uses that as the hash value which it sends to the server. The data parameter is encrypted with an unknown algorithm.
This takes the form of HTTP GET requests to the server. The requests are of the form <code><page>.asp?pid=<pid>&hash=<hash>&data=<data></code>. Before each "real" request, the game sends a request of the form <code><page>.asp?pid=<pid></code> and the server responds with a 32-byte challenge token. The game computes <code>sha1("sAdeqWo3voLeC5r16DYv" + token)</code> and uses that as the hash value which it sends to the server. The data parameter is encrypted with an unknown algorithm.
The first request the game makes is to <code>/pokemondpds/worldexchange/info.asp</code>. The server responds with 0x0001.
Next, it makes a request to <code>/pokemondpds/worldexchange/result.php</code>. If there is a Pokémon stored at the GTS, the server responds with 0x0005, otherwise it responds with 0x0004.

Revision as of 01:49, 21 March 2010

The following is wild conjecture based on LordLandon's sendpkm.py.

Communication with the GTS is done over regular HTTP with http://gamestats2.gs.nintendowifi.net/.

HTTP headers

The games don't seem to care about these at all. The GTS sends back a bunch of boilerplate response headers, but the game happily accepts a response with only a Content-Length.

Protocol

This takes the form of HTTP GET requests to the server. The requests are of the form <page>.asp?pid=<pid>&hash=<hash>&data=. Before each "real" request, the game sends a request of the form <page>.asp?pid=<pid> and the server responds with a 32-byte challenge token. The game computes sha1("sAdeqWo3voLeC5r16DYv" + token) and uses that as the hash value which it sends to the server. The data parameter is encrypted with an unknown algorithm.

The first request the game makes is to /pokemondpds/worldexchange/info.asp. The server responds with 0x0001.

Next, it makes a request to /pokemondpds/worldexchange/result.php. If there is a Pokémon stored at the GTS, the server responds with 0x0005, otherwise it responds with 0x0004.