void CCrackme1Dlg::OnCheck()
{
UpdateData(TRUE);
CString Hex1,Hex2,Hex3,Hex4,ASCII1,ASCII2,ASCII3,ASCII4;
CString Final_1, Final_2, Final_3, Final_4, Final_1f, Final_2f, Final_3f, Final_4f, Final_1ff, Final_2ff, Final_3ff, Final_4ff, Final;
int Länge = mstr_Name.GetLength();
int zahl = 0;
int checkserial = ((mstr_Name[zahl])*(2,8));
int serial = (checkserial * 5);
int serial_1 = 1;
int serial_2 = 1;
int serial_3 = 1;
int serial_4 = 1;
//
ASCII-Wert
for (zahl; zahl <= Länge; zahl++)
{
checkserial = ((mstr_Name[zahl])*(2,8));
serial += checkserial;
}
ASCII1.Format("%d",serial);
ASCII2.Format("%d",(serial*2));
ASCII3.Format("%d",(serial*3));
ASCII4.Format("%d",(serial*4));
// Hex-Wert
Hex1.Format("%x",serial);
Hex2.Format("%x",(serial*2));
Hex3.Format("%x",(serial*3));
Hex4.Format("%x",(serial*4));
// 1-Block
Final_1f = ASCII1[0];
Final_2f = Hex1[1];
Final_3f = ASCII1[2];
Final_4f = Hex1[3];
Final_1ff = Final_1f + Final_2f + Final_3f + Final_4f;
// 2-Block
Final_1f = ASCII2[0];
Final_2f = Hex2[1];
Final_3f = ASCII2[2];
Final_4f = Hex2[3];
Final_2ff = Final_1f + Final_2f + Final_3f + Final_4f;
// 3-Block
Final_1f = ASCII3[0];
Final_2f = Hex3[1];
Final_3f = ASCII3[2];
Final_4f = Hex3[3];
Final_3ff = Final_1f + Final_2f + Final_3f + Final_4f;
// 4-Block
Final_1f = ASCII4[0];
Final_2f = Hex4[1];
Final_3f = ASCII4[2];
Final_4f = Hex4[3];
Final_4ff = Final_1f + Final_2f + Final_3f + Final_4f;
Final = Final_1ff + "-" + Final_2ff + "-" + Final_3ff + "-" + Final_4ff;
if (mstr_Serial == Final)
{
MessageBox(_T("Der Serial ist richtig!"),_T("Geschafft"),NULL);
}
else
{
MessageBox(_T("Der Serial ist falsch!"),_T("Error"),NULL);
}
}