• Content Count

  • Joined

  • Last visited

  • Feedback


Community Reputation

3 Neutral

About Nevermind25

  • Rank

Profile Information

  • Gender

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hello @MasterToma that bug is in all catacombs but not at the same time, as you say it is not reproduced 100% it happens after some time, may be after some trains. I think that must be the respawn of mobs because sometimes i kill all using //killnpc and when they spawn again are fixed , other way is restarting l2npc so: 1 - Not occurs in all cata/necro at the same time 2 - Spawning again may be fixed so i tell users to kill them one by one or if im in home just //killnpc 3 - When mob stuck he dont attack even when player goes at his side and hit, even with short range weapon(dagger, fist). It's hard to try without a live server so many times you think that all is good but when users start his interaction in world some problems can be found :)
  2. Thank you for you answer, im trying to fix it in AI but not sucess for now, sometimes it work after killing the mob
  3. Hello boys, i'm back with a rare bug in all catacomb/necropolis monsters that i can't solve. Sometimes when someone hit a monster or a group of them or using Provoke or Agression/Group Hate the monsters stay in its place like without attack desire, them are there, static It happen to somebody? may be AI bug? Im using retail AI without modifications. This i've seen in many servers and without solutions, just restart L2NPC or L2Server. @MasterToma may be util for your project
  4. You need change all the packets that is extended to interlude, so... that is an interlude extender and u need remove many many things, check if something left with bugs (there has many protections). Work for 6 - 12 months for sure to get ready and tested.
  5. Some book where i can learn about? i'm felling like a donkey, really thanks
  6. stop sticking elbows, you guys are good together :D :D @guytis can you explain me why there is 5 ? parameter nWriteForm of the WriteRelativeAdress
  7. im trying but is not simple as you put xD double g_MagicCriticalMultipler = 4.0; g_MagicCriticalMultipler = GetPrivateProfileDouble(_T("SkillFactory"), _T("MagicCriticalMultipler"), 4.0, g_ConfigFile); g_HookManager.WriteRelativeAddress(0x7A882A, 3, &g_MagicCriticalMultipler, 0); g_HookManager.WriteRelativeAddress(0x7A9071, 3, &g_MagicCriticalMultipler, 0); g_HookManager.WriteRelativeAddress(0x7A98DA, 3, &g_MagicCriticalMultipler, 0); g_HookManager.WriteRelativeAddress(0x7AA14B, 3, &g_MagicCriticalMultipler, 0); g_HookManager.WriteRelativeAddress(0x7AFED5, 3, &g_MagicCriticalMultipler, 0); g_HookManager.WriteRelativeAddress(0x7B274E, 3, &g_MagicCriticalMultipler, 0); when i launch a magic critical server stops working or crash linerror GuardInfo : IOThread [0][47] (good): void IOThread_common(void *arglist) Lock Stack : IOThread [1][0] (ahehe): void IOThread_common(void *arglist) -> void CIOObject::TimerDispatch(bool bRootLoop) -> void CThreadLocalTimer::Dispath -> void CCreatureController::TimerExpired(int id) -> inline void AddExecutable(MemoryObject *Matrix, Native Func, CExecutionArgument* Arg) -> add exec - func call -> ASYNCHRONOUS_SERIALIZE_IMPL1(CCreatureController, AsyncTimerExpired, int, id) -> bool CSkillAction2::OnTick() -> skillaction_ontick_SKL_HITTIME -> skillaction_ontick_SKL_HITTIME_2 -> skillaction_ontick_SKL_HITTIME_2_3 -> CSkillInfo::ActivateSkill -> CSkillEffect_i_m_attack::Instant() Lock Stack : IOThread [2][16] (good): void IOThread_common(void *arglist) Lock Stack : IOThread [3][16] (good): void IOThread_common(void *arglist) Lock Stack : ListenThread [13][31] (good): void ListenThread_common() -> unsigned __stdcall WaitThread(void *) Lock Stack : MainThread [12][592] (good): Lock Stack : GuardInfo end
  8. with little steps i found this, for sure im wrong because i have no much idea 545280 sub_545280 proc near ; CODE XREF: sub_81DF00+6EC↓p .text:0000000000545280 ; sub_81DF00+74C↓p ... .text:0000000000545280 movlpd xmm2, cs:qword_988780 .text:0000000000545288 movlpd xmm1, cs:qword_9CCFB0 .text:0000000000545290 lea eax, [rcx-1] .text:0000000000545293 cvtsi2sd xmm0, eax .text:0000000000545297 mulsd xmm0, cs:qword_9CCFA8 .text:000000000054529F subsd xmm2, xmm0 .text:00000000005452A3 comisd xmm2, xmm1 .text:00000000005452A7 ja short loc_5452AD .text:00000000005452A9 movsd xmm2, xmm1 .text:00000000005452AD .text:00000000005452AD loc_5452AD: ; CODE XREF: sub_545280+27↑j .text:00000000005452AD divsd xmm2, cs:qword_98E5A0 .text:00000000005452B5 xorpd xmm0, xmm0 .text:00000000005452B9 lea rdx, unk_9CCB50 .text:00000000005452C0 movsxd rcx, ecx .text:00000000005452C3 mov eax, [rdx+rcx*4] //<-- HERE IS? .text:00000000005452C6 sub eax, [rdx+rcx*4-4] .text:00000000005452CA cvtsi2sd xmm1, eax .text:00000000005452CE mulsd xmm1, xmm2 .text:00000000005452D2 subsd xmm0, xmm1 .text:00000000005452D6 retn .text:00000000005452D6 sub_545280
  9. v12 is dPAtack i think, it matches to the dmg formula shared in older forums, so this function is for Phisical damage only I'm searching for Magic Critical, to down the damage power from x4 to another value i want, let me know if you find it :)
  10. really good share, i dont understand why there is exeptionmailing. I ve trying to find magic critical damage multipler address with IDA but i cant find it you have idea? or know the address where is that value?
  11. I have a problem in Vanganth, surely much people have the same: Usersockets: This number is higher than the playing users, l2server dont fix that number when a person logout, and i supose that it drives to the next problem Pending Write: This number goes up to +-5.600.000/8k (+-700) or more. someone has fixed or worked on it? i adjunt my SocketLimiter.cpp and header. SocketLimiter.h #pragma once class SocketLimiter { static int nLastCheck; public: static void Initialize(); static SOCKET AcceptConnection(SOCKET ListenSocket, sockaddr *addr, int *addrlen); static void ValidateSend(CSocket *pSocket, const char *format, va_list va); static void SetPendingWriteLimit(int nLimit); static void TimerExpired(); static bool ValidUserSocket(CSocket *pSocket); static void OnRead(CUserSocket *pSocket); static void Read(CUserSocket *pSocket, DWORD dwLeft); static void UserSocketBadPacketSizeLog(LPVOID lpInstance, UINT logType, const WCHAR* format, UINT64 sockFunc, int packetSize); }; SocketLimiter.cpp /* ################SOCKET##LIMITER################## ## This module will protect l2server, blocking ## ## ugly bug with usersockets, opening xxk and ## ## using all available IOBufferPool. It will ## ## also auto ban ip, if there will be more than## ## x connection from this ip at once. ## ################################################# */ #include "StdAfx.h" #include "SocketLimiter.h" #include "SocketDB.h" #include "IpList.h" #include "IpBlocker.h" LPINT lpUsersOnline; LPINT lpUserSockets; LPINT lpPendingWriteLimit; static int nSocketLimitPerIP; static int nBanDuration; //in seconds static UINT g_IOReadPerSecond = UINT_MAX; UINT g_SocketReleaseTime = 25000; UINT g_SocketPreReleaseTime = 5000; int SocketLimiter::nLastCheck; CUserSocket* g_ThreadUserSocket[32]; /* [SocketLimiter] Enabled=1 ;ip separated by space ex. SafeIpList= ;Limit sockets per ip (default 10) LimitPerIp=10 ;Ban duration after reaching socket ip limit in seconds (default 300) BanDuration=300 ;Pending write limit (amount of data that will be sent to user in bytes Default l2server: 2097152) PendingWriteLimit=1097152 PendingWriteDuringSiege=2097152 */ void SocketLimiter::Initialize() { g_Log.Add(CLog::Blue, "[Ext] Initializing Socket Limiter"); nLastCheck = time(NULL); lpUsersOnline = (LPINT)0x1557E0C; //dVamp exe : 0x1558E10 lpUserSockets = (LPINT)0x1557E08; //dVamp exe : 0x1558E08 lpPendingWriteLimit = (LPINT)0x0086C19C; const TCHAR* section = _T("SocketLimiter"); if(!GetPrivateProfileInt(section, _T("Enabled"), 0, g_ConfigFile)) { g_Log.Add(CLog::Blue, "[%s] Disabled", __FUNCTION__); return; } for(UINT n=0;n<32;n++) { g_ThreadUserSocket[n] = 0; } //Set Config Data nSocketLimitPerIP = GetPrivateProfileInt(section, _T("LimitPerIp"), 20, g_ConfigFile); nBanDuration = GetPrivateProfileInt(section, _T("BanDuration"), 300, g_ConfigFile); g_IOReadPerSecond = GetPrivateProfileInt(section, _T("MaxIOReadPerSecond"), UINT_MAX, g_ConfigFile); g_SocketReleaseTime = GetPrivateProfileInt(section, _T("SocketReleaseTime"), 25000, g_ConfigFile); g_SocketPreReleaseTime = GetPrivateProfileInt(section, _T("SocketPreReleaseTime"), 500, g_ConfigFile); //(*pPendingWriteLimit) = g_Config.SockLimiterInfo.GetPendingWriteLimit(); //2097152 org l2server limit g_HookManager.WriteMemoryDWORD(0x86c19c, GetPrivateProfileInt(section, _T("PendingWriteLimit"), 2097152, g_ConfigFile)); g_HookManager.WriteMemoryDWORD(0x890B12, g_SocketReleaseTime); g_HookManager.WriteMemoryDWORD(0x890A5E, g_SocketPreReleaseTime); TCHAR temp[8190]; if(GetPrivateProfileString(section, _T("SafeIpList"), 0, temp, sizeof(temp), g_ConfigFile)) { wstringstream sstr; sstr << temp; wstring sVal; while(sstr >> sVal) { CIPAddress ip(sVal); g_Log.Add(CLog::Blue, "[%s] SafeIpList: %S [%d]", __FUNCTION__, ip.ToString().c_str(), g_SafeIpList.GetSize()); g_SafeIpList.AddIp(ip); } } //Set Hooks g_HookManager.WriteCall(0x620EEF, AcceptConnection, 1); //CSocket::SendV hook g_HookManager.WriteCall(0x005AB493, ValidateSend, 0); //CEventMatch::Broadcast g_HookManager.WriteCall(0x005AB65D, ValidateSend, 0); //CEventMatch::Broadcast g_HookManager.WriteCall(0x005ABA6D, ValidateSend, 0); //CEventMatch::Broadcast2Observer g_HookManager.WriteCall(0x006FF983, ValidateSend, 0); //COlympiadField::SendVToPlayers g_HookManager.WriteCall(0x006FF9B5, ValidateSend, 0); //COlympiadField::SendVToPlayers g_HookManager.WriteCall(0x006FFE36, ValidateSend, 0); //COlympiadObserverEntry::Broadcast g_HookManager.WriteCall(0x0071D7C6, ValidateSend, 0); //CParty::BroadcastToAllParty g_HookManager.WriteCall(0x0071D9E1, ValidateSend, 0); //CParty::BroadcastToAllPartyV g_HookManager.WriteCall(0x007D5FCA, ValidateSend, 0); //CSocket::Send g_HookManager.WriteMemoryDWORD(0xA8EF38, (DWORD)SocketLimiter::OnRead); g_HookManager.WriteCall(0x8774D5, SocketLimiter::Read, 0); g_HookManager.WriteCall(0x87753A, SocketLimiter::Read, 0); g_HookManager.WriteCall(0x8777C6, SocketLimiter::Read, 0); g_HookManager.WriteCall(0x877516, SocketLimiter::UserSocketBadPacketSizeLog); } UINT g_LastInvalidPacketLog = 0; void SocketLimiter::UserSocketBadPacketSizeLog(LPVOID lpInstance, UINT logType, const WCHAR* format, UINT64 sockFunc, int packetSize) { UINT currentTick = GetTickCount(); if(g_LastInvalidPacketLog < currentTick) { g_LastInvalidPacketLog = currentTick + 5000; UINT threadIndex = GetThreadIndex(); if(threadIndex < 32) { CUserSocket *pSocket = g_ThreadUserSocket[threadIndex]; if(pSocket->ValidUserSocket()) { g_Log.Add(CLog::Error, "Invalid packet size[%d] in User Socket from ip[%d.%d.%d.%d]!", packetSize, (UINT)pSocket->addr.S_un.S_un_b.s_b1, (UINT)pSocket->addr.S_un.S_un_b.s_b2, (UINT)pSocket->addr.S_un.S_un_b.s_b3, (UINT)pSocket->addr.S_un.S_un_b.s_b4); } } } } void SocketLimiter::OnRead(CUserSocket *pSocket) { guard; UINT threadIndex = GetThreadIndex(); if(threadIndex < 32) { g_ThreadUserSocket[threadIndex] = pSocket; } if(pSocket && pSocket->pED) { DWORD currentTick = GetTickCount(); DWORD timeoutTick = currentTick + 30000; pSocket->pED->onReadTimeout = timeoutTick; if(pSocket->pED->ioReadTimeout < currentTick || pSocket->pED->ioReadTimeout > (DWORD)(currentTick + 1000)) { pSocket->pED->ioReadCount = 0; pSocket->pED->ioReadTimeout = GetTickCount() + 1000; } } typedef void(*f)(CUserSocket*); f(0x876F60L)(pSocket); if(threadIndex < 32) { g_ThreadUserSocket[threadIndex] = 0; } unguard; } void SocketLimiter::Read(CUserSocket *pSocket, DWORD dwLeft) { guard; //check for deadlock UINT currentTick = GetTickCount(); if(pSocket->pED->onReadTimeout > currentTick || ((DWORD)(pSocket->pED->onReadTimeout - 30000) > currentTick)) { pSocket->pED->ioReadCount = pSocket->pED->ioReadCount + 1; if(pSocket->pED->ioReadCount < g_IOReadPerSecond) { typedef void(*f)(CUserSocket*, DWORD); f(0x6205F0L)(pSocket, dwLeft); }else { //close socket g_Log.Add(CLog::Error, "[%s] UserSocket from ip[%d.%d.%d.%d] reached IOReadPerSecond limit [%d][%d] - closed!", __FUNCTION__, pSocket->addr.S_un.S_un_b.s_b1, pSocket->addr.S_un.S_un_b.s_b2, pSocket->addr.S_un.S_un_b.s_b3, pSocket->addr.S_un.S_un_b.s_b4, pSocket->pED->ioReadCount, g_IOReadPerSecond); pSocket->Close(); } }else { //close socket g_Log.Add(CLog::Error, "[%s] UserSocket from ip[%d.%d.%d.%d] reached execute limit for CUserSocket::OnRead [%u][%u] - closed!", __FUNCTION__, pSocket->addr.S_un.S_un_b.s_b1, pSocket->addr.S_un.S_un_b.s_b2, pSocket->addr.S_un.S_un_b.s_b3, pSocket->addr.S_un.S_un_b.s_b4, pSocket->pED->onReadTimeout, currentTick); pSocket->Close(); } unguard; } SOCKET SocketLimiter::AcceptConnection(SOCKET ListenSocket, sockaddr *addr, LPINT lpAddrLen) { SOCKET s = accept(ListenSocket, addr, lpAddrLen); try { sockaddr_in* lpAddr = (struct sockaddr_in*)addr; char *szIP = inet_ntoa(lpAddr->sin_addr); CIPAddress ip((*lpAddr)); if(!g_SafeIpList.Contain(ip)) { if( g_IpBlocker.IsBlocked(szIP) ) { closesocket(s); WSASetLastError(WSAEWOULDBLOCK); s = -1; }else if(g_BannedIpList.Contain(ip)) { closesocket(s); WSASetLastError(WSAEWOULDBLOCK); s = -1; }else { int nSocketCount = g_SocketDB.GetIpCount(ip); if( nSocketCount >= nSocketLimitPerIP ) { g_Log.Add(CLog::Error, "[%s] IP[%s] reached socket limit[%d]!", __FUNCTION__, szIP, nSocketLimitPerIP); g_Logger.Add(L"[%S] IP[%S] reached socket limit(%d) - Banned for [%d] seconds.", __FUNCTION__, szIP, nSocketLimitPerIP, nBanDuration); g_BannedIpList.AddIp(ip, nBanDuration); closesocket(s); WSASetLastError(WSAEWOULDBLOCK); s = -1; } } } }catch(...) { EXCEPTION_LOG; } return s; } void SocketLimiter::ValidateSend(CSocket *pSocket, const char *format, va_list va) { try { if(CUserSocket *pUS = pSocket->CastUserSocket()) { if( (INT64)pUS->s == -1 ) { if(pUS->pED->invalidWriteTime == 0) { pUS->pED->invalidWriteTime = time(0) + 60; } if(pUS->pED->invalidWriteTime > 0 && pUS->pED->invalidWriteTime < time(0) && pUS->netPingTime < (time(0) + 30)) { /* CHAR buff[16384]; int len = Utils::VAssemble(buff, 16384, format, va); g_Log.Add(CLog::Error, "[%s] Trying to write to invalid user socket ip[%d.%d.%d.%d] - opCode[%x]!", __FUNCTION__, pUS->addr.S_un.S_un_b.s_b1, pUS->addr.S_un.S_un_b.s_b2, pUS->addr.S_un.S_un_b.s_b3, pUS->addr.S_un.S_un_b.s_b4, (BYTE)buff[0]); g_Log.StackTrace(CLog::Error); */ pUS->netPingTime = time(0) + 120; } return; } } typedef void (*f)(CSocket*, const char *, va_list); f(0x7D5D40L)(pSocket, format, va); }catch(...) { g_Log.Add(CLog::Error, "[%s] Exception format[%s]!", __FUNCTION__, format); g_Log.StackTrace(CLog::Error); } } void SocketLimiter::SetPendingWriteLimit(int nLimit) { if(nLimit > 0) { (*lpPendingWriteLimit) = nLimit; } } bool SocketLimiter::ValidUserSocket(CSocket *pSocket) { typedef bool (*f)(CSocket*); if(f(0x86C160L)(pSocket)) { return true; } return false; } void SocketLimiter::TimerExpired() { if(time(NULL) > (nLastCheck + 10)) { // FixUserSocketCount(); nLastCheck = time(NULL); } } /*void SocketLimiter::FixUserSocketCount() { size_t nSocketCount = g_SocketDB.GetSocketCount(); if((*lpUserSockets) > (nSocketCount + 50)) { (*lpUserSockets) = (int)nSocketCount; g_Log.Add(CLog::Blue, "[%s] Done.", __FUNCTION__); } }*/