It's been a while, but guess what... Hi.
Most of you should've faced this bug already, the bug is basically because joymax did not limit guild skill points or even make it unsigned.
The first thing that crossed my mind was doing it through game server, I did it actually but after testing in a live server, it actually caused a disconnect problem. Then I realized that it was because the value stored in the game server that I modified was fine, but SQL was not
I actually still could do it through game server, but a better idea crossed my mind, why don't we do it through sro client instead!
So, basically this limits guild point donation to provide positive values only. However, the bug can still occur if somebody donates with a packet injector unless you fix it in server-side too, but anyways who wants to harm himself with minus GP? Client-side shall be enough.
CInterfaceNetSender.h:
Code:
#pragma once
#include <iostream>
class CInterfaceNetSender
{
private:
char pad_0000[8504]; //0x0000
unsigned int GuildSkillPoints; //0x2138
char pad_2140[8]; //0x213C
std::wstring GuildName; //0x2140
std::wstring CharName; //0x2160
public:
void DonateGuildPoints(unsigned int GP);
};
Code:
#define GP_LIMIT 0x7FFFFFFF
void CInterfaceNetSender::DonateGuildPoints(unsigned int GP)
{
if (GuildSkillPoints == GP_LIMIT)
{
CGInterface* g_interface = CGInterface::GetInterface();
if (g_interface)
{
g_interface->HandleSystemMessages(1, L"You have reached maximum limit of guild skills points.");
g_interface->ShowBlueNotify(L"You have reached maximum limit of guild skills points.");
}
}
else
{
unsigned int TotalGP = GuildSkillPoints + GP;
if (TotalGP > GP_LIMIT && GuildSkillPoints < GP_LIMIT)
GP = GP_LIMIT - GuildSkillPoints;
reinterpret_cast<void(__thiscall*)(CInterfaceNetSender*, unsigned int)>(0x0081FAB0)(this, GP);
}
}
Code:
replaceOffset(0x0070BCF2, addr_from_this(&CInterfaceNetSender::DonateGuildPoints));

And that's it, good luck.
Special Thanks To: florian0
__________________________________________________ _______________________________
Offical Global Fix
As the topic went, apparently my client hotfix won't work because GP is increased on killing monsters too.
I've implemented a server files patch since its the only way to fix this annoying bug in SRO files.
I posted before the game server fix, and I declared after testing the game server patch only that it causes disconnect issues and database isn't affected by the patch and stays minus.
I've scanned both GS and shard manager memories and found out that shard manager is the one responsible for modifying database value and also has stored memory for guilds instances just like GS.
So, I applied a patch for shard manager too, and it seems to be working fine now, SQL and memory values are equivalent. I'm gonna be testing it in a live productive server and posting a feedback whether there were any errors or issues after applying both GS and shard manager patches.
How The Patch Works: It basically prevents GP from exceeding maximum integer value (2147483647 | 7FFFFFFF).
Patch Details:
Using the GP reference in GS/SM, I've hooked where GP is modified, and did some conditions to check if GP exceeded INT_MAX (aka went minus), then will re-set it to INT_MAX.
__________________________________________________ _______________________________
Final Patch
After exploring, it seemed like a normal message that I had to skip, but in case of GP intended donation, shard manager needs to respond to game server, otherwise user will be frozen for 10 ~ 15 seconds.
So anyways, I handled both cases and modified the old shard manager patch, this is probably the last patch to maintain this original bug.
Note: Please make sure your apply both GS and SM patches, otherwise you'll have some trouble going in.
Download: x64dbg patch is attached.






