How does FiveM work? Advice needed on udp packets payload

I was looking at the udp packets that my GTA-V receives and found myself on a mission to decode the payload of those packets. I ended up here, downloaded the sources and got lost in the woods…

I was wondering, does FiveM use the same communication protocol as the original? Does FiveM work on the packet level?

if so, which files in the sources should I look at to get some hints on decoding the udp packets contents that I receive on port 6672?

For example:
00e9071082feb8cb0ce1f76b65d31b1b2cf0223d5fb6a15dfe8adff77e2cbd2c54bb7db2ae98ff4e3e128fa26f

Thanks a lot for pointing me in some direction!

We actually don’t typically use the same packet format as the base game.

In addition to that, base GTAV/RDR2 game packets are encrypted with a key exchange sequence with the initial key received during matchmaking which is itself encrypted with a key from a public-key-pinned HTTPS connection, if you don’t have memory read access to the game at the time you’re doing a packet capture you won’t be able to decrypt the contents at all, and I think since the most recent networking framework update the key exchange can’t be intercepted other than MITMing at that specific point in time, so you really need to get the real key for a specific peer from game memory.

1 Like

Thanks! That was very helpfull and saves me a ton of time in digging through the (huge) FiveM code looking for what is not there.

I’m actually looking for a way to display some more information about other players in my session (IP, game location, nickname, etc.). The IP part was simple but my package inspection quest seems to come to a dead end here.

I may be wat off topic here for this forum but what would you suggest to do so in an online session to make a list of player names, ip and in-game-location (read only)? I’m on the same machine, so I have memory access. (Not looking to get banned by using mods). I did look at that some time ago and did not find something that I could really build on. So any advice on this is very welcome. Even some keywords that I can search for would be helpfull (thats how I ended up here yesterday and found this amazing project).

The following natives will help:
GetPlayerIdentifier
GetEntityCoords

What @ChieF-TroN said. It sounds like you just want to grab some info from the game, which is exactly what the natives are for; much simpler than the approach you are taking, unless I’m misunderstanding your end-goal.

You can find all the natives here:

And you can find information on how to create a resource to use them here:

https://docs.fivem.net/docs/scripting-manual/introduction/

That sounds like exactly what I am looking for. Just display some data. But on the official gta servers, not the FiveM servers. I came here because I thought you guys had info on the udp packet contents because it looked easier/morestable than the memory read vector.

At this point I am not sure if the Native stuff helps me with accessing this data on a online session on the offficial rockstart servers. I dont want to get banned. But I keep on reading the links. Thanks!

Ow and thanks a lot because I consider my question a bit out of scope for this forum!

Not the case at all, and you still need to actually read keys from memory to be able to read any of the packet data. The keys are stored right next to the player names and addresses in fact so by that point you can just as well read the data directly.

Yeah, its actually works. I use cheat engine to search my username and found some xml format data in front of my username, which record the “sessionKey” encoded with base64, 16 bytes. If this is the key to encrypt udp packets, then what is the encryption algorithm? I thought it might be some stream cipher instead of block cipher, like RC4. But I am not sure.

Couldn^t connect Failed to get info from server (tried 3 times).

If you are the server owner, are you sure you are allowing UDP packets to and from the server?

:What is the problem? Every time I open other files it says something like this. What is the problem? Help. I hope someone responds quickly.

strong text

Couldn^t connect Failed to ge

t info from server (tried 3 times).

If you are the server owner, are you sure you are allowing UDP packets to and from the server?

:What is the problem? Every time I open other files it says something like this. What is the problem? Help. I hope someone responds quickly.