Getting Raw Packet Data in 1.7.10

Discussion in 'Plugin Development' started by fishbucket, Oct 20, 2020.

  1. Offline

    fishbucket

    Hello, currently I am trying to get raw packet data in version 1.7.10 bukkit. When I reflect the channel at
    Code:
    ((CraftPlayer) player).getHandle().playerConnection.networkManager.getClass().getDeclaredField("m");
    and add my handler to the pipeline, the handler simply gives a packet object that only contains the timestamp of when the packet was received. Is there any way I could get other information directly from the packet object?
     
  2. Online

    timtower Moderator Moderator

    @fishbucket What do you want to do? Why do you want to get that data?
     
  3. Offline

    fishbucket

    I am trying to develop an anti-cheat that works off neural networks, I need a dataset to train the neural network. I already have a deal with someone who is willing to install the plugin, and a capable enough database to store all the data. I don't want to use a packet-sniffer because I will have to sort out other connections.
     
  4. Online

    timtower Moderator Moderator

    @fishbucket What data are you looking for then? Have you considered ProtocolLib?
     
  5. Offline

    fishbucket

    I want to log all of the data being sent between the client and the server. Also, I thought protocollib can only intercept outgoing packets and rewrite them.
     
  6. Online

    timtower Moderator Moderator

  7. Offline

    fishbucket

    I looked into that and they are using PacketRegistry.getClientPacket(). The set that the function returns is empty. I have tried setting it to a while loop to keep reading the set but that set stays empty even with a player on the server.
     
  8. Online

    timtower Moderator Moderator

  9. Offline

    fishbucket

    @timtower Hello, sorry for the late response. That didn't work. I believe it may be either because all the constructors of the ListenerWhitelist class are deprecated, or that Protocollib never released a version for 1.7.10. What I mean is that Protocollib only supports 1.8 and above, and 1.7 and below. After digging deeper into the source code, I found some comments mentioning he meant 1.7.1-pre and below. 1.7.1-pre uses Minecraft Protocol version 3 and 1.8 uses Minecraft Protocol version 47. My target version, 1.7.10 uses Minecraft Protocol version 5, which is unsupported by protocol lib.
     
    Last edited: Oct 26, 2020
  10. Offline

    fishbucket

  11. Offline

    fishbucket

Share This Page