Skip to content

Instantly share code, notes, and snippets.

@kprotty
Last active July 19, 2019 00:23
Show Gist options
  • Save kprotty/94f86ef43e464836db9b906c50236485 to your computer and use it in GitHub Desktop.
Save kprotty/94f86ef43e464836db9b906c50236485 to your computer and use it in GitHub Desktop.

Gigantic MICE Protocol

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

Connecting

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)

Authenticating

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.

Communicating

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment