Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pmmp/bedrockprotocoldumper
Generate basic information about new protocol versions from BDS using Python and GNU objdump
https://github.com/pmmp/bedrockprotocoldumper
Last synced: 3 months ago
JSON representation
Generate basic information about new protocol versions from BDS using Python and GNU objdump
- Host: GitHub
- URL: https://github.com/pmmp/bedrockprotocoldumper
- Owner: pmmp
- License: mit
- Created: 2022-03-31T18:46:41.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-05T18:39:30.000Z (9 months ago)
- Last Synced: 2024-09-26T09:43:35.160Z (3 months ago)
- Language: Python
- Size: 21.5 KB
- Stars: 12
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BedrockProtocolDumper
Generate basic information about new protocol versions from BDS using Python and GNU objdump## Requirements
- `sudo apt install binutils`
- `python2`
- A local clone of [BedrockProtocol](https://github.com/pmmp/BedrockProtocol)
- An x86_64 Linux binary of [Bedrock Dedicated Server](https://minecraft.net/download/server/bedrock)## Usage
`python2 protocol_info_generator_objdump.py `## How does it work?
`protocol_info_generator_objdump` uses [GNU objdump](https://en.wikipedia.org/wiki/Objdump) to extract basic protocol information about a new version of Minecraft from [Bedrock Dedicated Server](https://minecraft.net/download/server/bedrock), including the following:
- Current version (major.minor.patch)
- Whether or not this version is a beta
- Current protocol version
- List of packet IDsThe script currently patches the following files:
- [`ProtocolInfo`](https://github.com/pmmp/BedrockProtocol/blob/a6ccf863a858caa0cf0a322433f8a17d14ee640a/src/ProtocolInfo.php)
- [`PacketPool`](https://github.com/pmmp/BedrockProtocol/blob/a6ccf863a858caa0cf0a322433f8a17d14ee640a/src/PacketPool.php)
- [`PacketHandlerInterface`](https://github.com/pmmp/BedrockProtocol/blob/a6ccf863a858caa0cf0a322433f8a17d14ee640a/src/PacketHandlerInterface.php)
- [`PacketHandlerDefaultImplTrait`](https://github.com/pmmp/BedrockProtocol/blob/a6ccf863a858caa0cf0a322433f8a17d14ee640a/src/PacketHandlerDefaultImplTrait.php)It will also generate stub classes for any new packets found.
## FAQ
### Can this find packet fields automatically?
No. It can only find some basic information like packet IDs and their associated names.
Unfortunately, the compiled server doesn't retain any information about the names of struct fields, so the fields still have to be reverse-engineered manually.### Can I use this to generate stuff for other projects?
In theory, yes. Since this tool essentially just requires a list of known packet names, their IDs, and some version info, it should be easily possible to alter the scripts to generate similar code for another project.