[Carradio\SONY\MEX-100NV]

Size(310,470);  

Form {
    	HexDigit(Code,"Code ",70,15,100,5);
	CheckBox(ResetCounter,"Clear error counter",82,45);
	Group("Информация",5,65,300,40)		 
    {
        Label(message," ",0,17);		 
    }
    	Group("Описание",5,105,300,200) 	 
    {
        Label(lb1,"Code calculator for SONY :",0,15);
    	Label(lb2,"Model: MEX-100NV NAVIGATION",32,30);
    	Label(lb3,"Sec. Type:  CODE 11111- 66666",32,45);
	Label(lb4,"Manufacturen: BECKER.",32,60);
	Label(lb5,"Partnumer:   ",32,75);
    	Label(lb6,"MCU:  SAFC161JC32RF ",32,90);
	Label(lb7,"EEPROM: 24C04smd",32,105);
	Label(lb8,"Sec.loc.: EEPROM",32,120);
    	Label(lb9,"Autor:  telik@ukrwest.net   2008",0,180);
    	Label(lb10,"Enter code: ",32,135);
    }
	Picture(Logo,"sony.bmp",210,10,0,0);
	Picture(Logo1,"mex-100nv.bmp",5,325,0,0);
    {
        Label(msg," ",0,305);				 
    } 
}

OnShow {
	msg.Color=0x0000FF;				 
        msg.Bold=1;					 
	msg="http://www.eeprom.lg.ua";		
        
	message.Bold = 1;  
    	Var0 = 1;
    	if(@0x0AA != 0x37) { Var0 = 0;}	
    	if (Var0 = 0)
    	{
        message.Color = 0x0000FF;
        Message = "Неверный дамп ! ";
        Code = 0;
    	}
    else
    	{
	var1 = @0x094 ;
	var2 = @0x095 ;
	var3 = @0x096 & 0xF0 ;
	var4 = var1 ^ 0xAA ;
	var5 = var2 ^ 0xAA ;
	var6 = var3 ^ 0xAA ;
	var7 = var4 << 12 ;
	var8 = var5 << 4 ;
	var9 = var6 >> 4 ;
	Code = var7 | var8 | var9;
	ResetCounter = 1 ;
	if(@0x09B != 0xAA) { ResetCounter = 0; }     
	if (ResetCounter = 0) 
	{	
	message.Color = 0x0000FF; 
	message.Bold = 1; 
	message = "Обнулите счётчик попыток !!!"; 
	ResetCounter = 1;
	}
    else
	{	
	message.Color = 0xFF0000;
    	message.Bold = 1;
    	message = " Счётчик попыток OK. ";
	ResetCounter = 0;
	}
    }
}

OnApply {
	message.Bold = 1;  
    	Var0 = 1;
    	if(@0x0AA != 0x37) { Var0 = 0;}	
    	if (Var0 = 0)
    	{
        message.Color = 0x0000FF;
        Message = "Неверный дамп ! ";
        Code = 0;
    	}
    else
    	{
	if(ResetCounter = 1) { @0x09B = 170; } 
	if(ResetCounter = 1) { @0x0A0 = 170; }
	message.Color = 0xFF0000;
        Message = "Счётчик попыток успешно изменён.";
	ResetCounter = 0;
        }

}
