Dreamarena Authentication: Difference between revisions

From dreamcast.wiki
Jump to navigation Jump to search
(Created page with "Dreamarena was an online service used by PAL Dreamcast games. One key element of Dreamarena was its authentication system which some games (Quake 3, Toy Racer) used to get onl...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Dreamarena was an online service used by PAL Dreamcast games. One key element of Dreamarena was its authentication system which some games (Quake 3, Toy Racer) used to get online when using dial-up internet.
Dreamarena was an online service used by PAL Dreamcast games. One key element of Dreamarena was its authentication system which some games (Quake 3, Toy Racer) used to get online when using dial-up internet.


Authentication
'''Authentication'''
 
The Dreamarena authentication protocol was added fairly late on in the Dreamcast life cycle, and the library in the SDK which provided the functionality (authent.lib) only appears in the final KATANA SDK revision.
The Dreamarena authentication protocol was added fairly late on in the Dreamcast life cycle, and the library in the SDK which provided the functionality (authent.lib) only appears in the final KATANA SDK revision.
A server emulator was unfortunately not available in any releases of the SDK leaked online.
A server emulator was unfortunately not available in any releases of the SDK leaked online.
However, patching binaries to overcome Dreamarena is possible.
However, patching binaries to overcome Dreamarena is possible.


Protocol
'''Protocol'''
 
In order to understand how the protocol works, it was necessary to take a look at the sh4 assembly code.
In order to understand how the protocol works, it was necessary to take a look at the sh4 assembly code.
Here is a brief breakdown over how the server and client communicates. This will show from connect to authentication successful.
Here is a brief breakdown over how the server and client communicates. This will show from connect to authentication successful.


Server (First packet to client after TCP handshake):
'''Server (First packet to client after TCP handshake):'''


<pre>
<!KADBICHBIOPETERPAN=><ONLINEGAME>
<!KADBICHBIOPETERPAN=><ONLINEGAME>
<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>
Client (Sends back a default console id and the real console id):
</pre>
 
'''Client (Sends back a default console id and the real console id):'''


<pre>
<!KADBICHBIOPETERPAN=><ONLINESTRT>
<!KADBICHBIOPETERPAN=><ONLINESTRT>
<!KADBICHBIOPETERPAN=>0000000001
<!KADBICHBIOPETERPAN=>0000000001
<!KADBICHBIOPETERPAN=>REAL_CONSOLE_ID
<!KADBICHBIOPETERPAN=>REAL_CONSOLE_ID
<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>
Server:
</pre>
 
'''Server:'''
 
Should use the console id to lookup the user identifiers (3 digits) and the usernames associated with the console.
Should use the console id to lookup the user identifiers (3 digits) and the usernames associated with the console.
For example:
For example:
Line 31: Line 40:
Note:
Note:
Because we don't have this kind of data, which is taken from dream-key registration, just send back empty user list.
Because we don't have this kind of data, which is taken from dream-key registration, just send back empty user list.
<pre>
<!KADBICHBIOPETERPAN=><USERLISTSP>
<!KADBICHBIOPETERPAN=><USERLISTSP>
<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>
Client:
</pre>
 
'''Client:'''
 
Will response with it's username, password and name of the game.
Will response with it's username, password and name of the game.
Because we send a empty userlist, the user can choose between
Because we send a empty userlist, the user can choose between
Line 39: Line 53:
The USERNAME will be the picked console id in the response packet.
The USERNAME will be the picked console id in the response packet.


<pre>
<!KADBICHBIOPETERPAN=><USERNAMESL>
<!KADBICHBIOPETERPAN=><USERNAMESL>
<!KADBICHBIOPETERPAN=>USERNAME
<!KADBICHBIOPETERPAN=>USERNAME
Line 44: Line 59:
<!KADBICHBIOPETERPAN=>NAME_OF_GAME
<!KADBICHBIOPETERPAN=>NAME_OF_GAME
<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>
Server:
</pre>
 
'''Server:'''
 
The below response is bascially saying
The below response is bascially saying
You've not registered a gamer name with us before. Please select a name you would like to use whilst playing.
You've not registered a gamer name with us before. Please select a name you would like to use whilst playing.


<pre>
<!KADBICHBIOPETERPAN=><GAMENAMNON>
<!KADBICHBIOPETERPAN=><GAMENAMNON>
<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>
</pre>


Otherwise use the below response to set the game name, this was taken from the console id -> gamer name mapping back in the days.
Otherwise use the below response to set the game name, this was taken from the console id -> gamer name mapping back in the days.
If the REGISTERED_GAME_NAME is not accepted by the server, it should send suggested gamer name (not implemented).
If the REGISTERED_GAME_NAME is not accepted by the server, it should send suggested gamer name (not implemented).
<pre>
<!KADBICHBIOPETERPAN=><GAMENAMREG>REGISTERED_GAME_NAME
<!KADBICHBIOPETERPAN=><GAMENAMREG>REGISTERED_GAME_NAME
<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>
Client (Response with the entered game name):
</pre>


'''Client (Response with the entered game name):'''
<pre>
<!KADBICHBIOPETERPAN=><GAMENAMESL>
<!KADBICHBIOPETERPAN=><GAMENAMESL>
<!KADBICHBIOPETERPAN=>ENTERED_GAME_NAME
<!KADBICHBIOPETERPAN=>ENTERED_GAME_NAME
<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>
Server:
</pre>


'''Server:'''
<pre>
<!KADBICHBIOPETERPAN=><OKSERVAUTH>
<!KADBICHBIOPETERPAN=><OKSERVAUTH>
<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>
Client:
</pre>


'''Client:'''
<pre>
<!KADBICHBIOPETERPAN=><OKAUTHORIS>
<!KADBICHBIOPETERPAN=><OKAUTHORIS>
<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>
Server (Send registration data):
</pre>
 
'''Server (Send registration data):'''


<pre>
<!KADBICHBIOPETERPAN=><USERINFOPK>
<!KADBICHBIOPETERPAN=><USERINFOPK>
<!KADBICHBIOPETERPAN=>001<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>001<!KADBICHBIOPETERPAN=>
Line 79: Line 113:
<!KADBICHBIOPETERPAN=>foo_gamer_name<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>foo_gamer_name<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>foo@bar.com<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>foo@bar.com<!KADBICHBIOPETERPAN=>
</pre>
The data format of each of these parameters is:
The data format of each of these parameters is:


Line 89: Line 125:
     char        gamername[20];
     char        gamername[20];
     char        emailaddress[65];
     char        emailaddress[65];
Client (Sends the service type the games operates over: gmsv,lobb,chat,gmsp):


'''Client (Sends the service type the games operates over: gmsv,lobb,chat,gmsp):'''
<pre>
<!KADBICHBIOPETERPAN=><SERVICECOD>
<!KADBICHBIOPETERPAN=><SERVICECOD>
<!KADBICHBIOPETERPAN=>SERVICE_TYPE<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>SERVICE_TYPE<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>
Server (The amount of instances of the requested service type, that is if you have two lobbies then the value should be 0002):
</pre>


'''Server (The amount of instances of the requested service type, that is if you have two lobbies then the value should be 0002):'''
<pre>
<!KADBICHBIOPETERPAN=><SERVICEDET>
<!KADBICHBIOPETERPAN=><SERVICEDET>
<!KADBICHBIOPETERPAN=>0001<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>0001<!KADBICHBIOPETERPAN=>
Client (Asks for the first service, will send 0001 x (amount of service instances sent above) ):
</pre>


'''Client (Asks for the first service, will send 0001 x (amount of service instances sent above) ):'''
<pre>
<!KADBICHBIOPETERPAN=><SERVICELST>
<!KADBICHBIOPETERPAN=><SERVICELST>
<!KADBICHBIOPETERPAN=>0001<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>0001<!KADBICHBIOPETERPAN=>
Server (Sends the connection data for the service type):
</pre>


'''Server (Sends the connection data for the service type):'''
<pre>
<!KADBICHBIOPETERPAN=><SERVICESAV>
<!KADBICHBIOPETERPAN=><SERVICESAV>
<!KADBICHBIOPETERPAN=><SERVICESTR>0001
<!KADBICHBIOPETERPAN=><SERVICESTR>0001
Line 111: Line 158:
<!KADBICHBIOPETERPAN=>PORT
<!KADBICHBIOPETERPAN=>PORT
<!KADBICHBIOPETERPAN=><SERVICEEND><!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=><SERVICEEND><!KADBICHBIOPETERPAN=>
Client (Done):
</pre>


'''Client (Done):'''
<pre>
<!KADBICHBIOPETERPAN=><AUTHSUCCES><!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=><AUTHSUCCES><!KADBICHBIOPETERPAN=>
</pre>
That was it, a proof-of-concept has been done with Q3 and Toyracer PAL and both works fine after the authentication.
That was it, a proof-of-concept has been done with Q3 and Toyracer PAL and both works fine after the authentication.


Line 123: Line 175:
A production-ready server is being worked on.
A production-ready server is being worked on.


Games Known to use Authentication
'''Games Known to use Authentication'''
Toy Racer
 
Quake 3 (PAL)
* Toy Racer
* Quake 3 (PAL)

Latest revision as of 14:56, 30 January 2020

Dreamarena was an online service used by PAL Dreamcast games. One key element of Dreamarena was its authentication system which some games (Quake 3, Toy Racer) used to get online when using dial-up internet.

Authentication

The Dreamarena authentication protocol was added fairly late on in the Dreamcast life cycle, and the library in the SDK which provided the functionality (authent.lib) only appears in the final KATANA SDK revision. A server emulator was unfortunately not available in any releases of the SDK leaked online. However, patching binaries to overcome Dreamarena is possible.

Protocol

In order to understand how the protocol works, it was necessary to take a look at the sh4 assembly code. Here is a brief breakdown over how the server and client communicates. This will show from connect to authentication successful.

Server (First packet to client after TCP handshake):

<!KADBICHBIOPETERPAN=><ONLINEGAME>
<!KADBICHBIOPETERPAN=>

Client (Sends back a default console id and the real console id):

<!KADBICHBIOPETERPAN=><ONLINESTRT>
<!KADBICHBIOPETERPAN=>0000000001
<!KADBICHBIOPETERPAN=>REAL_CONSOLE_ID
<!KADBICHBIOPETERPAN=>

Server:

Should use the console id to lookup the user identifiers (3 digits) and the usernames associated with the console. For example:

console id user id username 0000000001 111 foo 0000000001 222 bar

Then if the server gets the <ONLINESTRT> 0000000001 it should return 111 foo and 222 bar. Note: Because we don't have this kind of data, which is taken from dream-key registration, just send back empty user list.

<!KADBICHBIOPETERPAN=><USERLISTSP>
<!KADBICHBIOPETERPAN=>

Client:

Will response with it's username, password and name of the game. Because we send a empty userlist, the user can choose between 0000000001 and REAL_CONSOLE_ID. The USERNAME will be the picked console id in the response packet.

<!KADBICHBIOPETERPAN=><USERNAMESL>
<!KADBICHBIOPETERPAN=>USERNAME
<!KADBICHBIOPETERPAN=>ENTERED_PASSWORD
<!KADBICHBIOPETERPAN=>NAME_OF_GAME
<!KADBICHBIOPETERPAN=>

Server:

The below response is bascially saying You've not registered a gamer name with us before. Please select a name you would like to use whilst playing.

<!KADBICHBIOPETERPAN=><GAMENAMNON>
<!KADBICHBIOPETERPAN=>

Otherwise use the below response to set the game name, this was taken from the console id -> gamer name mapping back in the days. If the REGISTERED_GAME_NAME is not accepted by the server, it should send suggested gamer name (not implemented).

<!KADBICHBIOPETERPAN=><GAMENAMREG>REGISTERED_GAME_NAME
<!KADBICHBIOPETERPAN=>

Client (Response with the entered game name):

<!KADBICHBIOPETERPAN=><GAMENAMESL>
<!KADBICHBIOPETERPAN=>ENTERED_GAME_NAME
<!KADBICHBIOPETERPAN=>

Server:

<!KADBICHBIOPETERPAN=><OKSERVAUTH>
<!KADBICHBIOPETERPAN=>

Client:

<!KADBICHBIOPETERPAN=><OKAUTHORIS>
<!KADBICHBIOPETERPAN=>

Server (Send registration data):

<!KADBICHBIOPETERPAN=><USERINFOPK>
<!KADBICHBIOPETERPAN=>001<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>foo<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>uk<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>uk<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>18<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>foo_chat_name<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>foo_gamer_name<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>foo@bar.com<!KADBICHBIOPETERPAN=>

The data format of each of these parameters is:

   char        shortname[16];
   char        userid[10];
   char        preferredlanguage[3];
   char        countryid[2];
   char        age[3];
   char        chatname[20];
   char        gamername[20];
   char        emailaddress[65];

Client (Sends the service type the games operates over: gmsv,lobb,chat,gmsp):

<!KADBICHBIOPETERPAN=><SERVICECOD>
<!KADBICHBIOPETERPAN=>SERVICE_TYPE<!KADBICHBIOPETERPAN=>
<!KADBICHBIOPETERPAN=>

Server (The amount of instances of the requested service type, that is if you have two lobbies then the value should be 0002):

<!KADBICHBIOPETERPAN=><SERVICEDET>
<!KADBICHBIOPETERPAN=>0001<!KADBICHBIOPETERPAN=>

Client (Asks for the first service, will send 0001 x (amount of service instances sent above) ):

<!KADBICHBIOPETERPAN=><SERVICELST>
<!KADBICHBIOPETERPAN=>0001<!KADBICHBIOPETERPAN=>

Server (Sends the connection data for the service type):

<!KADBICHBIOPETERPAN=><SERVICESAV>
<!KADBICHBIOPETERPAN=><SERVICESTR>0001
<!KADBICHBIOPETERPAN=>SERVICE_TYPE
<!KADBICHBIOPETERPAN=>Service description
<!KADBICHBIOPETERPAN=>IP
<!KADBICHBIOPETERPAN=>PORT
<!KADBICHBIOPETERPAN=><SERVICEEND><!KADBICHBIOPETERPAN=>

Client (Done):

<!KADBICHBIOPETERPAN=><AUTHSUCCES><!KADBICHBIOPETERPAN=>

That was it, a proof-of-concept has been done with Q3 and Toyracer PAL and both works fine after the authentication.

Notes: 1. The above auth. conversation is the fastest way of getting a AUTHSUCCESS, there is more in the protocol regarding fetching registration data and mapping, but for now those are not necessary to get the games to work. 2. No newline in the packages from the server.

A production-ready server is being worked on.

Games Known to use Authentication

  • Toy Racer
  • Quake 3 (PAL)