Snippet Memory Leak Abuse Method + Fix

zOmbie

Administrator
Administrator
Joined
Jun 7, 2024
Messages
1,115
Solutions
29
Reaction score
1,208
Points
113
I have permission from Florist to post this.

A couple of weeks ago, while checking random stuff in source, I accidentally stumbled upon a memory leak that I found very interesting. After some testing, I noticed that this memory leak, unlike others, can also be used as an exploit to crash the WorldServer. I used this for a while to crash server which launched by my "old pinoy friend" aka "flyff guru", or real name "Jonas Garcia", or just a fucking scammer. But not about that now.
Now I decided to release this "method" and my fix for that for everyone because I've never released anything useful before (I hope this fix will be useful at least for someone, lol).

How to reproduce?
Equip/Unequip ride item which have model with MODELTYPE_ANIMATED_MESH type. Every time when you doing this - model not cleaned properly.
The new model simply overwrites the old one, but old one not deleted from memory.
It doesn't work for MODELTYPE_MESH models, such as brooms/boards etc, only for MODELTYPE_ANIMATED_MESH (wings etc).
P.S: I also noticed some public systems like Animated Wings have this problem, because their code is very similar (copy+paste, let's say).

How it looks like?


When/why world crashes?
x32 (x86) apps have limitation and can use only 2gb (or ~4 GB with flag) of memory, that's why it can be enough to open just 7-8 windows with clickers and in ~1 hour of time worldserver will die. x64 apps limited by computer ram, but it not means computer ram is unlimited :p

How to fix?
I know nothing about models, but I made a fix which working fine for me, but most likely it's not the best solution (in terms of code). Feel free to fix it with own way if you want.
I added fix to the v15 clean source and defined it as __RIDE_LEAK_FIX for your comfort. Find all related snippets inside provided archive and copy them to your source.

P.S:
I also recommend you to check your "animated wings/cloaks system" and "mount system" (if you have any) - most likely this problem exists there as well.

Download:
Hey There!
Please login and(or) register to see this awesome content today.
 
  • Like
Reactions: Swag