You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The game server (gme) is the main server which all the actions of Brave Frontier are done.
4
+
The game server (GME) is the main server which all the actions of Brave Frontier are done.
5
5
6
6
The original server was written in PHP (according to a leak of one misconfigured file) as a REST api,
7
7
each key of the JSON are not written in plaintext, rather they seems to be an hash of the field name,
8
8
this is presumably done to complex the analysis of the packets.
9
9
10
10
11
-
The flow of a gme packet works this file: (apply the opposite for reading one)
11
+
The flow of a GME packet follows as this file: (apply the opposite for reading one)
12
12
13
13
.. info::
14
14
@@ -19,25 +19,121 @@ The flow of a gme packet works this file: (apply the opposite for reading one)
19
19
20
20
1. The actual JSON packet gets created by the client
21
21
2. The packet is crypted with AES/ECB and encoded in Base-64 with a key that changes for every request type
22
-
3. The crypted JSON is then embedded in a GME JSON
22
+
3. The encrypted JSON is then embedded in a GME JSON
23
23
24
24
25
25
This is what a completed GME packet looks like:
26
26
27
27
.. code::
28
28
29
29
{
30
-
"F4q6i9xe": {
31
-
"aV6cLn3v": "Client ID that send the request",
32
-
"Hhgi79M1": "Game request"
30
+
"F4q6i9xe": {
31
+
"aV6cLn3v": "Client ID that send the request",
32
+
"Hhgi79M1": "Game request"
33
33
},
34
-
"a3vSYuq2": {
35
-
"Kn51uR4Y": "Crypted JSON body"
36
-
}
34
+
"a3vSYuq2": {
35
+
"Kn51uR4Y": "Encrypted JSON body"
36
+
}
37
37
}
38
38
39
+
Understanding Game Client Requests
40
+
-------------------------------------------
41
+
42
+
As you navigate around in the game, you may have came across something akin to the below screen:
43
+
44
+
.. image::
45
+
../../../images/unsupported_request_YPBU7MD8.png
46
+
47
+
This can happen when the client sends a game request that the server does not recognize or support. In the above example,
48
+
the client sent a game request with the ID ``YPBU7MD8`` which the server does not have a handler for.
49
+
50
+
For a more concrete example, take a look at the server console to see what happens whenever the home menu button is pressed
51
+
in the game client:
52
+
53
+
::
54
+
55
+
20250319 00:45:49.594000 UTC 35296 TRACE [newConnection] new connection:fd=516 address=127.0.0.1:53896 - TcpServer.cc:62
56
+
20250319 00:45:49.594000 UTC 35296 TRACE [TcpConnectionImpl] new connection:127.0.0.1:53896->127.0.0.1:9960 - TcpConnectionImpl.cc:78
57
+
20250319 00:45:49.594000 UTC 21908 TRACE [operator ()] connectEstablished - TcpConnectionImpl.cc:262
58
+
20250319 00:45:49.594000 UTC 21908 TRACE [onHttpRequest] new request:127.0.0.1:53896->127.0.0.1:9960 - HttpServer.cc:415
59
+
20250319 00:45:49.594000 UTC 21908 TRACE [onHttpRequest] Headers POST /bf/gme/action.php - HttpServer.cc:417
60
+
20250319 00:45:49.594000 UTC 21908 TRACE [onHttpRequest] http path=/bf/gme/action.php - HttpServer.cc:418
61
+
62
+
We see that the client sends a POST request to the server with the path ``/bf/gme/action.php``. We can gather more information by looking at
63
+
the server request logs, located in ``deploy/log_req``:
64
+
65
+
::
66
+
67
+
deploy/log_req
68
+
├── NiYWKdzs_18_03_2025-21_11_46.json
69
+
├── ...
70
+
71
+
The first part of the filename, ``NiYWKdzs``, is the client's game request ID. In this particular example, when the home menu button was pressed,
72
+
the client sent a POST request to path ``/bf/gme/action.php`` with game request ID ``NiYWKdzs``. The decrypted JSON body of the request
73
+
is stored in the file ``NiYWKdzs_18_03_2025-21_11_46.json`` itself.
74
+
75
+
Understanding Game Server Responses
76
+
-------------------------------------------
77
+
78
+
In the example above, the server handler for game request ``NiYWKdzs`` does not acutally send a response back. To look at an example where the server
79
+
returns a response, try pressing the summon menu button in game, and pay close attention to the server console:
80
+
81
+
::
82
+
83
+
20250319 01:24:10.735000 UTC 35296 TRACE [newConnection] new connection:fd=524 address=127.0.0.1:55297 - TcpServer.cc:62
84
+
20250319 01:24:10.735000 UTC 35296 TRACE [TcpConnectionImpl] new connection:127.0.0.1:55297->127.0.0.1:9960 - TcpConnectionImpl.cc:78
85
+
20250319 01:24:10.735000 UTC 2992 TRACE [operator ()] connectEstablished - TcpConnectionImpl.cc:262
86
+
20250319 01:24:10.735000 UTC 2992 TRACE [onHttpRequest] new request:127.0.0.1:55297->127.0.0.1:9960 - HttpServer.cc:415
87
+
20250319 01:24:10.735000 UTC 2992 TRACE [onHttpRequest] Headers POST /bf/gme/action.php - HttpServer.cc:417
88
+
20250319 01:24:10.735000 UTC 2992 TRACE [onHttpRequest] http path=/bf/gme/action.php - HttpServer.cc:418
89
+
20250319 01:24:11.077000 UTC 2992 TRACE [renderToBuffer] response(no body):HTTP/1.1 200 OK
90
+
content-length: 1135062
91
+
content-type: application/json; charset=utf-8
92
+
server: drogon/1.9.10
93
+
content-encoding: gzip
94
+
date: Wed, 19 Mar 2025 01:24:11 GMT
95
+
96
+
HttpResponseImpl.cc:717
97
+
98
+
You will notice that most of the logs are similar to the previous example, except for the last few lines. The server sends a response back to the
99
+
client with a status code of 200, and the response body is a JSON object with a size of 1135062 bytes. Let's look at ``deploy/log_res`` to see the response log:
100
+
101
+
::
102
+
103
+
deploy/log_res
104
+
├── Uo86DcRh_18_03_2025-21_32_15.json
105
+
├── ...
106
+
107
+
If you followed along and also looked at the most recent request log in ``deploy/log_req``, you will know that ``Uo86DcRh`` is the game request ID
108
+
for the pressing the summon menu button in the game client. Notice that the game response ID is the exact same as the request ID. Let's now open the response log:
109
+
110
+
::
111
+
112
+
{
113
+
"1IR86sAv" : [
114
+
...
115
+
],
116
+
"6FrKacq7" : [
117
+
...
118
+
],
119
+
"IBs49NiH" : [
120
+
...
121
+
],
122
+
"fEi17cnx" : [
123
+
...
124
+
]
125
+
}
126
+
127
+
.. info::
128
+
129
+
See `here <https://github.com/Seltraeh/decompfrontier.github.io/blob/main/source/pages/Tutorial/ProjectOverview.md>`_
130
+
for a list of all currently parsed JSON network keys. This list is not exhaustive, and new keys are added as we decompile more of the game client.
131
+
132
+
Each key of the JSON body is also hashed. In this example, ``1IR86sAv`` is the key representing gatcha information.
133
+
``6FrKacq7`` denotes the signal key, ``IBs49NiH`` is gatcha categories, and ``fEi17cnx`` is the user's current team information.
134
+
The server sends these information to the client, which then updates and displays the gatcha banners accordingly.
0 commit comments