kellie
09-13-2008, 06:22 AM
'************************************************* *************************************
'* New VB SCRIPT CREATED BY REBELSERF - 3/25/06 *
'* *
'* FOR STREAM LOCKED ROM 103'S REVISION 306/386 OR HIGHER. *
'* USES ONLY NEWDRS.HEX WITH LOADER *
'* LOADER MUST USE MAX4619 OR ADG733 SWITCHES FOR RELIABLE UNLOCKING *
'* *
'* HAPPY UNLOCKING AND GOOD LUCK!! *
'* *
'************************************************* *************************************
Option Explicit
Dim Shell
Set Shell = CreateObject("WScript.Shell")
Dim StartDate
Dim FileName
Dim OutFile
Dim BuffFlg
Dim bytes2
Dim LoopCntr
Dim RstFlg
Dim DlFlg
Dim bytes
Dim Dump
Dim Uflg
Dim Acnt
Dim Mix
Dim VS1
Dim VT1
Dim DS1
Dim LP1
Dim LP2
Dim T1
Dim T2
Dim T3
Dim T4
Dim T5
Dim T6
Dim T7
Dim VG
Dim DD
Dim RT
Dim GT
Dim POSC
Dim NEGC
Dim CYCLE
Dim CYCLECOUNT
POSC = 0
NEGC = 0
CYCLECOUNT = 1
LP1 = 1
Dump = 18432
BuffFlg = 0
LoopCntr = 0
RstFlg = 1
DlFlg = 0
Uflg = 0
VT1 = 2
DS1 = &h2680
DD = &h2700
GT= 7
RT = DS1 'Do not change any values above this line
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
Sub Main()
Setupunlocker()
If CheckChipVer <> 1 then
Sc.MsgBox("Flash Version NDRS needed to run this script" & VbCr & "Flash your Loader with NewdRS.hex")
Exit Sub
End if
' These, AND ONLY THESE :), are the variables you can change for rom 103 any revision up to 307/387
CYCLE = 0 '0 = no cycle that is end after Delay limit is hit; 1 = cycle till glitched or user aborts
LP1 = 40 'Number of tries per delay FROM 20-100 in multiples of 20
VS1 = 25 'YOU CAN CHANGE THIS FROM 02-255 = semi-automatic VCC range - Loader dependent
Mix = 0.25 'Glitch VCC resolution - attempts per VCC = 1/mix
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
VG = VS1
sc.verbose = 0
Sc.Write("A0") ' turn led off
Clearoutputwindow
Call GetFileName()
If ChkCard() = 0 then
Fs.FileClose(OutFile)
exit sub
End If
If T7 = 1 then
Sc.MsgBox("Card not present or is unresponsive." & VBCr & " Unable to continue.")
Fs.FileClose(OutFile)
Exit Sub
End If
sc.verbose = 0
Sc.Write("06 0E 03 01 03 9A 00") 'reset card
sc.read(02)
bytes = sc.getbyte(1)
sc.read(bytes)
sc.delay(16)
Sc.write("2A 6023 210020A0CA00001A041801018600AA9D9D9D9D9D9D9D9D9DAE 69CC76D800000000000079 0E108500")
Sc.Read(2)
bytes = sc.getbyte(1)
If bytes > 5 then
sc.read(bytes)
bytes = sc.getbyte(0)
bytes2 = sc.getbyte(3)
If bytes = 18 and bytes2 = 132 then
Sc.MsgBox("Revision 306/386 or higher code not active on the card." & VbCr & " Card may be open or revision masked." & VBCr & " Unable to continue.")
Fs.FileClose(OutFile)
exit sub
End if
End If
StartDate = Now()
Print "Initial Parameters = Delay:" & HexString(RT, 4) & " VCC:" & HexString(VG, 2) & " Glitch Type:" & HexString(GT, 2)& vbcr & vbcr
Do
'sc.verbose = 1
Sc.Write("B5" & HexString(VG, 4))
Sc.Write("A0")
Acnt = 0
Do
Sc.Write("06 0E 03 01 03 9A 00") 'reset card
Sc.Read(02)
Bytes = Sc.Getbyte(1)
If Bytes > 25 then
Sc.Read(27)
Exit Do
End if
Acnt = Acnt + 1
If Acnt > 5 then
Sc.MsgBox(" Check Loader Settings. Invalid or no atr. Card may be looped." & vbcr & " Unable to continue.")
Fs.FileClose(OutFile)
exit sub
End If
Loop
'sc.verbose = 1 'debug the packets
Sc.Delay(5)
Sc.write("0B 03 15 6004 21C1018869 84 00")
Sc.Read(2)
bytes = sc.getbyte(1)
sc.read(bytes)
Sc.write("0B 03 15 6004 21C10103BC 83 00")
sc.read(2)
Bytes = Sc.Getbyte(1)
Sc.Read(Bytes)
Sc.Write("39 702E 8D009E00000000000000000000000000050000770100801105 71809CA64BB76B1864CD7E0031BD8008AE55CC76D846 20" & HexString(RT,4) & HexString(GT,2) & "0E13 85 00")
Sc.read(2)
bytes = sc.getbyte(1)
If bytes > 5 then
sc.read(bytes)
bytes = sc.getbyte(0)
bytes2 = sc.getbyte(3)
If bytes = &hD8 and bytes2 = &h55 then
Sc.verbose = 1
UFlg = 1
End If
If bytes = &hD8 and bytes2 = &h6F then
Print "-"
NEGC = NEGC + 1
VG = VG - mix
RstFlg = 0
Else
Print "+"
RstFlg = 1
POSC = POSC + 1
VG = VG + mix
End If
Else
PRINT HexString(GT, 2) & "Rst" & HexString(VG, 2)
RstFlg = 1
VG = VG + mix
End if
If Uflg = 1 then
Print " !!!!!!!" & VBCr
Sc.Write("A1")
Shell.Run "%comspec% /c echo " & Chr(07) & Chr(07) & Chr(07) & Chr(07) & Chr(07), 0, True
Sc.delay(500)
print
print "******* Good response received! *********"& VbCr
PRINT " " & HEXSTRING(bytes2,2) & VbCr
Sc.Print "===========================================" & VbCr
print " " & HexString(bytes2, 2) & " was hit at: Delay:" & HexString(RT, 4) & " VCC:" & HexString(VG, 2) & " GlitchType:" & HexString(GT, 2)& " (-) Count:" & NEGC & " (+) Count:" & POSC & " Cycle Count:" & CYCLECOUNT &VBCr
print " Elapsed: " & TimeDiff(StartDate,Now())& vbcr
Print " VCC Resolution: " & mix & vbcr
Print " Delay Range: " & HexString(DS1, 4) & " to " & HexString(DD, 4) & VBCr
print
Call SaveEeprom()
PRINT "EEPROM SAVED AS " & Filename & VBCR
SC.DELAY(700)
PRINT "********************************" & VBCR
PRINT "* REV 306/386 CAM NOW OPEN!! *" & VBCR
PRINT "* PROCEED AS NORMAL *" & VBCR
PRINT "* GOOD LUCK! :-) *" & VBCR
PRINT "********************************" & VBCR
exit sub
End If
If VG < VT1 then
VG = VS1
End If
LP2 = LP2 + 1
If LP2 > LP1 / mix then
ClearOutputWindow
RT = RT + 1
LP2 = 0
print
print "" &vbcr
print "Ram Intercept Installed. Trying to Open the 103.... Delay:" & HexString(RT, 4) & " VCC:" & HexString(VG, 2) & " Glitch Type:" & HexString(GT, 2) & " (-) Count:" & NEGC & " (+) Count:" & POSC & " Cycle Count:" & CYCLECOUNT & VBCr & vbcr
sc.print "Elapsed = " & TimeDiff(StartDate,Now())& vbcr & vbcr
If RT > DD then
RT = DS1 - 1
CYCLECOUNT = CYCLECOUNT + 1
If CYCLE = 0 then
Print " VCC Range:" & VS1 & " Glitch Type:" & HexString(GT, 2)& vbcr
Print " Delay Range: " & HexString(DS1, 4) & " to " & HexString(DD, 4) & VBCr
Print " VCC Mix Resolution: " & mix & vbcr & VBCr
Print " Cycle Completed"
exit sub
End If
End If
End If
If VS1 >= 254 then
exit sub
End If
If VG =< 1 then
VG = VS1
End if
GT = GT - 1
If GT =< 6 then
GT = 7
End If
Loop
End Sub
Sub SaveEEprom()
Dim ByteCount
Dim RcvdBytes
Dim i
ByteCount = 0
sc.verbose = 0
Sc.Write("06 0E 03 01 03 9A 00") 'reset card
sc.read(02)
bytes = sc.getbyte(1)
sc.read(bytes)
sc.delay(16)
Sc.write("56 604F 21004CA0CA000046044401018600AA9D9D9D9D9D9D9D9DCD7B BC718092C6BE3CBF26023CBECD45239BB6BEA1C02713A13826 04A680B7BEAE05A6FF4A26FD5A26F920D9CD7BC7CD7B5DCC76 D29D3000A0 0E10 87 00")
Sc.Read(2)
Bytes = Sc.getbyte(1)
Sc.read(bytes)
Sc.write("13 0E25 600A 210007A0FF000002480033 55" & HexString(dump,4) & "00")
For i = 1 to Dump step 1
sc.read(1)
RcvdBytes = Sc.getbyte(0)
call Fs.FilePutc(OutFile, RcvdBytes)
Call Sc.ProgressBox ("Reading Eeprom", ByteCount, Dump, "Saving Bin...")
ByteCount = ByteCount + 1
Next
Fs.FileClose(OutFile)
end sub
Sub GetFileName()
FileName = Fs.FileSaveDialog("", "Please select a name for the dumped bin", "*.bn103")
If FileName <> "" Then
OutFile = Fs.FileCreate(FileName)
end if
end sub
Function HexString(Number,Length)
Dim RetVal
Dim CurLen
RetVal=Hex(Number)
CurLen=Len(RetVal)
If CurLen<Length Then
RetVal=String(Length-CurLen,"0") & RetVal
End If
HexString=RetVal
End Function
Function CheckChipVer()
CheckChipVer = 1
sc.write("90")
delay(80)
If sc.read(4) <> 4 then
CheckChipVer = 0
Exit Function
End if
If getbyte(0) <> &H4E then CheckChipVer = 0
If getbyte(1) <> &H44 then CheckChipVer = 0
If getbyte(2) <> &H52 then CheckChipVer = 0
If getbyte(3) <> &H53 then CheckChipVer = 0
End Function
Function TimeDiff (StartTime, EndTime)
Dim Hours, Minutes, Seconds
Seconds = DateDiff("s", StartTime, EndTime)
If Seconds > 90000 Then Seconds = 90000
If Seconds < 0 Then Seconds = 0
Minutes = Seconds / 60
Minutes = Fix(Minutes)
Seconds = Seconds - (Minutes * 60)
Hours = Minutes / 60
Hours = Fix(Hours)
Minutes = Minutes - (Hours * 60)
Seconds = CStr(Seconds)
Minutes = CStr(Minutes)
Hours = CStr(Hours)
If Len(Seconds) = 1 Then Seconds = "0" + Seconds
If Len(Minutes) = 1 Then Minutes = "0" + Minutes
If Len(Hours) = 1 Then Hours = "0" + Hours
TimeDiff = Hours & ":" & Minutes & ":" & Seconds
End Function
Function ChkCard()
sc.verbose = 0
ChkCard = 1
Print ""
Print " Checking Card's Eeprom Revision ......." & VBCr
sc.delay(2000)
ClearOutputWindow
Sc.Write("06 0E 03 01 03 9A 00") 'reset card
sc.read(02)
bytes = sc.getbyte(1)
If bytes < 27 then
T7 = 1
ClearOutputWindow
Exit Function
End If
sc.read(bytes)
sc.delay(16)
T1 = chr(sc.getbyte(16))
T2 = chr(sc.getbyte(17))
T3 = chr(sc.getbyte(18))
T4 = chr(sc.getbyte(23))
T5 = chr(sc.getbyte(23))
T6 = chr(sc.getbyte(25))
T1 = T1+T2+T3
T4 = T4+T5+T6
If asc(T4) = 0 then
T4 = "000"
End If
Print " Rom " & T1 & ", Rev " & T4 & " found." & VBCR
print
Sc.delay(1500)
If left(T4, 2) = 24 then
If mid(T4, 3,1) > 4 or mid(T4, 3,1) < 2 then
ChkCard = 0
exit function
End If
End If
If left(T4, 2) = 10 then
If mid(T4, 3,1) > 8 or mid(T4, 3,1) < 6 then
ChkCard = 0
exit function
End If
End If
If T1 <> "103" then
ChkCard = 0
exit function
End If
End Function
Function setupunlocker()
Wx.BaudRate = 115200
Wx.ResetBaudRate = 115200
Wx.Parity = 0 ' 0 = None, 1 = Odd, 2 = Even, 3 = Mark, 4 = Space
Wx.StopBits = 0 ' 0 = 1 stop bit, 1 = 1.5 stop bits, 2 = 2 stop bits
Wx.DTRControl = 0 ' Initial state of DTR 0 = off, 1 = on
Wx.RTSControl = 1 ' Initial state of RTS 0 = off, 1 = on
Wx.ResetDelay = 100 ' In microseconds
Wx.ByteDelay = 10 ' In microseconds
Wx.RxByteTimeout = 3000 ' In milliseconds
Wx.ResetMode = 2 ' 0 = No Resets, 1 = ISO Reset (Expect a ATR), 2 = Device Reset (No ATR)
Wx.ResetLine = 1 ' 0 = Toggle RTS for Reset, 1 = Toggle DTR for Reset
Wx.ByteConvention = 1 ' 0 = Inverse, 1 = Direct
Wx.FlushEchoByte = 0 ' 0 = no flush, 1 = flush - A Phoenix interface will echo each byte transmitted.
Wx.FlushBeforeWrite = 1 ' 0 = no flush, 1 = flush - Flush the receive buffer before each write to strip off Null bytes.
Wx.IgnoreTimeouts = 1 ' 0 = Abort script on a receive timeout, 1 = Ignore all receive timeouts
Wx.ResetAfterTimeout = 0 ' 0 = Don't reset after a timeout, 1 = do a reset after a timeout - Not used if "IgnoreTimeouts=0"
Wx.LogTransactions = 0 ' 0 = Don't log transactions, 1 = log transactions
Wx.DisplayUSW = 0 ' Display USW after script complete 0 = no, 1 = yes
Wx.DisplayFuse = 0 ' Display Fuse after script complete 0 = no, 1 = yes
End function
anyone have sucess let me know your settings
from me kellie a.k.a johnnykilla
'* New VB SCRIPT CREATED BY REBELSERF - 3/25/06 *
'* *
'* FOR STREAM LOCKED ROM 103'S REVISION 306/386 OR HIGHER. *
'* USES ONLY NEWDRS.HEX WITH LOADER *
'* LOADER MUST USE MAX4619 OR ADG733 SWITCHES FOR RELIABLE UNLOCKING *
'* *
'* HAPPY UNLOCKING AND GOOD LUCK!! *
'* *
'************************************************* *************************************
Option Explicit
Dim Shell
Set Shell = CreateObject("WScript.Shell")
Dim StartDate
Dim FileName
Dim OutFile
Dim BuffFlg
Dim bytes2
Dim LoopCntr
Dim RstFlg
Dim DlFlg
Dim bytes
Dim Dump
Dim Uflg
Dim Acnt
Dim Mix
Dim VS1
Dim VT1
Dim DS1
Dim LP1
Dim LP2
Dim T1
Dim T2
Dim T3
Dim T4
Dim T5
Dim T6
Dim T7
Dim VG
Dim DD
Dim RT
Dim GT
Dim POSC
Dim NEGC
Dim CYCLE
Dim CYCLECOUNT
POSC = 0
NEGC = 0
CYCLECOUNT = 1
LP1 = 1
Dump = 18432
BuffFlg = 0
LoopCntr = 0
RstFlg = 1
DlFlg = 0
Uflg = 0
VT1 = 2
DS1 = &h2680
DD = &h2700
GT= 7
RT = DS1 'Do not change any values above this line
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
Sub Main()
Setupunlocker()
If CheckChipVer <> 1 then
Sc.MsgBox("Flash Version NDRS needed to run this script" & VbCr & "Flash your Loader with NewdRS.hex")
Exit Sub
End if
' These, AND ONLY THESE :), are the variables you can change for rom 103 any revision up to 307/387
CYCLE = 0 '0 = no cycle that is end after Delay limit is hit; 1 = cycle till glitched or user aborts
LP1 = 40 'Number of tries per delay FROM 20-100 in multiples of 20
VS1 = 25 'YOU CAN CHANGE THIS FROM 02-255 = semi-automatic VCC range - Loader dependent
Mix = 0.25 'Glitch VCC resolution - attempts per VCC = 1/mix
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
VG = VS1
sc.verbose = 0
Sc.Write("A0") ' turn led off
Clearoutputwindow
Call GetFileName()
If ChkCard() = 0 then
Fs.FileClose(OutFile)
exit sub
End If
If T7 = 1 then
Sc.MsgBox("Card not present or is unresponsive." & VBCr & " Unable to continue.")
Fs.FileClose(OutFile)
Exit Sub
End If
sc.verbose = 0
Sc.Write("06 0E 03 01 03 9A 00") 'reset card
sc.read(02)
bytes = sc.getbyte(1)
sc.read(bytes)
sc.delay(16)
Sc.write("2A 6023 210020A0CA00001A041801018600AA9D9D9D9D9D9D9D9D9DAE 69CC76D800000000000079 0E108500")
Sc.Read(2)
bytes = sc.getbyte(1)
If bytes > 5 then
sc.read(bytes)
bytes = sc.getbyte(0)
bytes2 = sc.getbyte(3)
If bytes = 18 and bytes2 = 132 then
Sc.MsgBox("Revision 306/386 or higher code not active on the card." & VbCr & " Card may be open or revision masked." & VBCr & " Unable to continue.")
Fs.FileClose(OutFile)
exit sub
End if
End If
StartDate = Now()
Print "Initial Parameters = Delay:" & HexString(RT, 4) & " VCC:" & HexString(VG, 2) & " Glitch Type:" & HexString(GT, 2)& vbcr & vbcr
Do
'sc.verbose = 1
Sc.Write("B5" & HexString(VG, 4))
Sc.Write("A0")
Acnt = 0
Do
Sc.Write("06 0E 03 01 03 9A 00") 'reset card
Sc.Read(02)
Bytes = Sc.Getbyte(1)
If Bytes > 25 then
Sc.Read(27)
Exit Do
End if
Acnt = Acnt + 1
If Acnt > 5 then
Sc.MsgBox(" Check Loader Settings. Invalid or no atr. Card may be looped." & vbcr & " Unable to continue.")
Fs.FileClose(OutFile)
exit sub
End If
Loop
'sc.verbose = 1 'debug the packets
Sc.Delay(5)
Sc.write("0B 03 15 6004 21C1018869 84 00")
Sc.Read(2)
bytes = sc.getbyte(1)
sc.read(bytes)
Sc.write("0B 03 15 6004 21C10103BC 83 00")
sc.read(2)
Bytes = Sc.Getbyte(1)
Sc.Read(Bytes)
Sc.Write("39 702E 8D009E00000000000000000000000000050000770100801105 71809CA64BB76B1864CD7E0031BD8008AE55CC76D846 20" & HexString(RT,4) & HexString(GT,2) & "0E13 85 00")
Sc.read(2)
bytes = sc.getbyte(1)
If bytes > 5 then
sc.read(bytes)
bytes = sc.getbyte(0)
bytes2 = sc.getbyte(3)
If bytes = &hD8 and bytes2 = &h55 then
Sc.verbose = 1
UFlg = 1
End If
If bytes = &hD8 and bytes2 = &h6F then
Print "-"
NEGC = NEGC + 1
VG = VG - mix
RstFlg = 0
Else
Print "+"
RstFlg = 1
POSC = POSC + 1
VG = VG + mix
End If
Else
PRINT HexString(GT, 2) & "Rst" & HexString(VG, 2)
RstFlg = 1
VG = VG + mix
End if
If Uflg = 1 then
Print " !!!!!!!" & VBCr
Sc.Write("A1")
Shell.Run "%comspec% /c echo " & Chr(07) & Chr(07) & Chr(07) & Chr(07) & Chr(07), 0, True
Sc.delay(500)
print "******* Good response received! *********"& VbCr
PRINT " " & HEXSTRING(bytes2,2) & VbCr
Sc.Print "===========================================" & VbCr
print " " & HexString(bytes2, 2) & " was hit at: Delay:" & HexString(RT, 4) & " VCC:" & HexString(VG, 2) & " GlitchType:" & HexString(GT, 2)& " (-) Count:" & NEGC & " (+) Count:" & POSC & " Cycle Count:" & CYCLECOUNT &VBCr
print " Elapsed: " & TimeDiff(StartDate,Now())& vbcr
Print " VCC Resolution: " & mix & vbcr
Print " Delay Range: " & HexString(DS1, 4) & " to " & HexString(DD, 4) & VBCr
Call SaveEeprom()
PRINT "EEPROM SAVED AS " & Filename & VBCR
SC.DELAY(700)
PRINT "********************************" & VBCR
PRINT "* REV 306/386 CAM NOW OPEN!! *" & VBCR
PRINT "* PROCEED AS NORMAL *" & VBCR
PRINT "* GOOD LUCK! :-) *" & VBCR
PRINT "********************************" & VBCR
exit sub
End If
If VG < VT1 then
VG = VS1
End If
LP2 = LP2 + 1
If LP2 > LP1 / mix then
ClearOutputWindow
RT = RT + 1
LP2 = 0
print "" &vbcr
print "Ram Intercept Installed. Trying to Open the 103.... Delay:" & HexString(RT, 4) & " VCC:" & HexString(VG, 2) & " Glitch Type:" & HexString(GT, 2) & " (-) Count:" & NEGC & " (+) Count:" & POSC & " Cycle Count:" & CYCLECOUNT & VBCr & vbcr
sc.print "Elapsed = " & TimeDiff(StartDate,Now())& vbcr & vbcr
If RT > DD then
RT = DS1 - 1
CYCLECOUNT = CYCLECOUNT + 1
If CYCLE = 0 then
Print " VCC Range:" & VS1 & " Glitch Type:" & HexString(GT, 2)& vbcr
Print " Delay Range: " & HexString(DS1, 4) & " to " & HexString(DD, 4) & VBCr
Print " VCC Mix Resolution: " & mix & vbcr & VBCr
Print " Cycle Completed"
exit sub
End If
End If
End If
If VS1 >= 254 then
exit sub
End If
If VG =< 1 then
VG = VS1
End if
GT = GT - 1
If GT =< 6 then
GT = 7
End If
Loop
End Sub
Sub SaveEEprom()
Dim ByteCount
Dim RcvdBytes
Dim i
ByteCount = 0
sc.verbose = 0
Sc.Write("06 0E 03 01 03 9A 00") 'reset card
sc.read(02)
bytes = sc.getbyte(1)
sc.read(bytes)
sc.delay(16)
Sc.write("56 604F 21004CA0CA000046044401018600AA9D9D9D9D9D9D9D9DCD7B BC718092C6BE3CBF26023CBECD45239BB6BEA1C02713A13826 04A680B7BEAE05A6FF4A26FD5A26F920D9CD7BC7CD7B5DCC76 D29D3000A0 0E10 87 00")
Sc.Read(2)
Bytes = Sc.getbyte(1)
Sc.read(bytes)
Sc.write("13 0E25 600A 210007A0FF000002480033 55" & HexString(dump,4) & "00")
For i = 1 to Dump step 1
sc.read(1)
RcvdBytes = Sc.getbyte(0)
call Fs.FilePutc(OutFile, RcvdBytes)
Call Sc.ProgressBox ("Reading Eeprom", ByteCount, Dump, "Saving Bin...")
ByteCount = ByteCount + 1
Next
Fs.FileClose(OutFile)
end sub
Sub GetFileName()
FileName = Fs.FileSaveDialog("", "Please select a name for the dumped bin", "*.bn103")
If FileName <> "" Then
OutFile = Fs.FileCreate(FileName)
end if
end sub
Function HexString(Number,Length)
Dim RetVal
Dim CurLen
RetVal=Hex(Number)
CurLen=Len(RetVal)
If CurLen<Length Then
RetVal=String(Length-CurLen,"0") & RetVal
End If
HexString=RetVal
End Function
Function CheckChipVer()
CheckChipVer = 1
sc.write("90")
delay(80)
If sc.read(4) <> 4 then
CheckChipVer = 0
Exit Function
End if
If getbyte(0) <> &H4E then CheckChipVer = 0
If getbyte(1) <> &H44 then CheckChipVer = 0
If getbyte(2) <> &H52 then CheckChipVer = 0
If getbyte(3) <> &H53 then CheckChipVer = 0
End Function
Function TimeDiff (StartTime, EndTime)
Dim Hours, Minutes, Seconds
Seconds = DateDiff("s", StartTime, EndTime)
If Seconds > 90000 Then Seconds = 90000
If Seconds < 0 Then Seconds = 0
Minutes = Seconds / 60
Minutes = Fix(Minutes)
Seconds = Seconds - (Minutes * 60)
Hours = Minutes / 60
Hours = Fix(Hours)
Minutes = Minutes - (Hours * 60)
Seconds = CStr(Seconds)
Minutes = CStr(Minutes)
Hours = CStr(Hours)
If Len(Seconds) = 1 Then Seconds = "0" + Seconds
If Len(Minutes) = 1 Then Minutes = "0" + Minutes
If Len(Hours) = 1 Then Hours = "0" + Hours
TimeDiff = Hours & ":" & Minutes & ":" & Seconds
End Function
Function ChkCard()
sc.verbose = 0
ChkCard = 1
Print ""
Print " Checking Card's Eeprom Revision ......." & VBCr
sc.delay(2000)
ClearOutputWindow
Sc.Write("06 0E 03 01 03 9A 00") 'reset card
sc.read(02)
bytes = sc.getbyte(1)
If bytes < 27 then
T7 = 1
ClearOutputWindow
Exit Function
End If
sc.read(bytes)
sc.delay(16)
T1 = chr(sc.getbyte(16))
T2 = chr(sc.getbyte(17))
T3 = chr(sc.getbyte(18))
T4 = chr(sc.getbyte(23))
T5 = chr(sc.getbyte(23))
T6 = chr(sc.getbyte(25))
T1 = T1+T2+T3
T4 = T4+T5+T6
If asc(T4) = 0 then
T4 = "000"
End If
Print " Rom " & T1 & ", Rev " & T4 & " found." & VBCR
Sc.delay(1500)
If left(T4, 2) = 24 then
If mid(T4, 3,1) > 4 or mid(T4, 3,1) < 2 then
ChkCard = 0
exit function
End If
End If
If left(T4, 2) = 10 then
If mid(T4, 3,1) > 8 or mid(T4, 3,1) < 6 then
ChkCard = 0
exit function
End If
End If
If T1 <> "103" then
ChkCard = 0
exit function
End If
End Function
Function setupunlocker()
Wx.BaudRate = 115200
Wx.ResetBaudRate = 115200
Wx.Parity = 0 ' 0 = None, 1 = Odd, 2 = Even, 3 = Mark, 4 = Space
Wx.StopBits = 0 ' 0 = 1 stop bit, 1 = 1.5 stop bits, 2 = 2 stop bits
Wx.DTRControl = 0 ' Initial state of DTR 0 = off, 1 = on
Wx.RTSControl = 1 ' Initial state of RTS 0 = off, 1 = on
Wx.ResetDelay = 100 ' In microseconds
Wx.ByteDelay = 10 ' In microseconds
Wx.RxByteTimeout = 3000 ' In milliseconds
Wx.ResetMode = 2 ' 0 = No Resets, 1 = ISO Reset (Expect a ATR), 2 = Device Reset (No ATR)
Wx.ResetLine = 1 ' 0 = Toggle RTS for Reset, 1 = Toggle DTR for Reset
Wx.ByteConvention = 1 ' 0 = Inverse, 1 = Direct
Wx.FlushEchoByte = 0 ' 0 = no flush, 1 = flush - A Phoenix interface will echo each byte transmitted.
Wx.FlushBeforeWrite = 1 ' 0 = no flush, 1 = flush - Flush the receive buffer before each write to strip off Null bytes.
Wx.IgnoreTimeouts = 1 ' 0 = Abort script on a receive timeout, 1 = Ignore all receive timeouts
Wx.ResetAfterTimeout = 0 ' 0 = Don't reset after a timeout, 1 = do a reset after a timeout - Not used if "IgnoreTimeouts=0"
Wx.LogTransactions = 0 ' 0 = Don't log transactions, 1 = log transactions
Wx.DisplayUSW = 0 ' Display USW after script complete 0 = no, 1 = yes
Wx.DisplayFuse = 0 ' Display Fuse after script complete 0 = no, 1 = yes
End function
anyone have sucess let me know your settings
from me kellie a.k.a johnnykilla