Are you done with packet editors spamming **** in your server, duping items, dc'ing maps or even worlds?
If you are, this thread might be something for you.
I have been working on this database for a bit now and it's basically a collection of all packets that are commonly used to annoy you to the limits and the way to patch them.
I decided to call it the Anti-packet database, and no, I don't know why, so shut up about it.
If you have any packets that you want to be patched leave them in a comment and i'll try to look at it when I have time.
The packets included in this thread are from v75.
Enjoy.
Green = optional
Purple = location
Grayish = extra info
Red = pay attention
Most of the spam packets are actually already patched in most servers.
The way to patch them is logging how big the delay is between the latest used feature and the one you're using now.
This is done using a public long(currenttimemillis is a long) which imma call latestUse.
(Super)Megaphone spamming
Packet used :
PHP:
4E 00 02 00 80 64 4D 00 07 00 4D 75 61 68 61 68 61 01 44 42 61 0B
Patch :
MapleCharacter.java
Add :
Code:
public long latestUse = 0;
Code:
private MonsterBook monsterbook;
UseCashItemHandler.java
Add :
Code:
if ((System.currentTimeMillis() - c.getPlayer().latestUse) > 750) {
Code:
[COLOR="SlateGray"]case 1: // Megaphone(in case you can't find it)[/COLOR]
if (player.getLevel() > 9)
Code:
c.getPlayer().latestUse = System.currentTimeMillis();
} [COLOR="YellowGreen"]else {
c.getPlayer().ban("Autoban '" + c.getPlayer().getName() + "': Packet Editing (Spamming smegas)", true);
}[/COLOR]
Code:
player.getClient().getChannelServer().broadcastPacket(MaplePacketCreator.serverNotice(2, medal + player.getName() + " : " + slea.readMapleAsciiString()));
(for supermegaphones) add :
Code:
if ((System.currentTimeMillis() - c.getPlayer().latestUse) > 750) {
Code:
case 2: // Super megaphone
Code:
c.getPlayer().latestUse = System.currentTimeMillis();
} [COLOR="YellowGreen"]else {
c.getPlayer().ban("Autoban '" + c.getPlayer().getName() + "': Packet Editing (Spamming smegas)", true);
} [/COLOR]
Code:
c.getChannelServer().getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(3, c.getChannel(), medal + player.getName() + " : " + slea.readMapleAsciiString(), (slea.readByte() != 0)).getBytes());
(for MapleTV) add :
Code:
if ((System.currentTimeMillis() - c.getPlayer().latestUse) <= 750) {
c.getPlayer().ban("Autoban '" + c.getPlayer().getName() + "': Packet Editing (Spamming smegas)", true);
}
Code:
case 5: // Maple TV
Code:
c.getPlayer().latestUse = System.currentTimeMillis();
Code:
break;
[COLOR="SlateGray"]case 6: //item megaphone[/COLOR]
(for item megaphones) add :
Code:
if ((System.currentTimeMillis() - c.getPlayer().latestUse) > 750) {
Code:
case 6: //item megaphone
Code:
c.getPlayer().latestUse = System.currentTimeMillis();
} [COLOR="yellowgreen"]else {
c.getPlayer().ban("Autoban '" + c.getPlayer().getName() + "': Packet Editing (Spamming smegas)", true);
}[/COLOR]
Code:
c.getChannelServer().getWorldInterface().broadcastMessage(null, MaplePacketCreator.itemMegaphone(msg, whisper, c.getChannel(), item).getBytes());
(for triples, pfft...) add :
Code:
if ((System.currentTimeMillis() - c.getPlayer().latestUse) > 750) {
Code:
case 7: //triple megaphone
Code:
c.getPlayer().latestUse = System.currentTimeMillis();
} [COLOR="YellowGreen"]else {
c.getPlayer().ban("Autoban '" + c.getPlayer().getName() + "': Packet Editing (Spamming smegas)", true);
}[/COLOR]
Code:
c.getChannelServer().getWorldInterface().broadcastMessage(null, MaplePacketCreator.getMultiMegaphone(msg2, c.getChannel(), whisper).getBytes());
Summoning bag spamming
Packet used :
PHP:
4A 00 EF E8 5E 00 1D 00 93 0F 20 00
Patch :
UseSummonBag.java
Add :
Code:
if (System.currentTimeMillis() - c.getPlayer().latestUse > 100) {
Code:
if (toUse != null && toUse.getQuantity() > 0 && toUse.getItemId() == itemId) {
Code:
c.getPlayer().latestUse = System.currentTimeMillis();
Code:
c.getPlayer().getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(toSpawnChild[0]), c.getPlayer().getPosition());
Code:
} [COLOR="YellowGreen"]else {
c.getPlayer().ban("Autoban '" + c.getPlayer().getName() + "': Packet Editing (Spamming summoningbags)", true);
c.getPlayer().getMap().killAllMonsters();
}[/COLOR]
Code:
for (int z = 0; z < toSpawn.length; z++) {
int[] toSpawnChild = toSpawn[z];
if (Randomizer.getInstance().nextInt(101) <= toSpawnChild[1])
c.getPlayer().getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(toSpawnChild[0]), c.getPlayer().getPosition());
c.getPlayer().latestUse = System.currentTimeMillis();
}
Playercommand spamming
For the packet just use a playercommand and log it.
Patches :
I don't really know what playercommands you are willing to protect, but you can always go with the standard method of latestUse :
Code:
} else if (splitted[0].equals("[COLOR="YellowGreen"]whatevercommandyou'regoingtobeusing[/COLOR]")) {
if ((System.currentTimeMillis() - c.getPlayer().latestUse) > 50) {
blabladosomething();
c.getPlayer().latestUse = System.currentTimeMillis();
} [COLOR="yellowgreen"]else {
c.getPlayer().ban("Autoban '" + c.getPlayer().getName() + "': Packet Editing (Spamming playercommands)", true);
}[/COLOR]
}
Now if you are smart you can also use this to time your playercommands over a longer while, just notice that you'll have to add a new long to MapleCharacter then because using latestUse wouldn't work out to well
There are all kinds of ways to dc maps or even channels, worlds, with simple packets.
I hate every single way when being abused, so I am going to try and patch as many of these 'dc packets' as I can.
Here's a few.
Worldwide megaphone DC
Packet used : 0x4E (it's just a usecashitemhandler packet)
(see my other thread about this packet to see what's the part that makes people dc. It's basically a non-existing itemId)
Patch :
UseCashItemHandler.java
Add (orange is what would be required if you leave the ban part out) :
Code:
if (!c.getPlayer().haveItem(itemId)) {
[COLOR="YellowGreen"]c.getPlayer().ban("Autoban '" + c.getPlayer().getName() + "': Packet Editing (using a non-existing item or quantity < 1)", true);[/COLOR]
[COLOR="DarkOrange"]c.getSession().write(MaplePacketCreator.enableActions());[/COLOR]
return;
}
Code:
if (toUse == null || toUse.getItemId() != itemId || toUse.getQuantity() < 1) {
[COLOR="YellowGreen"]c.getPlayer().ban("Autoban '" + c.getPlayer().getName() + "': Packet Editing (using a non-existing item or quantity < 1)", true);[/COLOR]
[COLOR="DarkOrange"]c.getSession().write(MaplePacketCreator.enableActions());[/COLOR]
return;
}
Code:
try {
[COLOR="SlateGray"]if (itemType == 505) { // AP/SP reset[/COLOR]
Mount map dc
Packet :
PHP:
5A 00 77 4F 78 01 EC 03 00 00 01 00 00
Patch :
MapleCharacter.java
Add :
Code:
public boolean haveItemEquipped(int itemid) {
if (getInventory(MapleInventoryType.EQUIPPED).findById(itemid) != null) {
return true;
}
return false;
}
Code:
public boolean haveItem(int itemid, int quantity, boolean checkEquipped, boolean greaterOrEquals) {
int possesed = inventory[MapleItemInformationProvider.getInstance().getInventoryType(itemid).ordinal()].countById(itemid);
if (checkEquipped)
possesed += inventory[MapleInventoryType.EQUIPPED.ordinal()].countById(itemid);
return greaterOrEquals ? possesed >= quantity : possesed == quantity;
}
MapleStatEffect.java
Add :
Code:
if (applyto.haveItemEquipped(applyto.getMount().getItemId())) {
Code:
if (applyto.getMount().getItemId() != 0)
Code:
} [COLOR="YellowGreen"]else {
applyto.ban("Autoban '" + applyto.getName() + "': Packet Editing (using mount without mount being equipped)", true);
}[/COLOR]
Code:
localDuration = duration;
Invalid monsterid map dc:mellow:
Basically the packet for this uses an invalid value for monsterid when receiving damage, which will cause a map being dc'ed.
Packet used : 0x2F, a packet using takedamagehandler.
(I have published this packet before so just check my other thread for all information about the packet!)
Patch :
TakeDamageHandler.java
Add (orange = requires if you don't use autoban) :
Code:
if (MapleLifeFactory.getMonster(monsteridfrom) == null) {
[COLOR="YellowGreen"]c.getPlayer().ban("Autoban '" + c.getPlayer().getName() + "': Packet Editing (taking damage from an invalid monster)", true);[/COLOR]
[COLOR="DarkOrange"]return;[/COLOR]
}
Code:
oid = slea.readInt();
attacker = (MapleMonster) player.getMap().getMapObject(oid);
if (player.getMap().getMonsterById(monsteridfrom) == null || attacker == null) {
return;
}
Code:
monsteridfrom = slea.readInt();
The name says it all, packets that work with hired merchants.
The time I have wasted on trying to fix everything with merchants just made me hate them so much I would easily say just delete them.
here are some packets though.
Duping with hired merchants
Packet used (bundles?) :
PHP:
79 00 [1F] [04] [27 00] ![01 00]! !> 255[FF 00]! [01 00 00 00]
Patch :
PlayerInteractionHandler.java
Add :
Code:
if (!c.getPlayer().haveItem(c.getPlayer().getInventory(type).getItem(slot).getItemId(), [B][I][U][COLOR="Red"](perBundle * bundles)[/COLOR][/U][/I][/B], false, true)) {
return;
}
Code:
short perBundle = slea.readShort();
Oh btw, I have noticed alot of sources already have :
Code:
if (!c.getPlayer().haveItem(c.getPlayer().getInventory(type).getItem(slot).getItemId(), [B][I][U][COLOR="Red"]bundles[/COLOR][/U][/I][/B], false, true)) {
return;
}
Stealing from merchants
Packet used :
PHP:
79 00 24 00 00
Patch :
PlayerInteractionHandler.java
Replace (take_item_back) :
Code:
if (merchant != null) {
Code:
if (merchant != null && merchant.isOwner(c.getPlayer()) {
Code:
HiredMerchant merchant = c.getPlayer().getHiredMerchant();
if (merchant != null && merchant.isOwner(c.getPlayer()) {
Code:
int slot = slea.readShort();
Opening merchant without permit
Packet used :
PHP:
[79 00] [00] [05] 04 00 68 6D 6D 6D 00 16 00 76 C0 4C 00
Patch :
PlayerInteractionHandler.java
Add :
Code:
if (c.getPlayer().getInventory(MapleInventoryType.CASH).countById(itemId) <= 0) {
return;
}
Code:
int itemId = slea.readInt();
Pat gave me these packets and the patches were already done by Moogra for me, therefor the credits for these patches are to them.
Storage item duping
Packet used :
Code:
[3D 00] [05] [01 00] [85 84 1E 00] [02 00]
Patch :
StorageHandler.java
Add :
Code:
if (quantity < 1 || !c.getPlayer().haveItem(itemId, quantity, false, true))
return;
Code:
[COLOR="Gray"]int itemId = slea.readInt();[/COLOR]
short quantity = slea.readShort();
Storage meso packet
Packet used :
Code:
[3D 00] [07] [ME EE SO OS](lol)
Patch :
StorageHandler.java
Just replace your mode 7 (meso) with :
Code:
} else if (mode == 7) { // meso
int meso = slea.readInt();
int storageMesos = storage.getMeso();
int playerMesos = c.getPlayer().getMeso();
if ((meso > 0 && storageMesos >= meso) || (meso < 0 && playerMesos >= -meso)) {
if (meso < 0 && (storageMesos - meso) < 0) {
meso = -2147483648 + storageMesos;
if (meso < playerMesos)
return;
} else if (meso > 0 && (playerMesos + meso) < 0) {
meso = 2147483647 - playerMesos;
if (meso > storageMesos)
return;
}
storage.setMeso(storageMesos - meso);
c.getPlayer().gainMeso(meso, false, true, false);
} else
return;
storage.sendMeso(c);
} else if (mode == 8) { // close
storage.close();
}
That's all I have for now, once again, just leave packets behind on this thread if you want them to be looked at or patched! I will try to look at them if i'm not too busy.
Hope you liked it.
Last edited:

