LiveOverflow / minecraft-hacked

Minecraft:Hacked is a video series exploring various technical areas of Minecraft.
209 stars 12 forks source link

How do I unpack packets with arrays in them? #9

Closed Lilyp3892 closed 2 years ago

Lilyp3892 commented 2 years ago

Hi, I am trying to unpack downstream_entity_equipment which uses an array: https://wiki.vg/Protocol#Entity_Equipment I am trying to use Struct to unpack It but I am struggling. Here is some code using Struct to unpack upstream_player_look: xXkAg_OhTlGoOFGgLZL7pg this makes it readable instead of just hex code. I am trying to do a similar thing, but with downstream_entity_equipment: Screenshot_5

you can see where I am having trouble, trying to use https://docs.python.org/3/library/struct.html#format-characters

I am new to packet handling and would love some help understanding it better

If anyone can help me out it would be greatly appreciated! <3

P.S. This is a duplicate of https://github.com/barneygale/quarry/issues/146, and I will mark both as closed if I get a working answer from either post

kolatra commented 2 years ago

Did you find a solution to this?

Lilyp3892 commented 2 years ago

Did you find a solution to this?

Yes

kolatra commented 2 years ago

What did you go with? I've been wondering about this myself.

Lilyp3892 commented 2 years ago

What did you go with? I've been wondering about this myself.

Sorry for responding so late check out the solution to this