M 1
m2referencee
Fethi Polat 1
Fethi Polat
InfernoShade 1
InfernoShade
farkmt2official 1
farkmt2official
romegames 1
romegames
bikral 1
bikral
PrimeAC 1
PrimeAC
shrpnl 1
shrpnl
Agora Metin2 1
Agora Metin2
xranzei 1
xranzei
Bvural41 1
Bvural41
Hikaye Ekle

mphlvN: P2p Açığı Fix New

  • Konuyu başlatan Konuyu başlatan laz adam
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 34
  • Görüntüleme Görüntüleme 7K

laz adam

Level 4
TM Üye
Katılım
5 Tem 2016
Konular
26
Mesajlar
306
Reaksiyon Skoru
33
Altın Konu
0
TM Yaşı
9 Yıl 11 Ay 18 Gün
Başarım Puanı
47
MmoLira
12
DevLira
0
Ticaret - 0%
0   0   0

HERAKLES Otomatik Avlı kalıcı sunucu. 19 Haziran'da açılıyor. Atius & Wizard güvencesiyle hemen kayıt ol, ön kayıt ödülleri aktif. HEMEN TIKLA!

desc_p2p.cpp
Kod:
ARATILIR

#include "p2p.h"

ALTINA EKLENİR.

#include "../../common/service.h"

//////////////////////////////////////////////////////////

ARATILIR

bool DESC_P2P::Setup(LPFDWATCH fdw, socket_t fd, const char * host, WORD wPort)

ÜSTÜNE EKLENİR.

#ifdef ENABLE_PORT_SECURITY
#include "config.h"
#endif

//////////////////////////////////////////////////////////

ARATILIR

    m_iMinInputBufferLen = 1024 * 1024;

ALTINA EKLENİR(TAM ALTINA)

#ifdef ENABLE_PORT_SECURITY
    if (strcmp(host, g_szPublicIP)) // refuse if remote host != public ip (only the same machine must be able to connect in here)
    {
        sys_log(0, "SYSTEM: new p2p connection from [%s] to [%s] fd: %d BLOCKED", host, g_szPublicIP, m_sock);
        SetPhase(PHASE_CLOSE);
        return true;
    }
#endif

////////////////////////////////////////////////////////////

SON HALİ BU ŞEKİLDE OLUCAK!


#ifdef ENABLE_PORT_SECURITY
#include "config.h"
#endif
bool DESC_P2P::Setup(LPFDWATCH fdw, socket_t fd, const char * host, WORD wPort)
{
    m_lpFdw = fdw;
    m_stHost = host;
    m_wPort = wPort;
    m_sock = fd;

    if (!(m_lpOutputBuffer = buffer_new(1024 * 1024)))
        return false;

    if (!(m_lpInputBuffer = buffer_new(1024 * 1024)))
        return false;

    fdwatch_add_fd(m_lpFdw, m_sock, this, FDW_READ, false);

    m_iMinInputBufferLen = 1024 * 1024;
#ifdef ENABLE_PORT_SECURITY
    if (strcmp(host, g_szPublicIP)) // refuse if remote host != public ip (only the same machine must be able to connect in here)
    {
        sys_log(0, "SYSTEM: new p2p connection from [%s] to [%s] fd: %d BLOCKED", host, g_szPublicIP, m_sock);
        SetPhase(PHASE_CLOSE);
        return true;
    }
#endif
    SetPhase(PHASE_P2P);

    sys_log(0, "SYSTEM: new p2p connection from [%s] fd: %d", host, m_sock);
    return true;
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

input.cpp
Kod:
ARAT

#include "HackShield_Impl.h"

ALTINA EKLE

#include "../../common/service.h"

/////////////////////////////////////


ARAT

if (bHeader == HEADER_CG_TEXT)

ALTINA EKLE

#ifdef ENABLE_PORT_SECURITY
        if (IsEmptyAdminPage() || !IsAdminPage(inet_ntoa(d->GetAddr().sin_addr)))
        {
            sys_log(0, "SOCKET_CMD: BLOCK FROM(%s)", d->GetHostName());
            return -1;
        }
#endif

///////////////////////////////////////////////////////////////////////////////////

SON HALİ

ACMD(do_block_chat);
// END_OF_BLOCK_CHAT

int CInputHandshake::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
{
    if (bHeader == 10) // ¿£ÅÍ´Â ¹«½Ã
        return 0;

    if (bHeader == HEADER_CG_TEXT)
    {
#ifdef ENABLE_PORT_SECURITY
        if (IsEmptyAdminPage() || !IsAdminPage(inet_ntoa(d->GetAddr().sin_addr)))
        {
            sys_log(0, "SOCKET_CMD: BLOCK FROM(%s)", d->GetHostName());
            return -1;
        }
#endif
        ++c_pData;
        const char * c_pSep;

        if (!(c_pSep = strchr(c_pData, '\n')))    // \nÀ» ã´Â´Ù.
            return -1;

        if (*(c_pSep - 1) == '\r')
            --c_pSep;

service.h
Kod:
ARAT

#endif

ÜSTÜNE EKLE

#define ENABLE_PORT_SECURITY
 
Moderatör tarafında düzenlendi:

En Çok Reaksiyon Alan Mesajlar

teşekkürler dostum :)
 
Saol kardesim bakicam.evde
 
@laz adam; Warningleri gizli olan sourceler warningleri açarak build etsinler. Warning verebilir.
 

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst