Page MenuHomeFeedback Tracker

Documentation For a2s_rules & Protocol
Assigned, UrgentPublic

Description

Hello, can someone please offer documentation on the server browser protocol for DAYZ as has been done here for ARMA2?

I have a lot of it figured out, but there are some parts that I am still unable to decipher.

For instance, I am decoding the 3rd mod of a server and get back "\xEA\xF6\xD6\x3A\x04\xB8\x01\x02\x67\x6F\x13\x5B\x43\x72\x53\x6B\x5D\x20\x42\x4D\x57\x20\x35\x32\x35\x69\x20\x45\x33\x34".

The breakdown I have so far that is in question:
Mod Hash: \xEA\xF6\xD6\x3A
Steam ID Length: \x04
Steam ID: \xB8\x01\x02\x67 <--- But this is incorrect!
???: \x6F <--- Seems to be an extra byte not on other mods.
Mod Name Length: \x13
Mod Name: \x5B\x43\x72\x53\x6B\x5D\x20\x42\x4D\x57\x20\x35\x32\x35\x69\x20\x45\x33\x34

For the starting sequence "\x45\x19\x00\x01\x11\x00\x01\x01\x01\x02\x01\x02\x01\x02":
Header: \x45
Number of Rules: \x19
Terminator?: \x00
x of n??: \x01\x11
Magic Sequence?: \x00\x01\x01\x01\x02\x01\x02\x01\x02

I have not made time to look further, but if someone could help by providing a clear explanation or some docs, that would be super useful thanks!

Also, what sort of hashing is used? I have tried all variants of 32 bit hashing I can think of with and without the hash block. Below is a list I have tried minus the ones that dont produce a 32bit hash.

md5, sha1, sha224, sha256, sha384, sha512, ripemd128, ripemd160, ripemd256, ripemd320, whirlpool, tiger128,3, tiger160,3, tiger192,3, tiger128,4, tiger160,4, tiger192,4, snefru, snefru256, gost, gost-crypto, adler32, crc32, crc32b, fnv132, fnv1a32, fnv164, fnv1a64, joaat, haval128,3, haval160,3, haval192,3, haval224,3, haval256,3, haval128,4, haval160,4, haval192,4, haval224,4, haval256,4, haval128,5, haval160,5, haval192,5, haval224,5, haval256,5.

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
General

Event Timeline

p4k1tz created this task.Feb 5 2023, 12:00 AM
p4k1tz updated the task description. (Show Details)
p4k1tz updated the task description. (Show Details)
p4k1tz added a comment.EditedFeb 5 2023, 12:14 AM
This comment has been deleted.
p4k1tz added a comment.EditedFeb 5 2023, 12:15 AM
This comment has been deleted.
p4k1tz updated the task description. (Show Details)Feb 5 2023, 12:46 AM
p4k1tz updated the task description. (Show Details)
Geez changed the task status from New to Need More Info.Feb 6 2023, 11:57 AM
Geez added a subscriber: Geez.

Hello p4k1tz.
Is there any relevant reason why do you need to know this information?

p4k1tz added a comment.Feb 6 2023, 2:11 PM

Hello p4k1tz.
Is there any relevant reason why do you need to know this information?

Hello Geez,

I am building a launcher that will be faster than the vanilla DayZ launcher and one that is not biased like other launchers. The real need here is to not put the burden of having an additional API on the gamservers who want to show up in this launcher (potential avenue of attack), and allow Nitrado or other managed servers to show up in the list (since the owner does not have access to install such an API).

I am willing to accept that this protocol changes and thus I may need to picot in the future, but having an initial understanding or explanation from BI in this case would be useful.

Geez added a comment.Feb 6 2023, 3:32 PM

Hello again,

According to the devs:
https://developer.valvesoftware.com/wiki/Server_queries

It's just 1b header + long challenge, then some data if challenge is in incoming message - otherwise 1b header + int16 rules count and list of rules - which is as in steam documentation.

p4k1tz added a comment.Feb 6 2023, 3:54 PM

Hello again,

According to the devs:

https://developer.valvesoftware.com/wiki/Server_queries

It's just 1b header + long challenge, then some data if challenge is in incoming message - otherwise 1b header + int16 rules count and list of rules - which is as in steam documentation.

Hey Geez,

Thanks for the response, I will double check the information above and write my own a2s implementation to be sure the data is as expected. From there I will come back with any questions. One question now though if you have the time. What I am interested in is the rule value format, and with that being said, there is no specification from valve on what data is contained within that rule. I believe the data is up to the game developer, and has been truncated by BI to save space. My initial request was to get information on what each byte of the rule value was. Could you maybe run that by the developers to see if they could provide that?

Again, thanks so much for taking time out of your day.

p4k1tz added a comment.EditedFeb 6 2023, 5:23 PM

Above is an example response that can be used as a reference. Between offsets 0x0000002E and 0x00000032 should be the steam ID of the mod. But Offset 0x0000002D describes the steam ID length being 4 byes. 2E through 31 are not the correct steam ID, and neither is 2E through 32. I can only assume one of these bytes is a modifier for the steam ID, is corrupt, etc.

Thank you for your consideration.

p4k1tz added a comment.Feb 9 2023, 3:04 PM

@Geez Any new information?

Geez added a comment.Feb 10 2023, 9:19 AM

unfortunately no new information I can provide at the moment as the devs will have to dig deeper into this.

Geez changed the task status from Need More Info to Assigned.Feb 10 2023, 9:19 AM
raxto added a subscriber: raxto.Feb 12 2023, 12:45 PM

@Geez Battlemetrics have same problem to decode A2S_RULES correctly in some cases.

@Geez Any new information?

@Geez Battlemetrics have same problem to decode A2S_RULES correctly in some cases.

I believe the protocol used was recently updated which is why others are experiencing this as well. I have resorted to looking at this section at a bit level and found huge similarities with the first couple of bytes and only a single or couple 1's in up to the last 3 bytes. I am assuming that the length of the serial is used in conjunction with a comparison of the bits in each byte after. If certain bits are set, do some math and move on. Possibly a comparison of the absolute max int ID.

@Geez Has this question been passed to anyone for a potential answer?

Geez added a comment.Feb 16 2023, 9:11 AM

Hello p4k1tz.
Due to the current priorities with the release and possible hotfix, we cannot address this immediately. I will let you know if there are any new developments.

Hello p4k1tz.
Due to the current priorities with the release and possible hotfix, we cannot address this immediately. I will let you know if there are any new developments.

@Geez how about now?

sileed added a subscriber: sileed.Mar 11 2023, 2:10 AM