Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ************************I.Source Binary :*************************
- ServiceDefs.h
- Find:
- ####################
- #define _IMPROVED_PACKET_ENCRYPTION_
- Replace:
- ####################
- //#define _IMPROVED_PACKET_ENCRYPTION_
- Locale.cpp
- Find:
- ####################
- #define LSS_SECURITY_KEY "testtesttesttest"
- Replace:
- ####################
- #define LSS_SECURITY_KEY "1234abcd5678efgh"
- ************************II.Source Server :*************************
- service.h
- Find:
- ####################
- #define _IMPROVED_PACKET_ENCRYPTION_
- Replace:
- ####################
- //#define _IMPROVED_PACKET_ENCRYPTION_
- protocol.h
- Find:
- #####################
- //buffer_adjust_size(pbuf, length);
- Replace:
- #####################
- buffer_adjust_size(pbuf, length);
- protocol.h
- Find:
- #####################
- #define DEFAULT_PACKET_BUFFER_SIZE .......
- Replace :
- #####################
- #define DEFAULT_PACKET_BUFFER_SIZE (150*1024) //@warme015 prevent dc if there are many entities
- desc.cpp
- Find:
- #####################
- void DESC::Packet(const void * c_pvData, int iSize)
- Remplace:
- #####################
- void DESC::Packet(const void * c_pvData, int iSize)
- {
- assert(iSize > 0);
- if (m_iPhase == PHASE_CLOSE) // 끊는 상태면 보내지 않는다.
- return;
- if (m_stRelayName.length() != 0)
- {
- // Relay 패킷은 암호화하지 않는다.
- TPacketGGRelay p;
- p.bHeader = HEADER_GG_RELAY;
- strlcpy(p.szName, m_stRelayName.c_str(), sizeof(p.szName));
- p.lSize = iSize;
- if (!packet_encode(m_lpOutputBuffer, &p, sizeof(p)))
- {
- m_iPhase = PHASE_CLOSE;
- return;
- }
- m_stRelayName.clear();
- if (!packet_encode(m_lpOutputBuffer, c_pvData, iSize))
- {
- m_iPhase = PHASE_CLOSE;
- return;
- }
- }
- else
- {
- if (m_lpBufferedOutputBuffer)
- {
- buffer_write(m_lpBufferedOutputBuffer, c_pvData, iSize);
- c_pvData = buffer_read_peek(m_lpBufferedOutputBuffer);
- iSize = buffer_size(m_lpBufferedOutputBuffer);
- }
- // TRAFFIC_PROFILE
- if (g_bTrafficProfileOn)
- TrafficProfiler::instance().Report(TrafficProfiler::IODIR_OUTPUT, *(BYTE *) c_pvData, iSize);
- // END_OF_TRAFFIC_PROFILER
- #ifdef _IMPROVED_PACKET_ENCRYPTION_
- void* buf = buffer_write_peek(m_lpOutputBuffer);
- if (packet_encode(m_lpOutputBuffer, c_pvData, iSize))
- {
- if (cipher_.activated()) {
- cipher_.Encrypt(buf, iSize);
- }
- }
- else
- {
- m_iPhase = PHASE_CLOSE;
- }
- #else
- if (!m_bEncrypted)
- {
- if (!packet_encode(m_lpOutputBuffer, c_pvData, iSize))
- {
- m_iPhase = PHASE_CLOSE;
- }
- }
- else
- {
- if (buffer_has_space(m_lpOutputBuffer) < iSize + 8)
- {
- sys_err("desc buffer mem_size overflow. memsize(%u) write_pos(%u) iSize(%d)",
- m_lpOutputBuffer->mem_size, m_lpOutputBuffer->write_point_pos, iSize);
- m_iPhase = PHASE_CLOSE;
- }
- else
- {
- // 암호화에 필요한 충분한 버퍼 크기를 확보한다.
- /* buffer_adjust_size(m_lpOutputBuffer, iSize + 8); */
- DWORD * pdwWritePoint = (DWORD *) buffer_write_peek(m_lpOutputBuffer);
- if (packet_encode(m_lpOutputBuffer, c_pvData, iSize))
- {
- int iSize2 = TEA_Encrypt(pdwWritePoint, pdwWritePoint, GetEncryptionKey(), iSize);
- if (iSize2 > iSize)
- buffer_write_proceed(m_lpOutputBuffer, iSize2 - iSize);
- }
- }
- }
- #endif // _IMPROVED_PACKET_ENCRYPTION_
- SAFE_BUFFER_DELETE(m_lpBufferedOutputBuffer);
- }
- //sys_log(0, "%d bytes written (first byte %d)", iSize, *(BYTE *) c_pvData);
- if (m_iPhase != PHASE_CLOSE)
- fdwatch_add_fd(m_lpFdw, m_sock, this, FDW_WRITE, true);
- }
- Well, such a thing is quite easy, and I know it since 2011~2012 (when the first 30k game cores were released to be more precise).
- You can find some diff patch files of that time for 30k game cores on the web that do this, but I will explain to you how to do it via source code editing.
- Before all, why the 40k game core files have a login more slower than usual? That's because ymir implemented an additional encryption security using cryptopp, and at login, they added some key agreement checks, which ended up the login to be more slower.
- You can actually disable such a feature, so that you can have the login fast like the old game revisions had.
- Disabling it will actually remove the "key agreement" issue, and will encrypt the connection with xtea instead of some cryptopp algorithms. (no big security issues, so it's safe to do)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement