cls
dialog 6
Connect (Enter DEBUG ON)
Read Flash
Load Flash
Write Flash
Unlock T87A
Exit
begin:
option 1 connect 2 backup 3 load 4 restore 5 unlock 6 end
connect:
if DEBUG == 0
echo Give Power within one second after detect
detect
endif
goto continue
backup:
if DEBUG == 0
echo Please try again
goto continue
endif 
echo Read Flash
getram 0 400000
goto continue
load:
echo Load Flash
ldram 0
goto continue
restore:
confirmdlg
if CONFIRM == 0
goto continue
endif
if DEBUG == 0 
detect
wait 2000
if DEBUG == 0
echo Please try again
goto continue
endif 
endif 
echo Write Flash
flashchk 0
if FLASHSET == 0
echo flash not defined
goto continue
endif
checkmdw 0
if MEMORY == FFFFFFFF
echo Your Flash does not seems to be right. This might brick the ECU
goto continue
endif
erase 0 400000
sprogram 0 400000
cmpram 0 400000
goto continue
unlock:
if DEBUG == 0
echo Please enter DEBUG ON
goto continue
endif
checkmdw 20000
if MEMORY == FFFFFFFF
getram 20000 20000
endif 
ulkblt87A
confirmdlg
if CONFIRM == 0
goto continue
endif
erase 20000 20000
sprogram 20000 20000
cmpram 20000 20000
continue:
goto begin
end:
