diff --git a/KeyProc.cpp b/KeyProc.cpp index be60572..1f5aa50 100644 --- a/KeyProc.cpp +++ b/KeyProc.cpp @@ -39,12 +39,17 @@ MakeKey( int nProd, int nVer, int nLev, int nExpDays, const string& sScramKey, string& sKey) { // sistemazioni per nuova versione mensile valide fino alla 2806 - // ( 2201->22, 2202->23 ... 2212->33, 2301->34, 2302->35 ... 2312->45) - if ( nVer > 22 && nVer < 100) + // ( 16->16, 19->19, 21->21, 22->22, 2201->22, 2202->23 ... 2212->33, 2301->34, 2302->35 ... 2312->45) + int nVerNew ; + if ( nVer >= 1 && nVer <= 22) + nVerNew = nVer ; + else if ( nVer >= 2201) { + int nVerY = ( nVer >= 100 ? nVer / 100 : nVer) ; + int nVerM = ( nVer >= 100 ? Clamp( nVer % 100 - 1, 0, 11) : 0) ; + nVerNew = Clamp( 22 + 12 * ( nVerY - 22) + nVerM, 0, 99) ; + } + else return false ; - int nVerY = ( nVer >= 100 ? nVer / 100 : nVer) ; - int nVerM = ( nVer >= 100 ? Clamp( nVer % 100 - 1, 0, 11) : 0) ; - int nVerNew = Clamp( 22 + 12 * ( nVerY - 22) + nVerM, 0, 99) ; // inizializzo parte pseudorandom srand( nVerNew + nLev) ; // preparo la stringa da criptare