cls
dialog 8
Read ECU Info
Edit VIN: 
Write VIN
Read Flash
Load Flash
Write Flash
Verify
Exit
begin:
option 1 ecuinfo 2 writevin 3 backup 4 load 5 restore 6 verify 7 end
ecuinfo:
if DEBUG != 0
reset
wait 2000
if DEBUG != 0
echo ECU is in DEBUG ON mode
goto continue
endif
endif
prompt 0
readcan VIN 1A 90
readcan System Supplier ID 1A 92
readcan System Name or Engine Type 1A 97 r b
readcan End Model Part No 1A CB r n
readcan Supplier ECU hardware number 1A CC r n
readcan Boot software part number 1A C0 r n
readcan Boot software Alpha Code 1A D0 
readcan Software module 1 ident 1A C1 r n 
readcan Software module 1 ident Alpha Code 1A D1
readcan Software module 2 ident 1A C2 r n 
readcan Software module 2 ident Alpha Code 1A D2
readcan Software module 3 ident 1A C3 r n 
readcan Software module 3 ident Alpha Code 1A D3
readcan Software module 4 ident 1A C4 r n 
readcan Software module 4 ident Alpha Code 1A D4
readcan Software module 5 ident 1A C5 r n 
readcan Software module 5 ident Alpha Code 1A D5
readcan Software module 6 ident 1A C6 r n 
readcan Software module 6 ident Alpha Code 1A D6
readcan Software module 7 ident 1A C7 r n 
readcan Software module 7 ident Alpha Code 1A D7
readcan Software module 8 ident 1A C8 r n 
readcan Software module 8 ident Alpha Code 1A D8
readcan Software module 9 ident 1A C9 r n 
readcan Software module 9 ident Alpha Code 1A D9
readcan Software module A ident 1A CA r n 
readcan Software module A ident Alpha Code 1A DA
readcan Hardware Key Number 1A 98
readcan Programming Date 1A 99 r d
readcan Hardware Mileage 1A DF
goto continue
writevin:
if DEBUG != 0
reset
wait 2000
if DEBUG != 0
echo ECU is in DEBUG ON mode
goto continue
endif
endif
prompt 0
writecan 3B 90 Edit
goto continue
backup:
detect
wait 2000
if DEBUG == 0
echo Please try again
goto continue
endif 
echo Read Flash
getram 0 200000
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 200000
sprogram 0 200000
cmpram 0 200000
if CMPRAM == 0
echo Please power off/on the ECU and try again
endif
goto continue
verify:
cmpram 0 200000
continue:
goto begin
end:
