Fix exploit(SQL inject) toate versiunile de game folosite.

Totalitatea subiectelor care nu respectă regulamentul vor fi stocate aici.
Închis
Avatar utilizator
C. Alexandru
Nivel 1

Nivel 1
Mesaje: 92
Membru din: 01 Dec 2015, 18:28
Server: Nu am
Regat: Jinno
Aprecieri: 0
Mulţumiri: 103  
 Contact:
Medalii

Acest diff blocheaza noul exploit(SQL inject messenger,guild etc)

Aceste dif-uri sunt pentru game 2089

Diff game:

Cod: Selectaţi tot

002EB6F5: 01 00
Diff database:

Cod: Selectaţi tot

00082F15: 01 00
Aceste dif-uri sunt pentru game 34k
Diff game:

Cod: Selectaţi tot

game_r34083_32
0040DFE5: 01 00
Diff database:

Cod: Selectaţi tot

db_r33820_32_u
000925A5: 01 00
Aceste fix este pentru game 40k +

1. Mergeti in db.cpp
cauti:

Cod: Selectaţi tot

void DBManager::Query(const char * c_pszFormat, ...)
-si inlocuiesti toata functia cu:

Cod: Selectaţi tot

void DBManager::Query(const char * c_pszFormat, ...)
{
    char szQuery[4096];
    va_list args;

    va_start(args, c_pszFormat);
    vsnprintf(szQuery, sizeof(szQuery), c_pszFormat, args);
    va_end(args);
    std::string sQuery(szQuery);

    m_sql.AsyncQuery(sQuery.substr(0,sQuery.find_first_of(";")==-1?sQuery.length(): sQuery.find_first_of(";")).c_str());
}

-apoi cauti:

Cod: Selectaţi tot

SQLMsg * DBManager::DirectQuery(const char * c_pszFormat, ...)
- si inlocuiesti toata functia cu:

Cod: Selectaţi tot

SQLMsg * DBManager::DirectQuery(const char * c_pszFormat, ...)
{
    char szQuery[4096];
    va_list args;
    va_start(args, c_pszFormat);
    vsnprintf(szQuery, sizeof(szQuery), c_pszFormat, args);
    va_end(args);
    std::string sQuery(szQuery);
    return m_sql_direct.DirectQuery(sQuery.substr(0, sQuery.find_first_of(";") == -1 ? sQuery.length() : sQuery.find_first_of(";")).c_str());
}


*** Atenție nu am testat nici unul , o să revin cu edit în orele următoare pt diff-ul 28k ! ***
Imagine
Afișează semnătura
Avatar utilizator
Luca Dr3Ame3r Cristian
Membru Club

Membru Club
Mesaje: 333
Membru din: 09 Noi 2015, 03:03
Server: /dev/pf
Regat: Jinno
Aprecieri: 20  
Mulţumiri: 32  
Medalii

Imagine
ImagineImagine
Afișează semnătura
Închis

Înapoi la “Arhivă”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 34 vizitatori