A small interpretation of part of the Gigantic MICE protocol realized by Gabs. This is mostly just what I understand from it and may not accurately depict what its really doing. For most references, i'd say check out gab's ruby version as well as the decompiled protocol code in IDA or similar
Theres two servers used to implement gigantic's party system: The Data server and the Mice server. Using a patched ArkSDK (you can find more info on that in the repo) it will attempt to connect to the Data server by requesting POST http://dataserver/auth/0.0/arch/auth
with an arc_token
and version
encoded through application/x-www-form-urlencoded
. An example of what should be returned can be found Here. This returned json contains:
- the user token
- address of the Mice server to connect to
- the SALSA_CLIENT_KEY and SALSA_SERVER_KEY (which should match that of the server)
After the client connects to the Mice server, communication then happens through packets prefixed with the BER-compressed integer denoting the length in bytes followed by that many bytes called the payload. The payload needs to then be decrypted using Salsa16 which an example implementation can be found Here
The first packet sent by the client needs to be decrypted with a Salsa context using SALSA_CLIENT_KEY and 12 rounds. This results in a payload of json data containing an array of [token, not_sure_atm]
which can be used to verify the client. The client connection then uses two separate Salsa contextes (SALSA_IN and SALSA_OUT) for decrypting incoming data and encrypting outgoing data. Each is initialized using SALSA_SERVER_KEY and 16 rounds instead this time. In response to the [token, data]
packet, the client sends back a json encoded auth payload as seen Here.
Subsequent client packets are BER-compressed length prefixed & decrypted using SALSA_IN. They also have a json payload format of [command, data, id]
. The list of commands and what to return half-documented by Gabs can be found Here with the full list somewhere in the game binary if one searches hard enough through the strings in data sections. Responses to client packet are also BER-compressed length prefixed & encrypyted using SALSA_OUT with the json payload format being [response, id]
. Hopefully this is enough to get you started on writing a MICE server.