KeyGenerator 1.6n9 :

- aggiunta gestione primi 16 bit di opzioni 2
- ricompilato con nuova gestione chiave per id di prodotto in OR con id librerie base
- cambiato id di prodotto.
This commit is contained in:
Dario Sassi
2016-03-01 08:42:31 +00:00
parent c94137d649
commit 9bcb974a44
4 changed files with 23 additions and 5 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ CKeyGeneratorApp::InitInstance( void)
// verifico la protezione
SetLockType( KEY_LOCK_TYPE_HW) ;
string sKey = GetPrivateProfileStringUtf8( "General", "Key", "", m_pszProfileName) ;
if ( VerifyKey( sKey, 1230, 16, 10) != KEY_OK)
if ( VerifyKey( sKey, 823, 16, 10) != KEY_OK)
return FALSE ;
// gestione linea di comando
BIN
View File
Binary file not shown.
+22 -4
View File
@@ -266,14 +266,22 @@ CKeyGeneratorDlg::LoadFile( const char* szFile)
string sLockId = GetPrivateProfileStringUtf8( sSec.c_str(), "LockId", "", szFile) ;
GetDlgItem( IDC_MACHID)->SetWindowTextW( stringtoW( sLockId)) ;
int nProd = GetPrivateProfileInt( sSec.c_str(), "Product", 0, szFile) ;
((CComboBox*)GetDlgItem( IDC_PROD))->SetCurSel( nProd - 1230) ;
int nSel = - 1 ;
switch ( nProd) {
case 823 : nSel = 0 ; break ;
case 1231 : nSel = 1 ; break ;
case 5327 : nSel = 2 ; break ;
case 9423 : nSel = 3 ; break ;
case 17615 : nSel = 4 ; break ;
}
((CComboBox*)GetDlgItem( IDC_PROD))->SetCurSel( nSel) ;
int nVer = GetPrivateProfileInt( sSec.c_str(), "Ver", 0, szFile) ;
((CComboBox*)GetDlgItem( IDC_VER))->SetCurSel( nVer - 15) ;
int nLev = GetPrivateProfileInt( sSec.c_str(), "Lev", 0, szFile) ;
((CComboBox*)GetDlgItem( IDC_LEV))->SetCurSel( nLev - 1) ;
int nExpTime = GetPrivateProfileInt( sSec.c_str(), "ExpDays", 0, szFile) ;
if ( nExpTime != 0)
((CDateTimeCtrl*)GetDlgItem( IDC_EXPIRATION))->SetTime( &CTime( nExpTime * 24 * 3600)) ;
((CDateTimeCtrl*)GetDlgItem( IDC_EXPIRATION))->SetTime( &CTime( unsigned( nExpTime) * 24 * 3600)) ;
int nOpt1 = GetPrivateProfileInt( sSec.c_str(), "Opt1", 0, szFile) ;
for ( int i = IDC_CHECK01, j = 0 ; i <= IDC_CHECK16 ; ++ i, ++ j) {
if ( ( nOpt1 & ( 1 << j)) != 0)
@@ -282,10 +290,16 @@ CKeyGeneratorDlg::LoadFile( const char* szFile)
((CButton*)GetDlgItem( i))->SetCheck( BST_UNCHECKED) ;
}
int nOpt2 = GetPrivateProfileInt( sSec.c_str(), "Opt2", 0, szFile) ;
for ( int i = IDC_CHECK2_01, j = 0 ; i <= IDC_CHECK2_16 ; ++ i, ++ j) {
if ( ( nOpt2 & ( 1 << j)) != 0)
((CButton*)GetDlgItem( i))->SetCheck( BST_CHECKED) ;
else
((CButton*)GetDlgItem( i))->SetCheck( BST_UNCHECKED) ;
}
// check non ancora inseriti nel dialogo
int nOptExpTime = GetPrivateProfileInt( sSec.c_str(), "OptExpDays", 0, szFile) ;
if ( nOptExpTime != 0)
((CDateTimeCtrl*)GetDlgItem( IDC_OPT_EXPIR))->SetTime( &CTime( nOptExpTime * 24 * 3600)) ;
((CDateTimeCtrl*)GetDlgItem( IDC_OPT_EXPIR))->SetTime( &CTime( unsigned( nOptExpTime) * 24 * 3600)) ;
return true ;
}
@@ -355,6 +369,10 @@ CKeyGeneratorDlg::OnGenerate( void)
nOpt1 += ( 1 << j) ;
}
unsigned int nOpt2 = 0 ;
for ( int i = IDC_CHECK2_01, j = 0 ; i <= IDC_CHECK2_16 ; ++ i, ++ j) {
if ( ((CButton*)GetDlgItem( i))->GetCheck() == BST_CHECKED)
nOpt2 += ( 1 << j) ;
}
if ( ! mKey.SetOptions( nOpt1, nOpt2)) {
AfxMessageBox( L"Inserisci Opzioni valide") ;
return ;
@@ -375,7 +393,7 @@ CKeyGeneratorDlg::OnGenerate( void)
WritePrivateProfileInt( "Licence", "OptExpDays", nOptDays, AfxGetApp()->m_pszProfileName) ;
// verifico la protezione
string sPKey = GetPrivateProfileStringUtf8( "General", "Key", "", AfxGetApp()->m_pszProfileName) ;
if ( VerifyKey( sPKey, 1230, 16, 10) != KEY_OK)
if ( VerifyKey( sPKey, 823, 16, 10) != KEY_OK)
return ;
// calcolo la chiave
if ( ! mKey.CalcKey()) {
BIN
View File
Binary file not shown.