Guest User

Vanganth - fix enchant info ex packet crash

a guest
Jan 10th, 2018
962
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.51 KB | None | 0 0
  1. diff -u orig/UserPacketHandler.cpp new/UserPacketHandler.cpp
  2. --- orig/UserPacketHandler.cpp  Wed Jan 10 07:34:03 2018
  3. +++ new/UserPacketHandler.cpp   Wed Jan 10 07:35:40 2018
  4. @@ -318,6 +318,7 @@
  5.     BindEx(0xD, CUserPacketHandler::AutoSoulshotExPacket);
  6.     BindEx(0xF, CUserPacketHandler::RequestEnchantSkill);
  7.     BindEx(0x34, CUserPacketHandler::RequestEnchantSkillRouteChange);
  8. +   BindEx(0x46, CUserPacketHandler::EnchantSkillInfoDetail); // fix enchant type > 3 crash
  9.     BindEx(0x4C, CUserPacketHandler::TryToPutEnchantTargetItem);
  10.  
  11.     WriteCall(0x92EDFB, PacketHandlerHook, 2);
  12. @@ -748,6 +749,13 @@
  13.     }
  14.     unguard;
  15.     return true;
  16. +}
  17. +
  18. +bool CUserPacketHandler::EnchantSkillInfoDetail(CUserSocket *pSocket, const unsigned char *packet)
  19. +{
  20. +   // when enchant type > 3 server would crash
  21. +   if (*reinterpret_cast<UINT32*>(packet) > 3) return true
  22. +   return UserCallback(0x91A734)(pSocket, packet);
  23.  }
  24.  
  25.  bool CUserPacketHandler::CustomPacket(CUserSocket *pSocket, const unsigned char* packet)
  26. diff -u orig/UserPacketHandler.h new/UserPacketHandler.h
  27. --- orig/UserPacketHandler.h    Wed Jan 10 07:34:06 2018
  28. +++ new/UserPacketHandler.h Wed Jan 10 07:35:45 2018
  29. @@ -111,6 +111,7 @@
  30.     static bool WithdrawPartyPacket(CUserSocket *pSocket, const unsigned char *packet);
  31.     static bool WithdrawPledgePacket(CUserSocket *pSocket, const unsigned char *packet);
  32.     static bool LoginPacket(CUserSocket *pSocket, const unsigned char *packet);
  33. +   static bool EnchantSkillInfoDetail(CUserSocket *pSocket, const unsigned char *packet);
  34.  
  35.  };
Advertisement
Add Comment
Please, Sign In to add comment