PDA

View Full Version : A HOWTO: Automating Sector Backups in JKeys


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

chep
08-02-2004, 10:58 PM
This looks interesting and kind of what I was looking for.

I was wondering if you could answer a ? for me about the different sectors shown in Jkeys.

I use HexWorkshop and was wondering how you can relate the diff sectors shown in JKEYs (SA...) to the lines of data shown in Hexworkshop as they are different?

I was trying to learn how to just select the effected sector in jkeys and then use Hexworkshop to edit those bad data points and rewrite JUST the sector info back to the tsop with JKEYS instead of letting the stream update the data from an erased sector.


chep

indal_98
08-02-2004, 11:30 PM
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.



Re-invention of the wheel .....when you have JTAG hookup & Jkey opened with a few simple mouse clicks.....!!!!

LoL ....

JellyBean
08-03-2004, 12:33 AM
Re-invention of the wheel .....when you have JTAG hookup & Jkey opened with a few simple mouse clicks.....!!!!

LoL ....

Not when you are backing up 34+ sectors.... I like automation.

Jellybean

JellyBean
08-03-2004, 02:25 AM
This looks interesting and kind of what I was looking for.

I was wondering if you could answer a ? for me about the different sectors shown in Jkeys.

I use HexWorkshop and was wondering how you can relate the diff sectors shown in JKEYs (SA...) to the lines of data shown in Hexworkshop as they are different?

I was trying to learn how to just select the effected sector in jkeys and then use Hexworkshop to edit those bad data points and rewrite JUST the sector info back to the tsop with JKEYS instead of letting the stream update the data from an erased sector.


chep

A little reading here and there will give you the affected sectors. A 3100.010 @ p226 is SA07. The 301.013 @ p203 is SA50. These sectors I always make a copy of and rename as __ecm_saXX_repair.bin so that I can immediately tell which sector I need to fix in the event of an ecm.

Jellybean

chep
08-03-2004, 03:07 AM
I have read enough to know what the sectors are that need to be repaired. I was wondering how you find that Sector in Hexworkshop from the FULL saved TSOP IMAGE as the #s are not the same as in JKEYS.

I have saved the effected sectors before from JKEYS and opened them up in HexWorkshop and fixed the ecm "7888B44F14" and change all those bytes to "FFFFFFFFFF" and rewritten the flash with JKEYS.

What I am confused about is the HexWorkshop image vs JKEYS #s as they are not numbered the same and I would like to understand the HexWorkshop a little better. :)


chep

JellyBean
08-03-2004, 03:15 AM
I have read enough to know what the sectors are that need to be repaired. I was wondering how you find that Sector in Hexworkshop from the FULL saved TSOP IMAGE as the #s are not the same as in JKEYS.

I have saved the effected sectors before from JKEYS and opened them up in HexWorkshop and fixed the ecm "7888B44F14" and change all those bytes to "FFFFFFFFFF" and rewritten the flash with JKEYS.

What I am confused about is the HexWorkshop image vs JKEYS #s as they are not numbered the same and I would like to understand the HexWorkshop a little better. :)


chep

Search me... I use the individual sectors and edit them with UltraEdit when required.

JellyBean

bartman0916
08-05-2006, 12:24 PM
Is there a way to use this to split up a already made dump for a receiver like a 510 ? I am having to flash it a sector at a time and its a pain to type all that in and get it to line up with each flash sector.
thanks