cls
forever:
dialog 8
ECU Info
Read INT Flash
Read Shadow Flash
Load Flash
Write Flash
Verify
Change VIN
Exit
begin:
option 1 ecuinfo 2 backup 3 readshadow 4 load 5 restore 6 verify 7 changevin 8 end
ecuinfo:
run canparameter
goto forever
backup:
detect
wait 2000
if DEBUG == 0
echo Please try again
goto continue
endif 
echo Read Flash
getram 0 600000
goto continue
readshadow:
getram shadow
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 600000
sprogram 0 600000
cmpram 0 600000
if CMPRAM == 0
echo Please power off/on the ECU and try again
endif
goto continue
verify:
cmpram 0 600000
continue:
goto begin
changevin:
run canvin
goto forever
end:
