JellyBean
08-02-2004, 04:45 PM
Overview - this post contains information and a script on how to automate individual sector backups in JKeys to facilitate and compliment complete TSOP backups. Use at your own risk. The author assumes no responsibilty if you mess your equipement up using the information contained within this post.
-------------------------------------------------------------------------
I'll admit it - I'm a packrat and like to be prepared for anything. This obsession does not end with testing either. I am a firm believer in keeping backups of everything, including a break down of all the individual sectors from a given chip in JKeys. I back up every single sector of every single reciever I have of every single firmware revision I have run on my recievers.
Having said all that, JKeys is a bit of a pain when it comes to doing batches of individual sector backups, so I decided it was time to write a script to automate this process. This is not the first time I've done this sort of thing. You old timers who tested Dave will probably remember Kryptonite and the routine you had to go through to get it to start. Back then I found a program called AutoIt, with which I wrote a script to automatically start Krypto on Windows startup.
My SABackup script is based on AutoIt V3, which can be downloaded from hxxp://www.autoitscript.com/autoit3 . AutoIt v3 is an opensource BASIC-like scripting language designed for automating the Windows GUI. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys).
Usage of my script is pretty simple. After you open up JKeys and go to the Flash Programming window, you simplely have to click the drop down menu and determine how many sectors your particular reciever has. For example, the 4700 has a sector count of 35 (SA0 to SA34). To make things easy, I've built my script so that you enter number of the highest SA to backup (in the 4700's case, it is SA34 - so when you run the script, and it asks for the number of sectors, type in 34) and the scripts backs up not only the full chip, but the individual SA0 to SA34 sectors (in the case of the 4700) for a total of 36 reads.
There are a few things you need to ensure for this SABackup script to function correctly. First, ensure you have set an empty folder as your default directory. My script will fail and cause mayham if it has to prompt you to over a file. Secondly, before you enter the number of sectors in your reciever, YOU MUST MAKE SURE that the Chip/Sector Programming box is showing Full and that the IRD Model box is highlighted in blue. Failure to this will result in my script failing, and potentially erasing your chip.
Below you will find the source of my script. Download and install AutoIt V3. Cut and Paste the source of my script into a file called JKEYSSABACKUP.AU3. Open Jkeys, set an empty default directory, go to flash programming, get your sector count, reset flash programming to full and highlight the reciever type, then run JKEYSSBACKUP.AU3. When prompted for the SA count, enter the number of sectors to backup, and click ok. JKEYSSABACKUP.AU3 will then proceed to read and save the full chip, then each individual sector until it is has read all the sectors.
Finally, before posting the script, a disclaimer. USE THIS SCRIPT AND THE INFORMATION WITHIN AT YOUR RISK. If you have never used JKeys before, then I would suggest staying away from this script. This script has only been tested with JKeys 2.9.11.026 (1/23/2004, 3:40pm, 141,312 bytes in size). If are running this script for the first time, I recommend you do a manual full chip backup before attempting to run this script incase it does not function as advertisted (I'd hate to see you wipe your chip with no backup because something in the script went haywire).
Last but not least, I welcome all thoughts, theories, comments or suggestions on this. Best of luck and happy JKeying
**note - you may have to adjust the number of tabs as I have found in later testing that if the reciever has two flashes, the number of tabs in my script needed to be adjusted. Also the sleep command is in milliseconds, so you can adjust it up if you need to.
JellyBean
--------------- begin cut & paste of JEKYSSABACKUP.AU3 here ------------------
$bLoop = 1
While $bLoop = 1
$text = InputBox("Number of SAs", "Please type in the number of SAs and click OK")
If @error = 1 Then
MsgBox(4096, "Error", "You pressed 'Cancel' - try again!")
Else
$bLoop = 0 ; Exit the loop - ExitLoop would have been an alternative too
EndIf
WEnd
$totalsa=$text+1
WinActivate("Flash Programming", "")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
SEND("{ENTER}")
Sleep(150)
SEND("{ENTER}")
Sleep(150)
WinWaitActive("100% Of Memory Read")
Sleep(150)
SEND("{LEFT}")
Sleep(150)
SEND("{ENTER}")
Sleep(150)
WinActivate("Flash Programming")
Sleep(150)
$i = 0
Do
WinActivate("Flash Programming", "")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
SEND("{DOWN}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
SEND("{ENTER}")
Sleep(150)
SEND("{ENTER}")
Sleep(150)
WinWaitActive("100% Of Memory Read")
Sleep(150)
SEND("{LEFT}")
Sleep(150)
SEND("{ENTER}")
Sleep(150)
WinActivate("Flash Programming")
Sleep(150)
$i = $i + 1
Until $i = $totalsa
--------------- end cut & paste of JEKYSSABACKUP.AU3 here ------------------
**edited shortly after posting to fix typo in script.
no live links please
-------------------------------------------------------------------------
I'll admit it - I'm a packrat and like to be prepared for anything. This obsession does not end with testing either. I am a firm believer in keeping backups of everything, including a break down of all the individual sectors from a given chip in JKeys. I back up every single sector of every single reciever I have of every single firmware revision I have run on my recievers.
Having said all that, JKeys is a bit of a pain when it comes to doing batches of individual sector backups, so I decided it was time to write a script to automate this process. This is not the first time I've done this sort of thing. You old timers who tested Dave will probably remember Kryptonite and the routine you had to go through to get it to start. Back then I found a program called AutoIt, with which I wrote a script to automatically start Krypto on Windows startup.
My SABackup script is based on AutoIt V3, which can be downloaded from hxxp://www.autoitscript.com/autoit3 . AutoIt v3 is an opensource BASIC-like scripting language designed for automating the Windows GUI. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys).
Usage of my script is pretty simple. After you open up JKeys and go to the Flash Programming window, you simplely have to click the drop down menu and determine how many sectors your particular reciever has. For example, the 4700 has a sector count of 35 (SA0 to SA34). To make things easy, I've built my script so that you enter number of the highest SA to backup (in the 4700's case, it is SA34 - so when you run the script, and it asks for the number of sectors, type in 34) and the scripts backs up not only the full chip, but the individual SA0 to SA34 sectors (in the case of the 4700) for a total of 36 reads.
There are a few things you need to ensure for this SABackup script to function correctly. First, ensure you have set an empty folder as your default directory. My script will fail and cause mayham if it has to prompt you to over a file. Secondly, before you enter the number of sectors in your reciever, YOU MUST MAKE SURE that the Chip/Sector Programming box is showing Full and that the IRD Model box is highlighted in blue. Failure to this will result in my script failing, and potentially erasing your chip.
Below you will find the source of my script. Download and install AutoIt V3. Cut and Paste the source of my script into a file called JKEYSSABACKUP.AU3. Open Jkeys, set an empty default directory, go to flash programming, get your sector count, reset flash programming to full and highlight the reciever type, then run JKEYSSBACKUP.AU3. When prompted for the SA count, enter the number of sectors to backup, and click ok. JKEYSSABACKUP.AU3 will then proceed to read and save the full chip, then each individual sector until it is has read all the sectors.
Finally, before posting the script, a disclaimer. USE THIS SCRIPT AND THE INFORMATION WITHIN AT YOUR RISK. If you have never used JKeys before, then I would suggest staying away from this script. This script has only been tested with JKeys 2.9.11.026 (1/23/2004, 3:40pm, 141,312 bytes in size). If are running this script for the first time, I recommend you do a manual full chip backup before attempting to run this script incase it does not function as advertisted (I'd hate to see you wipe your chip with no backup because something in the script went haywire).
Last but not least, I welcome all thoughts, theories, comments or suggestions on this. Best of luck and happy JKeying
**note - you may have to adjust the number of tabs as I have found in later testing that if the reciever has two flashes, the number of tabs in my script needed to be adjusted. Also the sleep command is in milliseconds, so you can adjust it up if you need to.
JellyBean
--------------- begin cut & paste of JEKYSSABACKUP.AU3 here ------------------
$bLoop = 1
While $bLoop = 1
$text = InputBox("Number of SAs", "Please type in the number of SAs and click OK")
If @error = 1 Then
MsgBox(4096, "Error", "You pressed 'Cancel' - try again!")
Else
$bLoop = 0 ; Exit the loop - ExitLoop would have been an alternative too
EndIf
WEnd
$totalsa=$text+1
WinActivate("Flash Programming", "")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
SEND("{ENTER}")
Sleep(150)
SEND("{ENTER}")
Sleep(150)
WinWaitActive("100% Of Memory Read")
Sleep(150)
SEND("{LEFT}")
Sleep(150)
SEND("{ENTER}")
Sleep(150)
WinActivate("Flash Programming")
Sleep(150)
$i = 0
Do
WinActivate("Flash Programming", "")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
SEND("{DOWN}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
Send("{TAB}")
Sleep(150)
SEND("{ENTER}")
Sleep(150)
SEND("{ENTER}")
Sleep(150)
WinWaitActive("100% Of Memory Read")
Sleep(150)
SEND("{LEFT}")
Sleep(150)
SEND("{ENTER}")
Sleep(150)
WinActivate("Flash Programming")
Sleep(150)
$i = $i + 1
Until $i = $totalsa
--------------- end cut & paste of JEKYSSABACKUP.AU3 here ------------------
**edited shortly after posting to fix typo in script.
no live links please