Whole script.
' New VB Script File - Created 01/01/05
' FOR NTL ROM 11 BOC rev STREAMLOCKED only.
' AUTOMATIC SCRIPT
' USES Newd11.hex on LOADER only!!!!!!!!!!
'**************************************************************************************
'Instruction Table
'01 Reset Card (Leaves card clock off)
'02 4.608 MHz Card Clock Off -FREEZE CAM
'03 4.608 MHz Card Clock On - FREE RUNNING CAM
'04 DOUBLE HIT, CLOCK LOW, .5 CYCLE DELAY--2*CARD CLOCKS -- ex. 2x xx xx 04 for timing
'05 DOUBLE HIT, CLOCK LOW, 1.5 CYCLE DELAY-2*CARD CLOCKS -- ex. 2x xx xx 05 for timing
'06 Double HIT, CLOCK LOW, 6 CYCLE DELAY-- 2*CARD CLOCKS -- ex. 2x xx xx 06 for timing
'07 Three HIT, CLOCK LOW , 6 CYCLE DELAY-- 2*CARD CLOCKS -- ex. 2x xx xx 07 for rom11 hopeful.
'08 Five HIT, CLOCK LOW, 5 CYCLE DELAY--- 2*CARD CLOCKS -- ex. 2x xx xx 08 for rom11 hopeful.
'09 LOW CLOCK single hit------------------ 2*CARD CLOCKS -- ex. 2x xx xx 09 for timing
'0E XX SET WD TIMER
'0F POWER DOWN CAM
'1X TX RX SPEED
'2X XX XX Delay $2X XX XX Atmel clock cycles
'8X-9X Rx from card, instruction anded with $1f plus 1 bytes Ex. $9F = rx $20 bytes
'aX-FX Tx to card, instruction anded with $5f plus 1 bytes Ex. $FF = Tx $60 bytes
'**************************************************************************************
'Commands
'80 Check Card Presence - Sends 1 byte
'90 Get chip ID - Sends 4 Bytes (DISH)
'AX Set Bi-color Led - X = 0 off, X = 1 Red, X = 2 Green
'B0 XX Set Glitch VCC - VCC = (5/255) * XX
Option Explicit
Dim Bytes
dim TestMode
Dim BR2(5)
Dim VCCStart
Dim VCCLimit
Dim VCC
Dim DelayEnd
Dim DelayStart
Dim GlitchType
Dim TryCnt
DIM TryLimit
DIM TRYCNT2
DIM RT
DIM RT2
DIM CL
DIM Packet
TRYCNT2=1
CL=0
sc.print "________________Setting up WinExplorer_________________" & VbCr
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 = 500 ' 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
Sub Main()
' These are the variables you can change for rom 11
' Packet = what packet does the cam need?
' Use this if you know packet one is on cam and you
' want to send Packet 2 or 3
' ex. Packet = 1
' ex. Packet = 2
' ex. Packet = 3 to send the open emm and exit.
Packet = 1 'packet 1, 2, or 3
DelayStart=&h16ff 'testing rom 11 - 1780
'hit at 140F & 1557 & 16F4 & 14F6 & 1438 & 1398 & 1555
DelayEnd = &H1380 'testing rom 11 - 1380
TryCnt = 330 '330 is good - Number of tries per delay FROM 5-50000
' end of variables
VCCStart = &h30 'YOU CAN CHANGE THIS FROM 21-99 = this is automatic now
VCCLimit = &h00 'YOU CAN CHANGE THIS FROM 00-20 = this is automatic now
GlitchType= &h06 'This is automatic now
VCC = VCCStart
RT = DelayStart
' turn led off
sc.verbose=TRUE
Sc.Write("A0")
Sc.Delay(100)
' card is in turn led on
Sc.Write("A1")
' get atr
sc.verbose=TRUE
Sc.Write("07 0e 03 10 01 03 9a 00") 'reset card
Sc.Read(02)
Bytes = Sc.Getbyte(1)
if Bytes > 25 then
Sc.Read(25)
end if
SC.DELAY(30)
Sc.Write("14 03 10 15 AB 21 00 08 A0 CA 00 00 02 12 00 06 55 0E 03 87 00")
Sc.Read(02)
Bytes = Sc.Getbyte(1)
if Bytes > 7 then
Sc.Read(8)
end if
print
print " Now we will try " & HexString(RT, 4) & " delay" & vbcr
SC.DELAY(30)
Do
Sc.Write("B0" & HexString(VCC, 2))
SC.DELAY(5)
IF CL = 0 then
Sc.Write("07 0e 03 10 01 03 9a 00") 'reset card
sc.read(02)
SC.DELAY(5)
' LOGIN NIPPER
Sc.Write("47 15 E0")
Sc.Write("21003DA0CA000037033554011031054E69705045722049E3407CADFDB96429F4F677C2356D7474")
Sc.Write("00000000000000000000000000000000000000000000000005CE")
Sc.Write("0E 05 8A 00")
Sc.Read(02)
Bytes = Sc.Getbyte(1)
if Bytes > 8 then
Sc.Read(11)
'bytes=sc.getbyte(8)
'PRINT HexString(bytes, 2)
end if
SC.DELAY(10)
end if
CL=0
if Packet = 1 then
' Send D7 Write Packet one
Sc.Write("53 15 E8")
Sc.Write("210045A0D710804066E12439141ACAA1C1D5E9B29B68F861EF 7F043C265563F337FE29F561DB8E")
Sc.Write("17B5E19BD383995049EC665253E28195DF32905312C995CE26 F0")
Sc.Write("D9268605BEFEF2B0 20" & HexString(RT, 4) & HexString(GlitchType, 2) & "0E 05 85 00")
' Sc.Write("53 15 E8")
' Sc.Write("210045A0D710C040F8EE037B057F7753279632187D4DFECA1F D920D841CDA8B377CDCFDFCE4D0A")
' Sc.Write("EC4D7C45B49B9D390D8E5838254384985E54925C09F43B72F1 C8")
' Sc.Write("4B555A2DB4482DDD 20" & HexString(RT, 4) & HexString(GlitchType, 2) & "0E 05 85 00")
Sc.Read(2)
Bytes = Sc.Getbyte(1)
end if
if Packet = 2 then
' Send D7 Write Packet two
Sc.Write("53 15 E8")
Sc.Write("210045A0D710C040F8EE037B057F7753279632187D4DFECA1F D920D841CDA8B377CDCFDFCE4D0A")
Sc.Write("EC4D7C45B49B9D390D8E5838254384985E54925C09F43B72F1 C8")
Sc.Write("4B555A2DB4482DDD 20" & HexString(RT, 4) & HexString(GlitchType, 2) & "0E 05 85 00")
Sc.Read(2)
Bytes = Sc.Getbyte(1)
end if
if Packet = 3 then
' Send Emm to 00 Bugs at C0A1
sc.verbose=TRUE
Sc.Write("07 0e 03 10 01 03 9a 00") 'reset card
Sc.Read(02)
Bytes = Sc.Getbyte(1)
if Bytes > 25 then
Sc.Read(25)
end if
SC.DELAY(50)
Sc.Write("60 15 F6")
Sc.Write("210053A0CA00004D004B54010253418D70D19AF07B434F1A766196896905364B765F4B3D7AF959B982E65780C340784225381D906EEE22C1B8C2105155BB5B56927DF9C98755894A5892FBD516B667B188738577B8059C")
Sc.Write("20 00 FF 0E 05 85 00")
SC.READ(2)
Bytes = Sc.Getbyte(1)
if Bytes > 4 then
Sc.Read(6)
bytes=sc.getbyte(3)
END IF
SC.DELAY(200)
print
PRINT "********************************" & VBCR
PRINT "* NTL C&W ROM11 B0C EMM sent *" & VBCR
PRINT "* ROM11 B0C cam should be open *" & VBCR
PRINT "* test in Nagra to see. *" & VBCR
PRINT "* if not, try again. *" & VBCR
PRINT "********************************" & VBCR
exit sub
end if
if Bytes > 4 then
Sc.Read(5)
bytes=sc.getbyte(3)
RT2 = bytes
'print HexString(bytes, 2)
if RT2 = &H69 then
VCC = VCC - .4 '.2
print "+"
CL=1
SC.DELAY(8)
end IF
if RT2 = &HFF then
VCC = VCC + 1
print "-"
end if
TryCnt2 = TryCnt2 + 1
if trycnt2 > trycnt then
RT = RT - 1.5
TRYCNT2 = 0
if rt < DelayEnd then
rt = DelayStart
END IF
print
print " Now we will try Packet " & HexString(Packet, 1) & ", " & HexString(RT, 4) & " delay, our VCC is about " & HexString(VCC, 2) & " and our Glitch Type was " & HexString(GlitchType, 2)
print
END IF
if RT2 = &H90 then
print
print
print "*********** we hit our bug *************"& VbCr
print "9000 was our loggin = good loggin, D7 packet " & Packet & " wrote to cam"
print
PRINT HEXSTRING(SC.GETBYTE(0),2) & HEXSTRING(SC.GETBYTE(1),2) & HEXSTRING(SC.GETBYTE(2),2) & HEXSTRING(SC.GETBYTE(3),2)& HEXSTRING(SC.GETBYTE(4),2)& VbCr
Sc.Print "===========================================" & VbCr
PRINT HexString(bytes, 2)
print " was hit at " & HexString(RT, 4) & " delay ----VCC WAS " & HexString(VCC, 2) & " , our GlitchType was " & HexString(GlitchType, 2)
print
print
Packet = Packet + 1
SC.DELAY(2500)
end if
if RT2 = &H63 then
print
print
print "*********** we hit our bug *************"& VbCr
print "6300 was our loggin = not logged in, packet didnt take!!"
PRINT HEXSTRING(SC.GETBYTE(0),2) & HEXSTRING(SC.GETBYTE(1),2) & HEXSTRING(SC.GETBYTE(2),2) & HEXSTRING(SC.GETBYTE(3),2)& HEXSTRING(SC.GETBYTE(4),2)& VbCr
Sc.Print "===========================================" & VbCr
PRINT HexString(bytes, 2)
print " was hit at " & HexString(RT, 4) & " delay ----VCC WAS " & HexString(VCC, 2) & " , our GlitchType was " & HexString(GlitchType, 2)
print
print
CL=0
SC.DELAY(2500)
end if
else
PRINT" ! "
VCC = VCC + 1
end if
GlitchType = GlitchType + 0.02
'print HexString(GlitchType, 2)
if GlitchType > 9.4 then
GlitchType = &h06
end if
'if you want just one Glitchtype remove the ' below
GlitchType= &h08
SC.DELAY(8)
sc.verbose=false
LOOP
End Sub
Function HexString(Number,Length)
' This function takes 2 arguments, a number and a length. It converts the decimal
' number given by the first argument to a Hexidecimal string with its length
' equal to the number of digits given by the second argument
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