Hi guys I am trying to upgrade from v83 to V95.
I understand there's 500+ guides on IDA(s) however they really never get into or explain how they get the structure of the packet, unless I am too stupid ,which is probably the case.
I am talking about how in handlers or MaplePacketCreater how you either extract or send packets from/to the client.
Such as:
if receiving a packet from the client.
int x = slea.readInt()
int y = slea.readByte()
If sending a packet to the client.
mplew.write(x)
mplew.writeShort(y)
I want to know how you guys know the order of which byte/short/int to write or receive it in.
also how do you know if the packet is either being received or sent?
I am using the v95 leak and understand how to obtain packet headers which is the easy part (yeah me!). Like how header of packets can change I am sure the packet structure can change? Due to adding more information, took away some things, etc.
Here is where I am stuck. I'll explain my process all the way through to where I am stuck.
I open up v95, the ida. For conversation sake lets say I want to update my Inventory_Operation.
Currently at v83 at 0x1D
Lets try looking for Inventory_Operation in the IDA.
https://ibb.co/Sxd1wcF//Image to follow along.
Okay, its found in CWvsContext__OnPacket and its invoked when 0x1C is passed in. Thus 0x1C is the packet header for Inventory Operation. Fantastic.
Now we can change 0x1D to 0x1C so it went down. Guess a good thing to keep in mind.
However thats not it, what if the packet structure change?
If we look in the current v83 how packets are sent in the InventoryOperation:
How do I know it will be likeCode:public static byte[] modifyInventory(boolean updateTick, final List<ModifyInventory> mods) { final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(); mplew.writeShort(SendOpcode.INVENTORY_OPERATION.getValue()); mplew.writeBool(updateTick); mplew.write(mods.size()); //mplew.write(0); v104 :) int addMovement = -1; for (ModifyInventory mod : mods) { mplew.write(mod.getMode()); mplew.write(mod.getInventoryType()); mplew.writeShort(mod.getMode() == 2 ? mod.getOldPosition() : mod.getPosition()); switch (mod.getMode()) { case 0: {//add item addItemInfo(mplew, mod.getItem(), true); break; } case 1: {//update quantity mplew.writeShort(mod.getQuantity()); break; } case 2: {//move mplew.writeShort(mod.getPosition()); if (mod.getPosition() < 0 || mod.getOldPosition() < 0) { addMovement = mod.getOldPosition() < 0 ? 1 : 2; } break; } case 3: {//remove if (mod.getPosition() < 0) { addMovement = 2; } break; } } mod.clear(); } if (addMovement > -1) { mplew.write(addMovement); } return mplew.getPacket(); }
and not something likeCode:mplew.writeShort(SendOpcode.INVENTORY_OPERATION.getValue()); mplew.writeBool(updateTick); mplew.write(mods.size());
I somewhere read that the stucutre can be read in the method being invoked(CWvsContext::OnInventoryOperation) but when I open it there's unnamed variables but it has something to do with decode1-4, where decode 1 = byte decode 2 = short and etc but I still dont see itCode:mplew.writeShort(SendOpcode.INVENTORY_OPERATION.getValue()); mplew.writeBool(updateTick); mplew.writeInt(mods.size()); //From a byte to an Int
TL;DR: I need to know how to obtain the structure of the packet within the iDA


Reply With Quote

