1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Getting list of all/total MCPE packets?

Discussion in 'Development' started by xBeastMode, Dec 17, 2016.

  1. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    Just as the title queries, how do you get the list of all/total packets available in MCPE and how would you see the order in which you encode/decode the packet?
    If you're wondering the reason of why i want to do this; this is for plugin having to do with packets, but I need to find out how to get the packets first. As you may know, pocketmine does not have all the possibilities of an MCPE server implemented, so while they implement them I can approach them first. I know not everything has to do with packets but I still wanna know how to get them. Thanks. :)
     
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Read the classes in pocketmine\network\protocol namespace. All standard packets from MCPE should have already been added in this namespace. If they are not added, blame @dktapps
    (I can see @dktapps excusing that they are not being used hence no need to add them)
     
    applqpak likes this.
  3. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    Oh, but I still wanna know how to get them and the order of encode/decode. Also, is there a chance to create one's own packets?
     
  4. KnownUnown

    KnownUnown Spider Jockey Poggit Reviewer

    Messages:
    47
    GitHub:
    knownunown
    They're right there in pocketmine\network\protocol. Look at the encode() and decode() functions to see the order of the fields. Creating packets that don't already exist in MCPE (that the client would be able to parse) is impossible, if that's what you meant by "creating one's own packets". If you wanted to add packets that didn't exist in PM yet to PM, look at how the Network class does it. Have fun! :)

    EDIT: if you want to get ALL the packets in MCPE, you've to delve into MCPE disassembly. Isn't very fun.
     
    SOFe and applqpak like this.
  5. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    I know that they're already in pocketmine\network\protocol but I wanna know how they found those packets. I read before that they're in "libminecraftpe.so" before.
     
  6. KnownUnown

    KnownUnown Spider Jockey Poggit Reviewer

    Messages:
    47
    GitHub:
    knownunown
    They are in libminecraftpe.so. You've to extract it from the APK and use objdump or some other tool to dump the assembly. Then you've to find the packets in the assembly and reverse engineer what the encode and decode functions are doing.
     
    SOFe, applqpak, Muqsit and 1 other person like this.
  7. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    In addition to the fun of disassembly reverse-engineering, the time that it costs makes me believe that we don't want more than a few people in the community responsible for doing it. Such work just stops all development every time there is an update.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.