diff --git a/mods/src/misc/misc.c b/mods/src/misc/misc.c index 9fc1eba..0063997 100644 --- a/mods/src/misc/misc.c +++ b/mods/src/misc/misc.c @@ -161,7 +161,7 @@ static void Screen_render_injection(Screen *screen, int32_t param_1, int32_t par // Sanitize Username #define MAX_USERNAME_LENGTH 16 -static void LoginPacket_read_injection(LoginPacket *packet, unsigned char *bit_stream) { +static void LoginPacket_read_injection(LoginPacket *packet, RakNet_BitStream *bit_stream) { // Call Original Method LoginPacket_read_non_virtual(packet, bit_stream); diff --git a/symbols/CMakeLists.txt b/symbols/CMakeLists.txt index 7b84c3e..75341d0 100644 --- a/symbols/CMakeLists.txt +++ b/symbols/CMakeLists.txt @@ -20,15 +20,19 @@ set(SRC src/network/raknet/RakNet_StartupResult.h src/network/raknet/RakNet_RakNetGUID.def src/network/raknet/RakNet_RakPeer.def + src/network/raknet/RakNet_BitStream.def src/network/ServerSideNetworkHandler.def src/network/packet/LoginPacket.def src/network/packet/PlayerEquipmentPacket.def + src/network/packet/SignUpdatePacket.def src/network/packet/Packet.def src/network/packet/StartGamePacket.def src/network/packet/ChatPacket.def src/entity/EntityFactory.def src/entity/PrimedTnt.def + src/entity/CameraEntity.def src/entity/EntityRenderer.def + src/entity/ItemSpriteRenderer.def src/entity/Sheep.def src/entity/PathfinderMob.def src/entity/HumanoidModel.def @@ -48,6 +52,7 @@ set(SRC src/entity/Entity.def src/entity/ItemEntity.def src/entity/Arrow.def + src/entity/Throwable.def src/level/container/FillingContainer.def src/level/container/Container.def src/level/container/ContainerMenu.def @@ -59,6 +64,8 @@ set(SRC src/level/ExternalFileLevelStorageSource.def src/level/Biome.def src/level/ChunkSource.def + src/level/ChunkCache.def + src/level/LightLayer.def src/level/Level.def src/level/LevelRenderer.def src/level/LevelStorageSource.def @@ -72,6 +79,8 @@ set(SRC src/item/AuxDataTileItem.def src/item/ItemInstance.def src/item/Item.def + src/item/ArmorMaterial.def + src/item/ArmorItem.def src/item/TileItem.def src/api/OffsetPosTranslator.def src/api/CommandServer.def @@ -96,6 +105,9 @@ set(SRC src/gui/components/GuiComponent.def src/gui/components/Button.def src/gui/components/Gui.def + src/gui/components/IntRectangle.def + src/gui/components/RectangleArea.def + src/gui/components/ScrollingPane.def src/app-platform/AppPlatform.def src/app-platform/AppPlatform_linux.def src/app-platform/AppPlatform_readAssetFile_return_value.def @@ -124,6 +136,8 @@ set(SRC src/misc/SoundEngine.def src/misc/Common.def src/misc/Config.def + src/misc/Random.def + src/input/IMoveInput.def src/input/IBuildInput.def src/input/MouseBuildInput.def src/input/Mouse.def diff --git a/symbols/src/api/CommandServer.def b/symbols/src/api/CommandServer.def index b975027..950e41a 100644 --- a/symbols/src/api/CommandServer.def +++ b/symbols/src/api/CommandServer.def @@ -1,3 +1,4 @@ method std::string parse(ConnectedClient *client, std::string *command) = 0x6aa8c; -property Minecraft *minecraft = 0x18; \ No newline at end of file +property Minecraft *minecraft = 0x18; +property OffsetPosTranslator pos_translator = 0x1c; diff --git a/symbols/src/api/OffsetPosTranslator.def b/symbols/src/api/OffsetPosTranslator.def index 15d0d43..7278987 100644 --- a/symbols/src/api/OffsetPosTranslator.def +++ b/symbols/src/api/OffsetPosTranslator.def @@ -1 +1,5 @@ method void from(int *x, int *y, int *z) = 0x27c98; + +property float x = 0x4; +property float y = 0x8; +property float z = 0xc; diff --git a/symbols/src/entity/CameraEntity.def b/symbols/src/entity/CameraEntity.def new file mode 100644 index 0000000..6f560af --- /dev/null +++ b/symbols/src/entity/CameraEntity.def @@ -0,0 +1,7 @@ +extends Entity; + +size 0xbe4; +vtable 0x108898; + +// -1 or an entity id +property int tracking_id = 0xbe0; \ No newline at end of file diff --git a/symbols/src/entity/Entity.def b/symbols/src/entity/Entity.def index a004387..096752e 100644 --- a/symbols/src/entity/Entity.def +++ b/symbols/src/entity/Entity.def @@ -1,19 +1,28 @@ +virtual-method void remove() = 0x10; virtual-method void tick() = 0x34; virtual-method bool hurt(Entity *attacker, int damage) = 0xa4; virtual-method int getEntityTypeId() = 0xdc; -method void moveTo(float x, float y, float z, float pitch, float yaw) = 0x7a834; + +method void moveTo(float x, float y, float z, float yaw, float pitch) = 0x7a834; property float x = 0x4; property float y = 0x8; property float z = 0xc; property int id = 0x1c; +property Level *level = 0x24; property float old_x = 0x28; property float old_y = 0x2c; property float old_z = 0x30; +property float vel_x = 0x34; +property float vel_y = 0x38; +property float vel_z = 0x3c; property float yaw = 0x40; property float pitch = 0x44; property float old_yaw = 0x48; property float old_pitch = 0x4c; property float head_height = 0x68; +property float hitbox_width = 0x6c; +property float hitbox_height = 0x70; +property int renderer_id = 0xa8; property bool on_ground = 0xb2; property bool freeze_physics = 0xb9; diff --git a/symbols/src/entity/EntityFactory.def b/symbols/src/entity/EntityFactory.def index 2430dcf..b32cfbc 100644 --- a/symbols/src/entity/EntityFactory.def +++ b/symbols/src/entity/EntityFactory.def @@ -1 +1,2 @@ +// https://mcpirevival.miraheze.org/wiki/Minecraft:_Pi_Edition_Complete_Entity_List shows what id should be static-method Entity *CreateEntity(int id, Level *level) = 0x7d794; diff --git a/symbols/src/entity/EntityRenderDispatcher.def b/symbols/src/entity/EntityRenderDispatcher.def index d811d71..d678fc4 100644 --- a/symbols/src/entity/EntityRenderDispatcher.def +++ b/symbols/src/entity/EntityRenderDispatcher.def @@ -1,2 +1,3 @@ constructor () = 0x6096c; + method void assign(uchar entity_id, EntityRenderer *renderer) = 0x6094c; diff --git a/symbols/src/entity/ItemSpriteRenderer.def b/symbols/src/entity/ItemSpriteRenderer.def new file mode 100644 index 0000000..e01309b --- /dev/null +++ b/symbols/src/entity/ItemSpriteRenderer.def @@ -0,0 +1,5 @@ +extends EntityRenderer; + +size 0x10; + +constructor (int texture) = 0x64078; diff --git a/symbols/src/entity/Mob.def b/symbols/src/entity/Mob.def index 2555e94..c540f84 100644 --- a/symbols/src/entity/Mob.def +++ b/symbols/src/entity/Mob.def @@ -2,6 +2,8 @@ extends Entity; vtable 0x10ad60; +constructor (Level *level) = 0x81b80; + virtual-method void actuallyHurt(int damage) = 0x16c; virtual-method void die(Entity *cause) = 0x130; virtual-method ItemInstance *getCarriedItem() = 0x1ac; diff --git a/symbols/src/entity/Throwable.def b/symbols/src/entity/Throwable.def new file mode 100644 index 0000000..a234f54 --- /dev/null +++ b/symbols/src/entity/Throwable.def @@ -0,0 +1,11 @@ +extends Entity; + +size 0xf4; +vtable 0x10dcb8; +vtable-size 0x13c; + +constructor (Level *level, Entity *thrower) = 0x8ccf0; + +virtual-method void onHit(HitResult *res) = 0x138; + +property int thrower_id = 0xd8; diff --git a/symbols/src/entity/player/LocalPlayer.def b/symbols/src/entity/player/LocalPlayer.def index 4c09db4..b2efcdc 100644 --- a/symbols/src/entity/player/LocalPlayer.def +++ b/symbols/src/entity/player/LocalPlayer.def @@ -2,4 +2,5 @@ extends Player; vtable 0x106230; +property IMoveInput *input = 0xc88; property Minecraft *minecraft = 0xc90; diff --git a/symbols/src/entity/player/Player.def b/symbols/src/entity/player/Player.def index 60cfb6d..87cc8a4 100644 --- a/symbols/src/entity/player/Player.def +++ b/symbols/src/entity/player/Player.def @@ -10,3 +10,4 @@ method ItemInstance *getArmor(int slot) = 0x8fda4; property std::string username = 0xbf4; property Inventory *inventory = 0xbe0; +property bool infinite_items = 0xbff; diff --git a/symbols/src/game/Minecraft.def b/symbols/src/game/Minecraft.def index 18303f7..b6440d8 100644 --- a/symbols/src/game/Minecraft.def +++ b/symbols/src/game/Minecraft.def @@ -1,12 +1,10 @@ vtable 0x102700; -virtual-method void init() = 0x38; method void tickInput() = 0x15ffc; method void setIsCreativeMode(int is_creative) = 0x16ec4; method int isTouchscreen() = 0x1639c; method void setScreen(Screen *screen) = 0x15d6c; method void tick(int param_1, int param_2) = 0x16934; -virtual-method void update() = 0x24; method void hostMultiplayer(int port) = 0x16664; method char *getProgressMessage() = 0x16e58; method uint isLevelGenerated() = 0x16e6c; @@ -14,30 +12,34 @@ method bool isCreativeMode() = 0x17270; method void releaseMouse() = 0x15d30; method void grabMouse() = 0x15d10; method void leaveGame(bool save_remote_level) = 0x15ea0; -virtual-method int handleBack(bool do_nothing) = 0x34; method uchar *getCreator() = 0x17538; method LevelStorageSource *getLevelSource() = 0x16e84; method void handleMouseDown(int param_1, bool can_destroy) = 0x1584c; method void handleBuildAction(uint *build_action_intention) = 0x15920; -virtual-method void selectLevel(std::string *level_dir, std::string *level_name, LevelSettings *settings) = 0x40; method void joinMultiplayer(PingedCompatibleServer *server) = 0x165f4; +virtual-method void update() = 0x24; +virtual-method int handleBack(bool do_nothing) = 0x34; +virtual-method void init() = 0x38; +virtual-method void selectLevel(std::string *level_dir, std::string *level_name, LevelSettings *settings) = 0x40; + property int screen_width = 0x20; property int screen_height = 0x24; -property NetEventCallback *network_handler = 0x174; -property RakNetInstance *rak_net_instance = 0x170; -property Level *level = 0x188; -property Textures *textures = 0x164; -property GameMode *game_mode = 0x160; -property LocalPlayer *player = 0x18c; property Options options = 0x3c; +property LevelRenderer *levelrenderer = 0x150; +property GameMode *game_mode = 0x160; +property Textures *textures = 0x164; +property RakNetInstance *rak_net_instance = 0x170; +property NetEventCallback *network_handler = 0x174; +property Level *level = 0x188; +property Mob *camera = 0x194; +property Gui gui = 0x198; +property LocalPlayer *player = 0x18c; +property Screen *screen = 0xc10; property HitResult hit_result = 0xc38; property int progress = 0xc60; -property CommandServer *command_server = 0xcc0; -property Screen *screen = 0xc10; -property Gui gui = 0x198; -property Mob *pov = 0x150; property PerfRenderer *perf_renderer = 0xcbc; +property CommandServer *command_server = 0xcc0; // Smooth Lighting static-property bool useAmbientOcclusion = 0x136b90; diff --git a/symbols/src/gui/components/IntRectangle.def b/symbols/src/gui/components/IntRectangle.def new file mode 100644 index 0000000..0fbabd4 --- /dev/null +++ b/symbols/src/gui/components/IntRectangle.def @@ -0,0 +1,6 @@ +size 0x10; + +property int x = 0x0; +property int y = 0x4; +property int x_offset = 0x8; +property int y_offset = 0xc; diff --git a/symbols/src/gui/components/RectangleArea.def b/symbols/src/gui/components/RectangleArea.def new file mode 100644 index 0000000..d68dbb7 --- /dev/null +++ b/symbols/src/gui/components/RectangleArea.def @@ -0,0 +1,8 @@ +size 0x18; + +property float x1 = 0x8; +property float x2 = 0xc; +property float y1 = 0x10; +property float y2 = 0x14; + +method bool isInside(float x, float y) = 0x21aa4; diff --git a/symbols/src/gui/components/ScrollingPane.def b/symbols/src/gui/components/ScrollingPane.def new file mode 100644 index 0000000..f1442b8 --- /dev/null +++ b/symbols/src/gui/components/ScrollingPane.def @@ -0,0 +1,16 @@ +extends GuiComponent; + +constructor (int param_2, IntRectangle *bb, IntRectangle *itembb, int columns, int item_count, float scale, IntRectangle *itembb2) = 0x22b44; + +method void setContentOffset(float x, float y) = 0x220a0; +method void render(float param_1, float param_2, float alpha) = 0x22ee4; +method void adjustContentSize() = 0x21aa4; +method bool queryHoldTime(int *item_id, int *pressed_time) = 0x22ab4; + +property float scale = 0x2c; +property RectangleArea area = 0x60; +property Vec3 content_offset = 0xe4; +property float max_y = 0x130; +property float size_y = 0x170; +property float adjust_content_size_y = 0x1ec; + diff --git a/symbols/src/input/IMoveInput.def b/symbols/src/input/IMoveInput.def new file mode 100644 index 0000000..7b24b8b --- /dev/null +++ b/symbols/src/input/IMoveInput.def @@ -0,0 +1 @@ +property bool is_sneaking = 0xe; diff --git a/symbols/src/item/ArmorItem.def b/symbols/src/item/ArmorItem.def new file mode 100644 index 0000000..bc7749a --- /dev/null +++ b/symbols/src/item/ArmorItem.def @@ -0,0 +1,5 @@ +extends Item; + +size 0x34; + +constructor (int id, ArmorMaterial *material, int param_3, int slot) = 0x9362c; diff --git a/symbols/src/item/ArmorMaterial.def b/symbols/src/item/ArmorMaterial.def new file mode 100644 index 0000000..82bfe2a --- /dev/null +++ b/symbols/src/item/ArmorMaterial.def @@ -0,0 +1,13 @@ +size 0x14; + +property int health_for_slot_multiplier = 0x0; +property int feet_protection = 0x4; +property int leg_protection = 0x8; +property int body_protection = 0xc; +property int head_protection = 0x10; + +static-property ArmorMaterial cloth = 0x17a780; +static-property ArmorMaterial chain = 0x17a794; +static-property ArmorMaterial iron = 0x17a7a8; +static-property ArmorMaterial gold = 0x17a7bc; +static-property ArmorMaterial diamond = 0x17a7d0; diff --git a/symbols/src/item/Item.def b/symbols/src/item/Item.def index aff1010..6c70872 100644 --- a/symbols/src/item/Item.def +++ b/symbols/src/item/Item.def @@ -14,10 +14,13 @@ virtual-method void setDescriptionId(std::string *name) = 0x6c; virtual-method std::string getDescriptionId(ItemInstance *item_instance) = 0x7c; property int id = 0x4; -property bool is_stacked_by_data = 0x19; -property int category = 0x10; property int max_damage = 0x8; +property int texture = 0xc; +property int category = 0x10; property int max_stack_size = 0x14; +property bool equipped = 0x18; +property bool is_stacked_by_data = 0x19; +property std::string description_id = 0x20; // Globals static-property-array Item *items = 0x17b250; diff --git a/symbols/src/level/ChunkCache.def b/symbols/src/level/ChunkCache.def new file mode 100644 index 0000000..599ce3f --- /dev/null +++ b/symbols/src/level/ChunkCache.def @@ -0,0 +1,3 @@ +extends ChunkSource; + +vtable 0x10fbc0; diff --git a/symbols/src/level/ChunkSource.def b/symbols/src/level/ChunkSource.def index 4c8f80c..64aa224 100644 --- a/symbols/src/level/ChunkSource.def +++ b/symbols/src/level/ChunkSource.def @@ -1 +1,3 @@ +vtable 0x10fb88; + virtual-method void postProcess(ChunkSource *chunk_source, int chunk_x, int chunk_y) = 0x14; diff --git a/symbols/src/level/Level.def b/symbols/src/level/Level.def index 5923df7..0411c97 100644 --- a/symbols/src/level/Level.def +++ b/symbols/src/level/Level.def @@ -4,10 +4,17 @@ vtable 0x108de0; method void saveLevelData() = 0xa2e94; method void setTileAndData(int x, int y, int z, int id, int data) = 0xa38b4; +method void setTileAndDataNoUpdate(int x, int y, int z, int id, int data) = 0xa33d0; method HitResult clip(uchar *param_1, uchar *param_2, bool clip_liquids, bool param_3) = 0xa3db0; method void addParticle(std::string *particle, float x, float y, float z, float deltaX, float deltaY, float deltaZ, int count) = 0xa449c; method Entity *getEntity(int id) = 0xa45a4; method bool addEntity(Entity *entity) = 0xa7cbc; +method int getBrightness2(LightLayer *layer, int x, int y, int z) = 0xa3c70; +method void playSound(Entity *entity, std::string *name, float volume, float pitch) = 0xa42a8; + +virtual-method void tick() = 0x28; +virtual-method void updateSleepingPlayerList() = 0x2c; +virtual-method ChunkCache *createChunkSource() = 0x30; -property std::vector players = 0x60; property std::vector entities = 0x20; +property std::vector players = 0x60; diff --git a/symbols/src/level/LevelSource.def b/symbols/src/level/LevelSource.def index ff7a855..e9162c2 100644 --- a/symbols/src/level/LevelSource.def +++ b/symbols/src/level/LevelSource.def @@ -1,3 +1,8 @@ virtual-method int getTile(int x, int y, int z) = 0x8; +virtual-method int isEmptyTile(int x, int y, int z) = 0xc; +virtual-method int getBrightness(int x, int y, int z) = 0x10; +virtual-method int getData(int x, int y, int z) = 0x14; virtual-method Material *getMaterial(int x, int y, int z) = 0x18; -virtual-method Biome *getBiome(int x, int z) = 0x24; \ No newline at end of file +virtual-method bool isSolidRenderTile(int x, int y, int z) = 0x1c; +virtual-method bool isSolidBlockingTile(int x, int y, int z) = 0x20; +virtual-method Biome *getBiome(int x, int z) = 0x24; diff --git a/symbols/src/level/LightLayer.def b/symbols/src/level/LightLayer.def new file mode 100644 index 0000000..0368ab1 --- /dev/null +++ b/symbols/src/level/LightLayer.def @@ -0,0 +1,2 @@ +static-property LightLayer *block = 0x17be94; +static-property LightLayer *sky = 0x17be90; diff --git a/symbols/src/level/container/FillingContainer.def b/symbols/src/level/container/FillingContainer.def index ed6e0f5..79a69c6 100644 --- a/symbols/src/level/container/FillingContainer.def +++ b/symbols/src/level/container/FillingContainer.def @@ -1,13 +1,20 @@ extends Container; method void addItem(ItemInstance *item_instance) = 0x92aa0; -virtual-method bool add(ItemInstance *item_instance) = 0x30; method void clearSlot(int slot) = 0x922f8; method void release(int slot) = 0x92058; method void compressLinkedSlotList(int slot) = 0x92280; method ItemInstance *getLinked(int slot) = 0x92230; +method bool linkEmptySlot(int slot) = 0x92590; +method int getFreeSlot() = 0x91ffc; +method int getSlot(int id) = 0x91ce0; +method int linkSlot(int linked_slot, int unlinked_slot, bool push_aside) = 0x92188; + virtual-method ItemInstance *getItem(int pos) = 0x8; +virtual-method void setItem(int pos, ItemInstance *item) = 0xc; +virtual-method bool add(ItemInstance *item_instance) = 0x30; property int *linked_slots = 0xc; property int linked_slots_length = 0x14; +property std::vector items = 0x18; property bool is_creative = 0x24; diff --git a/symbols/src/level/container/Inventory.def b/symbols/src/level/container/Inventory.def index 45e1d5c..1108f0b 100644 --- a/symbols/src/level/container/Inventory.def +++ b/symbols/src/level/container/Inventory.def @@ -1,6 +1,9 @@ extends FillingContainer; method void selectSlot(int slot) = 0x8d13c; +// It's just FillingContainer_getLinked but with selectedSlot as slot method ItemInstance *getSelected() = 0x8d134; +// It's just FillingContainer_linkSlot with selectedSlot as linked_slot +method bool moveToSelectedSlot(int unlinked_slot, bool push_aside) = 0x8d148; property int selectedSlot = 0x28; diff --git a/symbols/src/misc/Random.def b/symbols/src/misc/Random.def new file mode 100644 index 0000000..5ceca14 --- /dev/null +++ b/symbols/src/misc/Random.def @@ -0,0 +1,3 @@ +method int genrand_int32() = 0x42cf8; + +static-property Random random = 0x17a87c; diff --git a/symbols/src/misc/Tesselator.def b/symbols/src/misc/Tesselator.def index af9c4f1..dbe8612 100644 --- a/symbols/src/misc/Tesselator.def +++ b/symbols/src/misc/Tesselator.def @@ -2,3 +2,5 @@ method void begin(int mode) = 0x529d4; method void colorABGR(int color) = 0x52b54; method void color(int r, int g, int b, int a) = 0x52a48; method void vertexUV(float x, float y, float z, float u, float v) = 0x52d40; + +static-property Tesselator instance = 0x137538; diff --git a/symbols/src/network/NetEventCallback.def b/symbols/src/network/NetEventCallback.def index b5a29c5..c8b7eeb 100644 --- a/symbols/src/network/NetEventCallback.def +++ b/symbols/src/network/NetEventCallback.def @@ -1,2 +1,3 @@ virtual-method void onDisconnect(RakNet_RakNetGUID *guid) = 0x18; +virtual-method void handle_SignUpdatePacket(RakNet_RakNetGUID *guid, SignUpdatePacket *packet) = 0xcc; virtual-method void handle_ChatPacket(RakNet_RakNetGUID *rak_net_guid, uchar *packet) = 0xc8; diff --git a/symbols/src/network/packet/Packet.def b/symbols/src/network/packet/Packet.def index abfa163..bcc587c 100644 --- a/symbols/src/network/packet/Packet.def +++ b/symbols/src/network/packet/Packet.def @@ -1,2 +1,8 @@ constructor () = 0x6fc18; -virtual-method void read(uchar *bit_stream) = 0xc; +size 0x10; +vtable 0x1024d8; +vtable-size 0x14; + +virtual-method void write(RakNet_BitStream *bit_stream) = 0x8; +virtual-method void read(RakNet_BitStream *bit_stream) = 0xc; +virtual-method void handle(RakNet_RakNetGUID *guid, NetEventCallback *callback) = 0x10; diff --git a/symbols/src/network/packet/SignUpdatePacket.def b/symbols/src/network/packet/SignUpdatePacket.def new file mode 100644 index 0000000..20665c2 --- /dev/null +++ b/symbols/src/network/packet/SignUpdatePacket.def @@ -0,0 +1,7 @@ +extends Packet; + +property int x = 0xc; +property int y = 0x10; +property int z = 0x14; +// std::string lines[4] +property std::string *lines = 0x18; diff --git a/symbols/src/network/raknet/RakNet_BitStream.def b/symbols/src/network/raknet/RakNet_BitStream.def new file mode 100644 index 0000000..570c3be --- /dev/null +++ b/symbols/src/network/raknet/RakNet_BitStream.def @@ -0,0 +1,4 @@ +method void Write_uchar(uchar *i) = 0x18448; +method void Write_int(int *i) = 0x18454; + +method void Read_int(int *i) = 0x184ec;